diff options
Diffstat (limited to 'home-manager/theme.nix')
-rw-r--r-- | home-manager/theme.nix | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/home-manager/theme.nix b/home-manager/theme.nix new file mode 100644 index 0000000..9e4edae --- /dev/null +++ b/home-manager/theme.nix @@ -0,0 +1,101 @@ +{ 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.enable = lib.mkEnableOption "enables theming"; + 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"; + }; + gtk = { + name = lib.mkOption { + type = lib.types.str; + default = "sans-serif"; + description = "default gtk font"; + }; + size = lib.mkOption { + type = with lib.types; nullOr int; + default = null; + description = "default gtk font size"; + }; + }; + }; + theme.cursor = { + name = lib.mkOption { + type = lib.types.str; + default = "Adwaita"; + description = "gtk cursor theme"; + }; + size = lib.mkOption { + type = with lib.types; nullOr int; + default = null; + description = "gtk cursor size"; + }; + }; + }; + + config = lib.mkIf config.theme.enable { + 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.gtk.name; + size = config.theme.font.gtk.size; + }; + cursorTheme = { + name = config.theme.cursor.name; + size = config.theme.cursor.size; + }; + 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 ]; + }; + }; +} |