set fish as default login shell via workaround

This commit is contained in:
wi11-holdsworth 2025-08-13 23:51:01 +10:00
parent cfc893048a
commit e1a2780a0a
2 changed files with 18 additions and 2 deletions

View file

@ -34,7 +34,6 @@
]; ];
home = "/home/srv"; home = "/home/srv";
isNormalUser = true; isNormalUser = true;
shell = pkgs.fish;
}; };
}; };

View file

@ -1,4 +1,9 @@
{ config, lib, ... }: {
config,
lib,
pkgs,
...
}:
let let
feature = "fish"; feature = "fish";
in in
@ -22,6 +27,18 @@ in
vim = "nvim"; vim = "nvim";
}; };
}; };
# https://nixos.wiki/wiki/Fish#Setting_fish_as_your_shell
programs.bash = {
enable = true;
initExtra = ''
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
then
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
fi
'';
};
}; };
imports = [ ]; imports = [ ];