diff --git a/flake.nix b/flake.nix index 14a97084..94abf584 100644 --- a/flake.nix +++ b/flake.nix @@ -219,6 +219,7 @@ (import ./stylix/nixos inputs) { stylix = { + inherit inputs; paletteGenerator = self.packages.${pkgs.system}.palette-generator; base16 = base16.lib args; homeManagerIntegration.module = self.homeManagerModules.stylix; @@ -234,6 +235,7 @@ (import ./stylix/hm inputs) { stylix = { + inherit inputs; paletteGenerator = self.packages.${pkgs.system}.palette-generator; base16 = base16.lib args; }; @@ -248,6 +250,7 @@ (import ./stylix/darwin inputs) { stylix = { + inherit inputs; paletteGenerator = self.packages.${pkgs.system}.palette-generator; base16 = base16.lib args; homeManagerIntegration.module = self.homeManagerModules.stylix; diff --git a/modules/firefox/hm.nix b/modules/firefox/hm.nix index 6be1c037..8aacda6c 100644 --- a/modules/firefox/hm.nix +++ b/modules/firefox/hm.nix @@ -6,7 +6,7 @@ }: let - inherit (config.lib.stylix.templates) firefox-gnome-theme; + inherit (config.stylix.inputs) firefox-gnome-theme; targets = [ { path = "firefox"; @@ -46,7 +46,7 @@ let g = colors."${color}-rgb-g"; b = colors."${color}-rgb-b"; }; - nur = config.lib.stylix.templates.nur.legacyPackages.${pkgs.system}; + nur = config.stylix.inputs.nur.legacyPackages.${pkgs.system}; in { options.stylix.targets = lib.listToAttrs ( diff --git a/modules/fish/prompt.nix b/modules/fish/prompt.nix index c07ea295..d2026335 100644 --- a/modules/fish/prompt.nix +++ b/modules/fish/prompt.nix @@ -2,7 +2,7 @@ config: let theme = config.lib.stylix.colors { - templateRepo = config.lib.stylix.templates.base16-fish; + templateRepo = config.stylix.inputs.base16-fish; }; in '' diff --git a/modules/foot/hm.nix b/modules/foot/hm.nix index 7c552654..b242bd10 100644 --- a/modules/foot/hm.nix +++ b/modules/foot/hm.nix @@ -4,7 +4,7 @@ let cfg = config.stylix.targets.foot; theme = config.lib.stylix.colors { - templateRepo = config.lib.stylix.templates.tinted-foot; + templateRepo = config.stylix.inputs.tinted-foot; }; in diff --git a/modules/gnome/hm.nix b/modules/gnome/hm.nix index 660008ef..5c596989 100644 --- a/modules/gnome/hm.nix +++ b/modules/gnome/hm.nix @@ -93,7 +93,8 @@ in source = let theme = pkgs.callPackage ./theme.nix { - inherit (config.lib.stylix) colors templates; + inherit (config.lib.stylix) colors; + inherit (config.stylix) inputs; }; in "${theme}/share/gnome-shell/gnome-shell.css"; diff --git a/modules/gnome/nixos.nix b/modules/gnome/nixos.nix index 63887a56..81661767 100644 --- a/modules/gnome/nixos.nix +++ b/modules/gnome/nixos.nix @@ -7,7 +7,8 @@ let theme = pkgs.callPackage ./theme.nix { - inherit (config.lib.stylix) colors templates; + inherit (config.lib.stylix) colors; + inherit (config.stylix) inputs; }; in diff --git a/modules/gnome/theme.nix b/modules/gnome/theme.nix index 9fb45e8d..e850c897 100644 --- a/modules/gnome/theme.nix +++ b/modules/gnome/theme.nix @@ -3,7 +3,7 @@ sass, glib, colors, - templates, + inputs, }: let @@ -15,7 +15,7 @@ let in stdenv.mkDerivation { name = "${colors.slug}-gnome-shell-theme"; - src = templates.gnome-shell; + src = inputs.gnome-shell; patches = [ ./shell_colors.patch ]; postPatch = '' rm data/theme/gnome-shell-sass/{_colors.scss,_default-colors.scss,_palette.scss} diff --git a/modules/helix/hm.nix b/modules/helix/hm.nix index 5c137c62..786ae8ea 100644 --- a/modules/helix/hm.nix +++ b/modules/helix/hm.nix @@ -7,7 +7,7 @@ let theme = config.lib.stylix.colors { - templateRepo = config.lib.stylix.templates.base16-helix; + templateRepo = config.stylix.inputs.base16-helix; }; # Removing the background exposes transparency from the terminal. The diff --git a/modules/kitty/hm.nix b/modules/kitty/hm.nix index b63da52a..9b60997b 100644 --- a/modules/kitty/hm.nix +++ b/modules/kitty/hm.nix @@ -3,7 +3,7 @@ let cfg = config.stylix.targets.kitty; theme = config.lib.stylix.colors { - templateRepo = config.lib.stylix.templates.tinted-kitty; + templateRepo = config.stylix.inputs.tinted-kitty; target = if cfg.variant256Colors then "default-256" else "default"; }; in diff --git a/modules/tmux/hm.nix b/modules/tmux/hm.nix index ad3b8694..bd3631d0 100644 --- a/modules/tmux/hm.nix +++ b/modules/tmux/hm.nix @@ -2,7 +2,7 @@ let theme = config.lib.stylix.colors { - templateRepo = config.lib.stylix.templates.tinted-tmux; + templateRepo = config.stylix.inputs.tinted-tmux; target = "base16"; }; diff --git a/modules/vim/hm.nix b/modules/vim/hm.nix index ddf68d2c..576075c8 100644 --- a/modules/vim/hm.nix +++ b/modules/vim/hm.nix @@ -7,7 +7,7 @@ let themeFile = config.lib.stylix.colors { - templateRepo = config.lib.stylix.templates.base16-vim; + templateRepo = config.lib.stylix.input.base16-vim; target = "base16"; }; diff --git a/modules/zed/hm.nix b/modules/zed/hm.nix index 137f1be0..c9a91e02 100644 --- a/modules/zed/hm.nix +++ b/modules/zed/hm.nix @@ -5,7 +5,7 @@ }: let theme = config.lib.stylix.colors { - templateRepo = config.lib.stylix.templates.tinted-zed; + templateRepo = config.stylix.inputs.tinted-zed; }; in { diff --git a/stylix/darwin/default.nix b/stylix/darwin/default.nix index ec2224ad..947aaca8 100644 --- a/stylix/darwin/default.nix +++ b/stylix/darwin/default.nix @@ -18,6 +18,5 @@ in "${inputs.self}/stylix/palette.nix" "${inputs.self}/stylix/pixel.nix" "${inputs.self}/stylix/target.nix" - (import ../templates.nix inputs) ] ++ autoload; } diff --git a/stylix/hm/default.nix b/stylix/hm/default.nix index 6af7f968..0fd7f84a 100644 --- a/stylix/hm/default.nix +++ b/stylix/hm/default.nix @@ -21,6 +21,5 @@ in "${inputs.self}/stylix/palette.nix" "${inputs.self}/stylix/pixel.nix" "${inputs.self}/stylix/target.nix" - (import ../templates.nix inputs) ] ++ autoload; } diff --git a/stylix/nixos/default.nix b/stylix/nixos/default.nix index 4bca5d5c..05ce0ff5 100644 --- a/stylix/nixos/default.nix +++ b/stylix/nixos/default.nix @@ -20,6 +20,5 @@ in "${inputs.self}/stylix/palette.nix" "${inputs.self}/stylix/pixel.nix" "${inputs.self}/stylix/target.nix" - (import ../templates.nix inputs) ] ++ autoload; } diff --git a/stylix/palette.nix b/stylix/palette.nix index f57b94b8..2320e7bb 100644 --- a/stylix/palette.nix +++ b/stylix/palette.nix @@ -152,6 +152,12 @@ in internal = true; readOnly = true; }; + + inputs = lib.mkOption { + description = "Inputs of the Stylix flake."; + internal = true; + readOnly = true; + }; }; config = { diff --git a/stylix/templates.nix b/stylix/templates.nix deleted file mode 100644 index 7290925d..00000000 --- a/stylix/templates.nix +++ /dev/null @@ -1,16 +0,0 @@ -inputs: { - config.lib.stylix.templates = { - inherit (inputs) - base16-fish - base16-helix - base16-vim - gnome-shell - tinted-foot - tinted-kitty - tinted-tmux - tinted-zed - firefox-gnome-theme - nur - ; - }; -}