diff --git a/hosts/lolcathost/default.nix b/hosts/lolcathost/default.nix index 376140e..dbdaba0 100755 --- a/hosts/lolcathost/default.nix +++ b/hosts/lolcathost/default.nix @@ -15,6 +15,8 @@ in { ./hardware-configuration.nix (import "${home-manager}/nixos") + ../modules/bashistrans.nix + ../modules/wm/hyprland.nix # ../modules/wm/river.nix ../modules/wm/crywl.nix @@ -375,22 +377,6 @@ in { nix-ld.enable = true; - # I want to use fish as my login shell but it always goes terrible - # cause it isn't POSIX compliant, so instead Bash is my login and - # will just exec fish (^-^) - bash = { - blesh.enable = false; # ble.sh replacement for GNU readline - completion.enable = true; - - 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 - ''; - }; - # Thunar also uses: `services.tumbler` & `services.gvfs` thunar = { enable = true; diff --git a/hosts/modules/bashistrans.nix b/hosts/modules/bashistrans.nix new file mode 100644 index 0000000..d3b285c --- /dev/null +++ b/hosts/modules/bashistrans.nix @@ -0,0 +1,23 @@ +{pkgs, ...}: { + # I want to use fish as my login shell but it always goes terrible + # cause it isn't POSIX compliant, so instead Bash is my login and + # will just exec fish (^-^) + programs.bash = { + blesh.enable = false; # ble.sh replacement for GNU readline + completion.enable = true; + + interactiveShellInit = '' + # help bash transition into a beautiful fish! + if [[ -z $CRY_BASH_IS_TRANS ]] + then + 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 + fi + # bash is trans now! (no more transitioning required) + export CRY_BASH_IS_TRANS=true + ''; + }; +} diff --git a/hosts/myputer/default.nix b/hosts/myputer/default.nix index d424817..6844dcc 100755 --- a/hosts/myputer/default.nix +++ b/hosts/myputer/default.nix @@ -15,6 +15,8 @@ in { ./hardware-configuration.nix (import "${home-manager}/nixos") + ../modules/bashistrans.nix + ../modules/wm/hyprland.nix ../modules/steam.nix