diff --git a/modules/config/shells-environment.nix b/modules/config/shells-environment.nix index 4ee80b39fa30..fe72194a1ab3 100644 --- a/modules/config/shells-environment.nix +++ b/modules/config/shells-environment.nix @@ -144,7 +144,7 @@ in /bin/sh ''; - environment.etc."environment".text = + system.build.setEnvironment = pkgs.writeText "set-environment" '' ${concatStringsSep "\n" ( (mapAttrsToList (n: v: ''export ${n}="${concatStringsSep ":" v}"'') diff --git a/modules/programs/bash/bash.nix b/modules/programs/bash/bash.nix index 2324164316df..443c6f570c17 100644 --- a/modules/programs/bash/bash.nix +++ b/modules/programs/bash/bash.nix @@ -119,7 +119,7 @@ in programs.bash = { shellInit = '' - . /etc/environment + . ${config.system.build.setEnvironment} ${cfge.shellInit} ''; diff --git a/modules/programs/zsh/zsh.nix b/modules/programs/zsh/zsh.nix index 97e7a49e5765..cff751934d7d 100644 --- a/modules/programs/zsh/zsh.nix +++ b/modules/programs/zsh/zsh.nix @@ -87,7 +87,7 @@ in programs.zsh = { shellInit = '' - . /etc/environment + . ${config.system.build.setEnvironment} ${cfge.shellInit} '';