From 97696ec554ff9c681c459b17d0b7b355b64ddebd Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 25 Mar 2024 11:03:30 +0100 Subject: [PATCH] different fish exec workaround Signed-off-by: Harald Hoyer --- modules/nixos/user/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/nixos/user/default.nix b/modules/nixos/user/default.nix index 39b3aef..766f3f3 100644 --- a/modules/nixos/user/default.nix +++ b/modules/nixos/user/default.nix @@ -73,8 +73,13 @@ in }".source = cfg.icon; }; + extraOptions.programs.bash.initExtra = '' - [[ $WANT_BASH ]] || exec ${pkgs.fish}/bin/fish -l + 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 ''; };