diff --git a/stylix/hm/default.nix b/stylix/hm/default.nix index 225ea275..e81e5910 100644 --- a/stylix/hm/default.nix +++ b/stylix/hm/default.nix @@ -11,6 +11,7 @@ in { ../opacity.nix ./cursor.nix ./fonts.nix + ./icon.nix (import ./palette.nix { inherit palette-generator base16; }) (import ../templates.nix inputs) ] ++ autoload; diff --git a/stylix/hm/icon.nix b/stylix/hm/icon.nix new file mode 100644 index 00000000..c0d9fddb --- /dev/null +++ b/stylix/hm/icon.nix @@ -0,0 +1,22 @@ +{ config, lib, ... }: + +let + cfg = config.stylix.iconTheme; + inherit (config.stylix) polarity; +in { + imports = [ ../icon.nix ]; + config = lib.mkIf (config.stylix.enable && cfg.enable) { + gtk = { + iconTheme = { + inherit (cfg) package; + name = builtins.head (lib.filter (x: null != x) [ + ({ + inherit (cfg) dark light; + }."${polarity}" or null) + cfg.dark + cfg.light + ]); + }; + }; + }; +} diff --git a/stylix/icon.nix b/stylix/icon.nix new file mode 100644 index 00000000..02dfbcb4 --- /dev/null +++ b/stylix/icon.nix @@ -0,0 +1,26 @@ +{ lib, ... }: + +{ + options.stylix.iconTheme = { + enable = lib.mkOption { + description = "enable/disable icon theming."; + type = lib.types.bool; + default = false; + }; + package = lib.mkOption { + description = "Package providing the icon theme."; + type = lib.types.nullOr lib.types.package; + default = null; + }; + light = lib.mkOption { + description = "Light icon theme name."; + type = lib.types.nullOr lib.types.str; + default = null; + }; + dark = lib.mkOption { + description = "Dark icon theme name."; + type = lib.types.nullOr lib.types.str; + default = null; + }; + }; +}