about summary refs log tree commit diff
path: root/lib/my.nix
diff options
context:
space:
mode:
authorazahi <azat@bahawi.net>2024-12-17 02:04:27 +0300
committerazahi <azat@bahawi.net>2024-12-17 02:04:27 +0300
commit1ae038a0a86348074b422ea87c03836b0962af67 (patch)
treeae56c73c01b4777e3e24a22c2d67943706997cf0 /lib/my.nix
parent2024-12-02 (diff)
2024-12-17 HEAD master
Diffstat (limited to 'lib/my.nix')
-rw-r--r--lib/my.nix102
1 files changed, 30 insertions, 72 deletions
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@";
+            };
           };
         };
       };

Consider giving Nix/NixOS a try! <3