From c23e63bda89dc97cbce79705b22eb2f6d18b393e Mon Sep 17 00:00:00 2001 From: ShatteredMINT Date: Thu, 2 Apr 2026 10:02:23 +0200 Subject: [PATCH] EXPERIMENT: make wireguard config customizable --- flake.nix | 2 +- software/wireguard-client.nix | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 87b5e3a..886e69c 100644 --- a/flake.nix +++ b/flake.nix @@ -55,7 +55,7 @@ ./users/shatteredmint.nix ./network-shares.nix - ./software/wireguard-client.nix 10 + (import ./software/wireguard-client.nix {ip = 10;}) ]; }; nix-nas = lib.nixosSystem { diff --git a/software/wireguard-client.nix b/software/wireguard-client.nix index d92329c..312e642 100644 --- a/software/wireguard-client.nix +++ b/software/wireguard-client.nix @@ -2,13 +2,13 @@ # this configuration is for a device on the home network # it exposes the entire home network to outside peers -{ip, config, pkgs, ...}@inputs: { +{ip}: { networking = { firewall.allowedUDPPorts = [56878]; wireguard = { enable = true; interfaces.wg0 = { - ips = [ ("192.168.87." ++ ip ++ "/32")]; + ips = [ ("192.168.87." + builtins.toString(ip) + "/32")]; listenPort = 56878; privateKeyFile = "/root/wg.keys";