about summary refs log tree commit diff
path: root/modules/profiles
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2015-08-22 21:53:48 +0200
committeraszlig <aszlig@redmoonstudios.org>2015-08-22 21:53:48 +0200
commit10abddacd543017557644c6a7e3dea21138a015c (patch)
treeb651712e324f3981c81cce09a213ab2edd6c5218 /modules/profiles
parentee8281ebf6f95b2f7261752315c2dfa931aee652 (diff)
profiles/common: Use nix.nixPath to set NIX_PATH.
We were using environment.sessionVariables before, but
NixOS/nixpkgs@3f1354a added an option exclusively for this. It
internally still sets environment.sessionVariables, so it doesn't change
anything for us because we're overriding the full list anyway.

But should we switch from overriding to appending/prepending someday, we
could get unexpected behaviour, so that's why I'm switching to
nix.nixPath here.

Thanks to @devhell for bringing this to my attention.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'modules/profiles')
-rw-r--r--modules/profiles/common.nix16
1 files changed, 7 insertions, 9 deletions
diff --git a/modules/profiles/common.nix b/modules/profiles/common.nix
index 07efcb38..9dc788cb 100644
--- a/modules/profiles/common.nix
+++ b/modules/profiles/common.nix
@@ -37,16 +37,14 @@ with lib;
       "headcounter.org:/7YANMvnQnyvcVB6rgFTdb8p5LG1OTXaO+21CaOSBzg="
     ];
 
-    environment.sessionVariables = let
+    nix.nixPath = let
       rootChannelsPath = "/nix/var/nix/profiles/per-user/root/channels";
       channelPath = "${rootChannelsPath}/${config.vuizvui.channelName}";
-    in mkIf config.vuizvui.modifyNixPath {
-      NIX_PATH = mkOverride 90 [
-        "vuizvui=${channelPath}"
-        "nixpkgs=${channelPath}/nixpkgs"
-        "nixos-config=/etc/nixos/configuration.nix"
-        rootChannelsPath
-      ];
-    };
+    in mkIf config.vuizvui.modifyNixPath (mkOverride 90 [
+      "vuizvui=${channelPath}"
+      "nixpkgs=${channelPath}/nixpkgs"
+      "nixos-config=/etc/nixos/configuration.nix"
+      rootChannelsPath
+    ]);
   };
 }