mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-12 02:40:31 +08:00
adding maybeEnv. This will replace from-env.nix in nixos and will be reused in copySystemConfiguration
From trunk@21353 svn path=/nixpkgs/branches/mass-update-01/; revision=21389
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user