From 1ae038a0a86348074b422ea87c03836b0962af67 Mon Sep 17 00:00:00 2001 From: azahi Date: Tue, 17 Dec 2024 02:04:27 +0300 Subject: 2024-12-17 --- lib/my.nix | 102 ++++++++++++++++++------------------------------------------- 1 file changed, 30 insertions(+), 72 deletions(-) (limited to 'lib/my.nix') diff --git a/lib/my.nix b/lib/my.nix index b60d980..3a8058e 100644 --- a/lib/my.nix +++ b/lib/my.nix @@ -51,78 +51,6 @@ with lib; isHeadless = mkConfigurationTypeOption "headless"; isHeadful = mkConfigurationTypeOption "headful"; isOther = mkConfigurationTypeOption "other"; - - ipv4 = { - address = mkOption { - description = "The machine's public IPv4 address."; - type = nullOr str; - default = null; - }; - prefixLength = mkOption { - description = "The machine's public IPv4 prefix length."; - type = nullOr int; - default = null; - }; - gatewayAddress = mkOption { - description = "The machine's public IPv4 gateway address."; - type = nullOr str; - default = null; - }; - }; - ipv6 = { - address = mkOption { - description = "The machine's public IPv6 address."; - type = nullOr str; - default = null; - }; - prefixLength = mkOption { - description = "The machine's public IPv6 prefix length."; - type = nullOr int; - default = null; - }; - gatewayAddress = mkOption { - description = "The machine's public IPv6 gateway address."; - type = nullOr str; - default = null; - }; - }; - - wireguard = { - ipv4.address = mkOption { - description = "The machine's internal IPv4 addresses."; - type = nullOr str; - default = null; - }; - ipv6.address = mkOption { - description = "The machine's internal IPv6 addresses."; - type = nullOr str; - default = null; - }; - publicKey = mkOption { - description = "The machine's public key."; - type = nullOr str; - default = null; - }; - }; - - # TODO Automate filling of this from the NSD service module. - # Right now I need to copy domain definitions from there to here - # manually. - # - # Something like taking `config.services.nsd.zones[$domain]` and - # filtering for actual subdomains. We can remove this option - # altogether then. - domains = mkOption { - description = "External domains that resolve to this address."; - type = listOf str; - default = [ ]; - }; - - syncthing.id = mkOption { - description = "Syncthing ID."; - type = nullOr str; - default = null; - }; }; } ) @@ -252,6 +180,12 @@ with lib; "lidarr.${shire}" ]; syncthing.id = "@SYNCTHING_ID@"; + + wireguard-ng = { + ipv4.address = "10.70.1.2"; + ipv6.address = "fd70::1:2"; + publicKey = "@PUBLIC_KEY@"; + }; }; # VPS in Russia. @@ -275,6 +209,12 @@ with lib; ipv6.address = "fd69::0:4"; publicKey = "@PUBLIC_KEY@"; }; + + wireguard-ng = { + ipv4.address = "10.70.0.1"; + ipv6.address = "fd70::0:1"; + publicKey = "@PUBLIC_KEY@"; + }; }; # A beefy desktop: 7950x/rx6750xt/128GB. @@ -289,6 +229,12 @@ with lib; publicKey = "@PUBLIC_KEY@"; }; syncthing.id = "@SYNCTHING_ID@"; + + wireguard-ng = { + ipv4.address = "10.70.3.1"; + ipv6.address = "fd70::3:1"; + publicKey = "@PUBLIC_KEY@"; + }; }; # ThinkPad X1 Nano Gen 3. @@ -303,6 +249,12 @@ with lib; publicKey = "@PUBLIC_KEY@"; }; syncthing.id = "@SYNCTHING_ID@"; + + wgireguard-ng = { + ipv4.address = "10.70.4.1"; + ipv6.address = "fd70::4:1"; + publicKey = "@PUBLIC_KEY@"; + }; }; # Google Pixel 7a w/ GrapheneOS. @@ -314,6 +266,12 @@ with lib; publicKey = "@PUBLIC_KEY@"; }; syncthing.id = "@SYNCTHING_ID@"; + + wireguard-ng = { + ipv4.address = "10.70.5.1"; + ipv6.address = "fd70::5:1"; + publicKey = "@PUBLIC_KEY@"; + }; }; }; }; -- cgit 1.4.1