diff --git a/pkgs/lib/misc.nix b/pkgs/lib/misc.nix index 2cfd15735a74..0a8c61d6c85c 100644 --- a/pkgs/lib/misc.nix +++ b/pkgs/lib/misc.nix @@ -9,6 +9,11 @@ with import ./strings.nix; 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 y else