diff --git a/home/default.nix b/home/default.nix index b7917ef..3be4117 100644 --- a/home/default.nix +++ b/home/default.nix @@ -3,7 +3,7 @@ imports = [ ./alacritty.nix ./emacs.nix - ./fish.nix + ./fish ./flameshot.nix ./secrets ./starship.nix diff --git a/home/fish.nix b/home/fish.nix deleted file mode 100644 index d31d7f4..0000000 --- a/home/fish.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ config, lib, ... }: -let - cfg = config.my.home.fish; -in -{ - options.my.home.fish.enable = lib.mkEnableOption "Fish shell"; - - config = lib.mkIf cfg.enable { - programs.fish = { - enable = true; - functions = { - nfl = { - body = '' - set -l flags "--commit-lock-file" - for flake in $argv - set -a flags "--update-input" "$flake" - end - nix flake lock $flags - ''; - description = "convenience wrapper around `nix flake lock` to only update certain flake inputs"; - }; - }; - }; - }; -} diff --git a/home/fish/default.nix b/home/fish/default.nix new file mode 100644 index 0000000..88104e8 --- /dev/null +++ b/home/fish/default.nix @@ -0,0 +1,15 @@ +{ config, lib, ... }: +let + cfg = config.my.home.fish; +in +{ + options.my.home.fish.enable = lib.mkEnableOption "Fish shell"; + + config = lib.mkIf cfg.enable { + programs.fish = { + enable = true; + }; + + xdg.configFile."fish/functions" = { source = ./. + "/functions"; }; + }; +} diff --git a/home/fish/functions/nfl.fish b/home/fish/functions/nfl.fish new file mode 100644 index 0000000..bac1d05 --- /dev/null +++ b/home/fish/functions/nfl.fish @@ -0,0 +1,7 @@ +function nfl + set -l flags "--commit-lock-file" + for flake in $argv + set -a flags "--update-input" "$flake" + end + nix flake lock $flags +end