From 241a375f49737a64300dcee35d6566837d27ef93 Mon Sep 17 00:00:00 2001 From: ash Date: Thu, 30 Jun 2022 00:02:38 +0100 Subject: [PATCH] keychain: set SHELL correctly in bash and zsh bash and zsh apparently handle command substitution slightly differently than fish. in bash/zsh: $ export FOO=x $ FOO=y echo $(sh -c 'echo $FOO') x whereas in fish: $ export FOO=x $ FOO=y echo $(sh -c 'echo $FOO') y so we have to assign $SHELL within the substitution for bash and zsh. --- modules/programs/keychain.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/programs/keychain.nix b/modules/programs/keychain.nix index 70b74c91..419c116a 100644 --- a/modules/programs/keychain.nix +++ b/modules/programs/keychain.nix @@ -100,13 +100,13 @@ in { config = mkIf cfg.enable { home.packages = [ cfg.package ]; programs.bash.initExtra = mkIf cfg.enableBashIntegration '' - SHELL=bash eval "$(${shellCommand})" + eval "$(SHELL=bash ${shellCommand})" ''; programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration '' SHELL=fish eval (${shellCommand}) ''; programs.zsh.initExtra = mkIf cfg.enableZshIntegration '' - SHELL=zsh eval "$(${shellCommand})" + eval "$(SHELL=zsh ${shellCommand})" ''; xsession.initExtra = mkIf cfg.enableXsessionIntegration '' eval "$(${shellCommand})"