summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/default.nix6
-rw-r--r--lib/types.nix4
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/default.nix b/lib/default.nix
index f02959bb..be9f60f3 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 3eda2262..689a2c80 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 = {