From ce02a2b817db4fd46c45ec2262cbf8ecff0b3f73 Mon Sep 17 00:00:00 2001 From: Charlie Root Date: Thu, 15 Aug 2024 23:26:43 +0200 Subject: [PATCH] gtk: change theme options --- modules/options/style/gtk.nix | 43 +++++++++++++++++++++++++++++++++ modules/style/gtk.nix | 45 +++++------------------------------ 2 files changed, 49 insertions(+), 39 deletions(-) diff --git a/modules/options/style/gtk.nix b/modules/options/style/gtk.nix index e69de29..82e1fa7 100644 --- a/modules/options/style/gtk.nix +++ b/modules/options/style/gtk.nix @@ -0,0 +1,43 @@ +{ + lib, + pkgs, + config, + ... +}: let + inherit (config.modules.other.system) username; + inherit (lib) mkOption mkEnableOption; + inherit (lib.types) str package submodule; +in { + options.modules.style.gtk = { + enable = mkEnableOption "Wether to enable GTK theming"; + theme = { + name = mkOption { + description = "The GTK theme name"; + default = "Gruvbox-Dark-BL"; + type = str; + }; + package = mkOption { + description = "The GTK theme package"; + default = pkgs.gruvbox-gtk-theme; + type = package; + }; + }; + iconTheme = mkOption { + description = "The GTK icon theme"; + type = submodule { + options = { + name = mkOption { + description = "The GTK icon theme name"; + default = "Papirus-Dark"; + type = str; + }; + package = mkOption { + description = "The GTK icon theme package"; + default = pkgs.catppuccin-papirus-folders; + type = package; + }; + }; + }; + }; + }; +} diff --git a/modules/style/gtk.nix b/modules/style/gtk.nix index d82a155..1f0377d 100644 --- a/modules/style/gtk.nix +++ b/modules/style/gtk.nix @@ -1,56 +1,23 @@ { config, lib, - pkgs, ... }: with lib; let cfg = config.modules.theming.gtk; inherit (config.modules.other.system) username; + inherit (config.modules.style.gtk) theme iconTheme; in { - options.modules.theming.gtk = { - enable = mkEnableOption "gtk theming"; - name = mkOption { - description = "gtk theme name"; - type = types.str; - }; - package = mkOption { - description = "gtk theme package"; - type = types.package; - }; - # iconTheme = mkOption { - # description = "gtk icon theme"; - # type = with types; submodule { - # options = { - # name = mkOption { - # description = "gtk icon theme name"; - # type = str; - # }; - # package = mkOption { - # description = "gtk icon theme package"; - # type = package; - # }; - # }; - # }; - # }; - }; - config = mkIf cfg.enable { home-manager.users.${username} = { gtk = { enable = true; - # theme = { - # package = pkgs.gruvbox-gtk-theme; - # name = "Gruvbox-Dark-BL"; - # }; - iconTheme = { - name = "Papirus-Dark"; - package = pkgs.catppuccin-papirus-folders; + theme = { + inherit (theme) name package; + }; + iconTheme = { + inherit (iconTheme) name Package; }; - }; - home.sessionVariables = { - #GTK_THEME = "Gruvbox-Dark-BL"; - # GTK_USE_PORTAL = "1"; }; }; };