diff options
author | lassulus <lassulus@lassul.us> | 2020-10-18 19:25:11 +0200 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2020-10-18 19:25:11 +0200 |
commit | 5b29d7a435092aafcea15f588effbb6f45a6a56e (patch) | |
tree | 07340bc138d7bdea55bbb33e50fc2fa1b5387a57 /lib | |
parent | 9626d3cda953929e903b5a06595e98972cb08ffc (diff) | |
parent | b034f63f7a2e4361b32c33c0e1a980eecf1a5aa6 (diff) |
Merge remote-tracking branch 'ni/master'
Diffstat (limited to 'lib')
-rw-r--r-- | lib/default.nix | 6 | ||||
-rw-r--r-- | lib/types.nix | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/default.nix b/lib/default.nix index f02959bba..be9f60f3b 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -60,13 +60,17 @@ let }.${typeOf x}; mapNixDir1 = f: dirPath: + let + toPackageName = name: + if test "^[0-9].*" name then "_${name}" else name; + in listToAttrs (map (relPath: let name = removeSuffix ".nix" relPath; path = dirPath + "/${relPath}"; in - nameValuePair name (f path)) + nameValuePair (toPackageName name) (f path)) (filter (name: name != "default.nix" && !hasPrefix "." name) (attrNames (readDir dirPath)))); diff --git a/lib/types.nix b/lib/types.nix index 3eda2262f..689a2c807 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -116,6 +116,10 @@ rec { type = listOf hostname; default = []; }; + mac = mkOption { + type = nullOr str; + default = null; + }; ip4 = mkOption { type = nullOr (submodule { options = { |