(hopefully) fix fish

This commit is contained in:
Nikodem Rabuliński 2024-01-14 22:12:54 +01:00
parent 359d902425
commit c6a74dd184
3 changed files with 18 additions and 10 deletions

View file

@ -7,7 +7,6 @@
username, username,
... ...
}: let }: let
inherit (inputs'.settei.packages) fish;
sharedConfig = { sharedConfig = {
settei.user.config = { settei.user.config = {
programs.git = { programs.git = {
@ -30,12 +29,11 @@
}; };
programs.fish.enable = true; programs.fish.enable = true;
environment.shells = [fish]; users.users.${username}.shell = pkgs.fish;
users.users.${username}.shell = fish;
# NixOS' fish module doesn't allow setting what package to use for fish, # NixOS' fish module doesn't allow setting what package to use for fish,
# so I need to override the fish package. # so I need to override the fish package.
nixpkgs.overlays = [(_: _: {inherit fish;})]; nixpkgs.overlays = [(_: _: {inherit (inputs'.settei.packages) fish;})];
}; };
linuxConfig = lib.optionalAttrs isLinux { linuxConfig = lib.optionalAttrs isLinux {

View file

@ -1,3 +1,7 @@
# Set up path
fish_add_path --path --prepend '@bat@/bin'
fish_add_path --path --prepend '@eza@/bin'
# Abbreviations # Abbreviations
abbr --add --global -- flake-update 'nix flake lock --update-input' abbr --add --global -- flake-update 'nix flake lock --update-input'
abbr --add --global -- ns 'nix shell' abbr --add --global -- ns 'nix shell'

View file

@ -4,16 +4,22 @@
... ...
}: { }: {
# TODO: Fix once https://github.com/viperML/wrapper-manager/issues/14 is resolved # TODO: Fix once https://github.com/viperML/wrapper-manager/issues/14 is resolved
wrappers.fish = { wrappers.fish = let
basePackage = pkgs.runCommandNoCC "fish-binary" {} '' inherit (pkgs) runCommandNoCC;
in {
basePackage = runCommandNoCC "fish-binary" {} ''
install -D -m555 ${lib.getExe pkgs.fish} "$out/bin/fish" install -D -m555 ${lib.getExe pkgs.fish} "$out/bin/fish"
''; '';
extraWrapperFlags = "--inherit-argv0";
prependFlags = [ prependFlags = let
# Can't use pathAdd because fish used as login shell will ignore the variables the wrapper sets up
config-fish = runCommandNoCC "config.fish" { inherit (pkgs) bat eza; } ''
substituteAll ${./config.fish} "$out"
'';
in [
"-C" "-C"
"source ${./config.fish}" "source ${config-fish}"
]; ];
pathAdd = with pkgs; [bat eza];
}; };
} }