diff --git a/morph/lib/make-issuer.nix b/morph/lib/make-issuer.nix index 5d0c32b6672de1ea32da910c31c95533a84b7858..97bee06aff091a85b751540d34da3fb177c258e6 100644 --- a/morph/lib/make-issuer.nix +++ b/morph/lib/make-issuer.nix @@ -64,7 +64,7 @@ services.private-storage.monitoring.vpn.client = { enable = true; privateKeyFile = /var/secrets/monitoringvpn/client.key; - ips = ["172.23.23.11/24"]; + ip = "172.23.23.11"; endpointPublicKeyFile = /home/flo/Repositories/PrivateStorageio/morph/PrivateStorageSecrets/monitoringvpn/server.pub; }; } diff --git a/morph/lib/make-monitoring.nix b/morph/lib/make-monitoring.nix index 892ef5add63d956edf2a46695005ef57564bd23a..aeb9b8d80878875b5d7e3a5e22b94b0ab42d90b7 100644 --- a/morph/lib/make-monitoring.nix +++ b/morph/lib/make-monitoring.nix @@ -30,7 +30,7 @@ services.private-storage.monitoring.vpn.server = { enable = true; - ips = [ "172.23.23.1/24" ]; + ip = "172.23.23.1"; }; system.stateVersion = stateVersion; diff --git a/nixos/modules/monitoring/vpn/client.nix b/nixos/modules/monitoring/vpn/client.nix index 4ee5ed4e26dc7a586464ffc742b36e5a1be4632d..19cefd56e8178642f53aec55235361dcf6aa05fc 100644 --- a/nixos/modules/monitoring/vpn/client.nix +++ b/nixos/modules/monitoring/vpn/client.nix @@ -29,12 +29,11 @@ in { Limits which IPs this client receives data from. ''; }; - ips = lib.mkOption { - type = lib.types.listOf lib.types.str; - example = lib.literalExample [ "172.23.23.11/24" ]; + ip = lib.mkOption { + type = lib.types.str; + example = lib.literalExample "172.23.23.11"; description = '' The IP addresses of the interface. - See https://github.com/NixOS/nixpkgs/blob/nixos-20.09/nixos/modules/services/networking/wireguard.nix . ''; }; endpoint = lib.mkOption { @@ -56,7 +55,7 @@ in { config = lib.mkIf cfg.client.enable { networking.wireguard.interfaces.monitoringvpn = { - ips = cfg.client.ips; + ips = [ "${cfg.client.ip}/24" ]; privateKeyFile = toString cfg.client.privateKeyFile; peers = [ { diff --git a/nixos/modules/monitoring/vpn/server.nix b/nixos/modules/monitoring/vpn/server.nix index 8670dca852387f052ced61f44a081eac571c5d05..58cb6df2eaf715bf063a55ab7e3f4a3fa0a291d3 100644 --- a/nixos/modules/monitoring/vpn/server.nix +++ b/nixos/modules/monitoring/vpn/server.nix @@ -22,12 +22,11 @@ in { File with base64 public key generated by <command>cat private.key | wg pubkey > pubkey.pub</command>. ''; }; - ips = lib.mkOption { - type = lib.types.listOf lib.types.str; - example = lib.literalExample [ "172.23.23.1/24" ]; + ip = lib.mkOption { + type = lib.types.str; + example = lib.literalExample [ "172.23.23.23" ]; description = '' - The IP addresses of the interface. - See https://github.com/NixOS/nixpkgs/blob/nixos-20.09/nixos/modules/services/networking/wireguard.nix . + The IP address of the interface. ''; }; port = lib.mkOption { @@ -44,7 +43,7 @@ in { networking.firewall.allowedUDPPorts = [ cfg.server.port ]; networking.wireguard.interfaces.monitoringvpn = { - ips = cfg.server.ips; + ips = [ "${cfg.server.ip}/24" ]; listenPort = cfg.server.port; privateKeyFile = toString cfg.server.privateKeyFile; peers = [