diff options
Diffstat (limited to 'nixos/modules/installer/tools/nixos-option.sh')
-rw-r--r-- | nixos/modules/installer/tools/nixos-option.sh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/nixos/modules/installer/tools/nixos-option.sh b/nixos/modules/installer/tools/nixos-option.sh index a2b963d7661b..b5f69f07826c 100644 --- a/nixos/modules/installer/tools/nixos-option.sh +++ b/nixos/modules/installer/tools/nixos-option.sh @@ -76,14 +76,23 @@ evalAttr(){ local prefix="$1" local strict="$2" local suffix="$3" + + # If strict is set, then set it to "true". + test -n "$strict" && strict=true + evalNix ${strict:+--strict} <<EOF let reach = attrs: attrs${option:+.$option}${suffix:+.$suffix}; nixos = import <nixos> {}; nixpkgs = import <nixpkgs> {}; + strict = ${strict:-false}; cleanOutput = x: with nixpkgs.lib; if isDerivation x then x.outPath else if isFunction x then "<CODE>" + else if strict then + if isAttrs x then mapAttrs (n: cleanOutput) x + else if isList x then map cleanOutput x + else x else x; in cleanOutput (reach nixos.$prefix) |