diff --git a/modules/config/shells-environment.nix b/modules/config/shells-environment.nix index 4ee80b39fa3..fe72194a1ab 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 2324164316d..443c6f570c1 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 97e7a49e576..cff751934d7 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} '';