diff --git a/modules/fish/hm.nix b/modules/fish/hm.nix index 4493aecc..9763c50b 100644 --- a/modules/fish/hm.nix +++ b/modules/fish/hm.nix @@ -1,10 +1,13 @@ -{ config, lib, ... }: +{ mkTarget, ... }: +mkTarget { + name = "fish"; + humanName = "Fish"; -{ - options.stylix.targets.fish.enable = - config.lib.stylix.mkEnableTarget "Fish" true; - - config = lib.mkIf (config.stylix.enable && config.stylix.targets.fish.enable) { - programs.fish.interactiveShellInit = import ./prompt.nix config; - }; + configElements = + { colors, inputs }: + { + programs.fish.interactiveShellInit = import ./prompt.nix { + inherit colors inputs; + }; + }; } diff --git a/modules/fish/nixos.nix b/modules/fish/nixos.nix index 2fa26dd9..02affea0 100644 --- a/modules/fish/nixos.nix +++ b/modules/fish/nixos.nix @@ -1,10 +1,11 @@ -{ config, lib, ... }: +{ mkTarget, ... }: +mkTarget { + name = "fish"; + humanName = "Fish"; -{ - options.stylix.targets.fish.enable = - config.lib.stylix.mkEnableTarget "Fish" true; - - config = lib.mkIf (config.stylix.enable && config.stylix.targets.fish.enable) { - programs.fish.promptInit = import ./prompt.nix config; - }; + configElements = + { colors, inputs }: + { + programs.fish.promptInit = import ./prompt.nix { inherit colors inputs; }; + }; } diff --git a/modules/fish/prompt.nix b/modules/fish/prompt.nix index d2026335..468e9426 100644 --- a/modules/fish/prompt.nix +++ b/modules/fish/prompt.nix @@ -1,15 +1,12 @@ -config: - +{ colors, inputs }: let - theme = config.lib.stylix.colors { - templateRepo = config.stylix.inputs.base16-fish; - }; + theme = colors { templateRepo = inputs.base16-fish; }; in '' source ${theme} # See https://github.com/tomyun/base16-fish/issues/7 for why this condition exists if status --is-interactive && test -z "$TMUX" - base16-${config.lib.stylix.colors.slug} + base16-${colors.slug} end ''