{ config, lib, pkgs, ... }:
let
	transformColorValue = color :
		if color == "Green" then "Mint-Y"
		else if color == "Dark-Green" then "Mint-Y-Dark"
		else "Mint-Y-${color}"
	;
in {
	options = {
		theme.mint = {
			enable = lib.mkEnableOption "enables mint theme";
			# TODO add theme.dark option instead of specifying Dark-Color
			theme.color = lib.mkOption {
				type = lib.types.enum [
					"Aqua" "Blue" "Green" "Grey" "Orange" "Pink" "Purple" "Red"
					"Sand" "Teal" "Dark-Aqua" "Dark-Blue" "Dark-Green"
					"Dark-Grey" "Dark-Orange" "Dark-Pink" "Dark-Purple"
					"Dark-Red" "Dark-Sand" "Dark-Teal"
 				];
				default = "Dark-Aqua";
				description = "mint-y theme color eg. 'Dark-Aqua' or 'Red'";
			};
			icons.color = lib.mkOption {
				type = lib.types.enum [
					"Aqua" "Blue" "Green" "Grey" "Orange" "Pink" "Purple" "Red"
					"Sand" "Teal"
				];
				default = "Aqua";
				description = "mint-y icons color eg. 'Aqua' or 'Red'";
			};
		};
		theme.font = {
			sansSerif = lib.mkOption {
				type = lib.types.str;
				default = "Inter";
				description = "default sans serif font";
			};
			monospace = lib.mkOption {
				type = lib.types.str;
				default = "CommitMono";
				description = "default monospace font";
			};
		};
	};

	config = {
		gtk = {
			enable = true;
			theme = lib.mkIf config.theme.mint.enable {
				package = pkgs.mint-themes;
				name = transformColorValue config.theme.mint.theme.color;
			};
			iconTheme = lib.mkIf config.theme.mint.enable {
				package = pkgs.mint-y-icons;
				name = transformColorValue config.theme.mint.icons.color;
			};
			font = {
				name = config.theme.font.sansSerif;
			};
			cursorTheme = {
				name = "Adwaita";
			};
			gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
		};
		qt = {
			enable = true;
			platformTheme.name = "gtk3";
		};
		fonts.fontconfig.defaultFonts = {
			sansSerif = [ config.theme.font.sansSerif ];
			monospace = [ config.theme.font.monospace ];
		};
	};
}