home: fish: use real .fish files for functions
This commit is contained in:
parent
325d3ee1b2
commit
df15e6b6c2
|
@ -3,7 +3,7 @@
|
|||
imports = [
|
||||
./alacritty.nix
|
||||
./emacs.nix
|
||||
./fish.nix
|
||||
./fish
|
||||
./flameshot.nix
|
||||
./secrets
|
||||
./starship.nix
|
||||
|
|
|
@ -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";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
15
home/fish/default.nix
Normal file
15
home/fish/default.nix
Normal file
|
@ -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"; };
|
||||
};
|
||||
}
|
7
home/fish/functions/nfl.fish
Normal file
7
home/fish/functions/nfl.fish
Normal file
|
@ -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
|
Loading…
Reference in a new issue