mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 04:43:09 +03: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 New Issue
Block a user