summaryrefslogtreecommitdiff
path: root/lib/my.nix
diff options
context:
space:
mode:
Diffstat (limited to 'lib/my.nix')
-rw-r--r--lib/my.nix49
1 files changed, 38 insertions, 11 deletions
diff --git a/lib/my.nix b/lib/my.nix
index f9c6a35..9b999a5 100644
--- a/lib/my.nix
+++ b/lib/my.nix
@@ -9,23 +9,36 @@ with lib;
attrsOf (submodule ({name, ...}: {
freeformType = attrs;
options = let
+ mkConfigurationArchOption = type:
+ mkOption {
+ description = "Whether the machine's architecture is a ${type} one.";
+ type = bool;
+ default = false;
+ };
+
mkConfigurationTypeOption = type:
mkOption {
- description = "Whether the machine is a ${type} one.";
+ description = "Whether the machine's functional type is a ${type} one.";
type = bool;
default = false;
};
in {
hostname = mkOption {
- description = "The machine's hostname";
+ description = "The machine's hostname.";
type = str;
default = name;
readOnly = true;
};
+
system = mkOption {
- description = "The machine's system";
- type = enum ["x86_64-linux" "aarch64-linux"];
- default = "x86_64-linux";
+ description = "The machine's system.";
+ type = nullOr (enum [
+ "aarch64-darwin"
+ "aarch64-linux"
+ "x86_64-darwin"
+ "x86_64-linux"
+ ]);
+ default = null;
};
isHeadless = mkConfigurationTypeOption "headless";
@@ -39,12 +52,12 @@ with lib;
default = null;
};
prefixLength = mkOption {
- description = "The machine's IPv4 prefix length.";
+ description = "The machine's public IPv4 prefix length.";
type = nullOr int;
default = null;
};
gatewayAddress = mkOption {
- description = "The machine's IPv4 gateway address.";
+ description = "The machine's public IPv4 gateway address.";
type = nullOr str;
default = null;
};
@@ -56,12 +69,12 @@ with lib;
default = null;
};
prefixLength = mkOption {
- description = "The machine's IPv6 prefix length.";
+ description = "The machine's public IPv6 prefix length.";
type = nullOr int;
default = null;
};
gatewayAddress = mkOption {
- description = "The machine's IPv6 gateway address.";
+ description = "The machine's public IPv6 gateway address.";
type = nullOr str;
default = null;
};
@@ -74,7 +87,7 @@ with lib;
default = null;
};
ipv6.address = mkOption {
- description = "The machine's internal IPv4 addresses.";
+ description = "The machine's internal IPv6 addresses.";
type = nullOr str;
default = null;
};
@@ -93,7 +106,7 @@ with lib;
# filtering for actual subdomains. We can remove this option
# altogether then.
domains = mkOption {
- description = "External domains that resovle to this address.";
+ description = "External domains that resolve to this address.";
type = listOf str;
default = [];
};
@@ -171,7 +184,9 @@ with lib;
shire
];
};
+
varda = {
+ system = "x86_64-linux";
isHeadless = true;
ipv4 = {
gatewayAddress = "@IPV4_ADDRESS@";
@@ -189,7 +204,9 @@ with lib;
publicKey = "@PUBLIC_KEY@";
};
};
+
yavanna = {
+ system = "x86_64-linux";
isHeadless = true;
ipv4 = {
gatewayAddress = "@IPV4_ADDRESS@";
@@ -209,7 +226,9 @@ with lib;
domains = with my.domain; ["flood.${shire}"];
syncthing.id = "@SYNCTHING_ID@";
};
+
eonwe = {
+ system = "x86_64-linux";
isHeadful = true;
wireguard = {
ipv4.address = "10.69.3.1";
@@ -218,7 +237,9 @@ with lib;
};
syncthing.id = "@SYNCTHING_ID@";
};
+
melian = {
+ system = "x86_64-linux";
isHeadful = true;
wireguard = {
ipv4.address = "10.69.4.1";
@@ -227,6 +248,12 @@ with lib;
};
syncthing.id = "@SYNCTHING_ID@";
};
+
+ mairon = {
+ system = "aarch64-darwin";
+ isHeadful = true;
+ };
+
gothmog = {
isOther = true;
wireguard = {