diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/default.nix | 2 | ||||
-rw-r--r-- | lib/types.nix | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/default.nix b/lib/default.nix index 738e52186..574713e48 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -39,6 +39,8 @@ let listToAttrs (map (name: nameValuePair name set.${name}) (filter (flip hasAttr set) names)); + maybeHead = x: if isList x && length x > 0 then head x else null; + packageName = pkg: pkg.pname or (parseDrvName pkg.name).name; diff --git a/lib/types.nix b/lib/types.nix index b6c266c33..318e2f237 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -188,6 +188,10 @@ rec { ++ [config.pubkey] ++ + optional (config.pubkey_ed25519 != null) '' + Ed25519PublicKey = ${config.pubkey_ed25519} + '' + ++ optional (config.weight != null) "Weight = ${toString config.weight}" ); defaultText = '' |