mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-21 05:00:16 +00:00
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 {
|
||||
|
||||
# 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
|
||||
|
|
Loading…
Reference in a new issue