From e935efbc9d44f49ec5dd82e2423011978e332d5c Mon Sep 17 00:00:00 2001 From: Giulio De Pasquale Date: Mon, 20 Feb 2023 10:14:49 -0800 Subject: [PATCH] zsh: Write .bash_profile if not a NixOS host --- roles/home/zsh.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/roles/home/zsh.nix b/roles/home/zsh.nix index fd2bca5..f3b962f 100644 --- a/roles/home/zsh.nix +++ b/roles/home/zsh.nix @@ -8,4 +8,15 @@ theme = "bira"; }; }; + + home.file.".bash_profile".text = + # not having the attribute users means + # we cannot change the default shell (e.g. this is not a NixOS host) + if ! builtins.hasAttr "users" config then '' + if [ -f "$HOME/.bashrc" ]; then + . "$HOME/.bashrc" + fi + + exec ${pkgs.zsh}/bin/zsh + '' else null; }