Stupid.
This commit is contained in:
parent
868e6ca296
commit
d4e19f1dc4
44
lib.nix
44
lib.nix
@ -72,7 +72,7 @@ in {
|
|||||||
getSiteV4PrefixLength getSiteV6PrefixLength;
|
getSiteV4PrefixLength getSiteV6PrefixLength;
|
||||||
|
|
||||||
fudo.types = with lib.types; rec {
|
fudo.types = with lib.types; rec {
|
||||||
networkHost = { name, ... }: {
|
networkHost = {
|
||||||
hostname = mkOption {
|
hostname = mkOption {
|
||||||
type = str;
|
type = str;
|
||||||
description = "Hostname";
|
description = "Hostname";
|
||||||
@ -111,6 +111,46 @@ in {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
networkHosts = attrsOf (submodule networkHost);
|
networkHosts = let
|
||||||
|
# This is necessary because of the default 'name'...sigh.
|
||||||
|
networkHostOpt = { name, ... }: {
|
||||||
|
hostname = mkOption {
|
||||||
|
type = str;
|
||||||
|
description = "Hostname";
|
||||||
|
default = name;
|
||||||
|
};
|
||||||
|
|
||||||
|
ipv4-address = mkOption {
|
||||||
|
type = nullOr str;
|
||||||
|
description = "The V4 IP of a given host, if any.";
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
ipv6-address = mkOption {
|
||||||
|
type = nullOr str;
|
||||||
|
description = "The V6 IP of a given host, if any.";
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
mac-address = mkOption {
|
||||||
|
type = nullOr str;
|
||||||
|
description =
|
||||||
|
"The MAC address of a given host, if desired for IP reservation.";
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
description = mkOption {
|
||||||
|
type = nullOr str;
|
||||||
|
description = "Description of the host.";
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
sshfp-records = mkOption {
|
||||||
|
type = listOf str;
|
||||||
|
description = "List of SSHFP records for this host.";
|
||||||
|
default = [ ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in attrsOf (submodule networkHostOpt);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user