summary refs log tree commit diff
path: root/lib/modules.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-28 17:37:28 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-28 22:45:57 +0100
commite28ea1239fe9413bdb59fd323167b7440b75fc0b (patch)
tree0b85780be6c32e6ef1dcacaf819114c8d99e2cc1 /lib/modules.nix
parent9a8516438e93ec61bc37fc6f2e1125df30df2f4b (diff)
downloadnixpkgs-e28ea1239fe9413bdb59fd323167b7440b75fc0b.tar
nixpkgs-e28ea1239fe9413bdb59fd323167b7440b75fc0b.tar.gz
nixpkgs-e28ea1239fe9413bdb59fd323167b7440b75fc0b.tar.bz2
nixpkgs-e28ea1239fe9413bdb59fd323167b7440b75fc0b.tar.lz
nixpkgs-e28ea1239fe9413bdb59fd323167b7440b75fc0b.tar.xz
nixpkgs-e28ea1239fe9413bdb59fd323167b7440b75fc0b.tar.zst
nixpkgs-e28ea1239fe9413bdb59fd323167b7440b75fc0b.zip
Fix evaluation of environment.variables
Diffstat (limited to 'lib/modules.nix')
-rw-r--r--lib/modules.nix7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/modules.nix b/lib/modules.nix
index 5c5820e92f4..9733929706f 100644
--- a/lib/modules.nix
+++ b/lib/modules.nix
@@ -143,7 +143,7 @@ rec {
     let
       # Process mkOverride properties, adding in the default
       # value specified in the option declaration (if any).
-      defsFinal = filterOverrides
+      defsFinal = filterOverrides'
         ((if opt ? default then [{ file = head opt.declarations; value = mkOptionDefault opt.default; }] else []) ++ defs);
       # Type-check the remaining definitions, and merge them if
       # possible.
@@ -229,7 +229,7 @@ rec {
 
      Note that "z" has the default priority 100.
   */
-  filterOverrides = defs:
+  filterOverrides' = defs:
     let
       defaultPrio = 100;
       getPrio = def: if def.value._type or "" == "override" then def.value.priority else defaultPrio;
@@ -238,6 +238,9 @@ rec {
       strip = def: if def.value._type or "" == "override" then def // { value = def.value.content; } else def;
     in concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs;
 
+  /* For use in options like environment.variables. */
+  filterOverrides = defs: map (def: def.value) (filterOverrides' (map (def: { value = def; }) defs));
+
   /* Hack for backward compatibility: convert options of type
      optionSet to configOf.  FIXME: remove eventually. */
   fixupOptionType = loc: opt: