From 0f5b2634227ae1daecd31f5f2fe45d26b40496c6 Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Mon, 4 Nov 2024 11:21:32 -0500 Subject: [PATCH] fish plugins --- modules/core.nix | 11 +++++++++++ modules/programs.nix | 1 + 2 files changed, 12 insertions(+) diff --git a/modules/core.nix b/modules/core.nix index c04fc50..0cd1cc5 100644 --- a/modules/core.nix +++ b/modules/core.nix @@ -88,6 +88,17 @@ ]; }; + # REASONING: fish is not a POSIX compliant shell so if something happens we need to use bash as the login shell to prevent an irrecoverable shell + programs.bash = { + interactiveShellInit = '' + 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 + ''; + }; + programs.fish = { enable = true; }; diff --git a/modules/programs.nix b/modules/programs.nix index 99409a9..47f6ccd 100644 --- a/modules/programs.nix +++ b/modules/programs.nix @@ -139,6 +139,7 @@ # Fish shell stuff [ fishPlugins.tide + procps ] ); }