From b933b15d728b9fcde45ebe40da9bbe22c4e0cf68 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 24 Sep 2013 10:58:01 +0200 Subject: [PATCH] Don't generate /etc/environment /etc/environment, if it exists, should be a list of NAME=VALUE pairs, not a shell script. See the pam_env manpage. --- modules/config/shells-environment.nix | 2 +- modules/programs/bash/bash.nix | 2 +- modules/programs/zsh/zsh.nix | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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} '';