adding maybeEnv. This will replace from-env.nix in nixos and will be reused in copySystemConfiguration
svn path=/nixpkgs/trunk/; revision=21353
This commit is contained in:
parent
d2b3e548a1
commit
ae8d4501b6
|
@ -9,6 +9,11 @@ with import ./strings.nix;
|
||||||
|
|
||||||
rec {
|
rec {
|
||||||
|
|
||||||
|
# returns default if env var is not set
|
||||||
|
maybeEnv = name: default:
|
||||||
|
let value = builtins.getEnv name; in
|
||||||
|
if value == "" then default else value;
|
||||||
|
|
||||||
defaultMergeArg = x : y: if builtins.isAttrs y then
|
defaultMergeArg = x : y: if builtins.isAttrs y then
|
||||||
y
|
y
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue