home: fish: use real .fish files for functions

This commit is contained in:
Antoine Martin 2021-04-22 17:52:39 +02:00
parent 325d3ee1b2
commit df15e6b6c2
4 changed files with 23 additions and 26 deletions

View file

@ -3,7 +3,7 @@
imports = [
./alacritty.nix
./emacs.nix
./fish.nix
./fish
./flameshot.nix
./secrets
./starship.nix

View file

@ -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
View 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"; };
};
}

View 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