modularizing of vps ips

This commit is contained in:
2025-09-16 14:56:42 -06:00
parent cfca87a703
commit 17b2d98b6c
8 changed files with 29 additions and 16 deletions

View File

@@ -5,7 +5,7 @@
../../config/base.nix
../../config/stylix.nix
];
my = import ./toggles.nix;
my = import ./toggles.nix { inherit config; };
sops.secrets."vps/home/private".sopsFile = ../../secrets/wireguard.yaml;
networking =
let
@@ -42,13 +42,13 @@
interfaces.wg0.allowedTCPPorts = [ 8081 ];
};
wireguard.interfaces.wg0 = {
ips = [ "10.77.0.2/32" ];
ips = [ "${config.my.wgServerIp}/32" ];
privateKeyFile = config.sops.secrets."vps/home/private".path;
peers = [
{
publicKey = "dFbiSekBwnZomarcS31o5+w6imHjMPNCipkfc2fZ3GY=";
endpoint = "51.222.141.104:51820";
allowedIPs = [ "10.77.0.1/32" ];
allowedIPs = [ "${config.my.wgVpsIp}/32" ];
persistentKeepalive = 25;
}
];

View File

@@ -1,3 +1,4 @@
{ config }:
let
mkEnabled = name: {
inherit name;
@@ -7,7 +8,7 @@ let
inherit name;
value = {
enable = true;
ip = "10.77.0.2";
ip = config.my.wgServerIp;
};
};
mkEnabledProxy = name: {
@@ -86,7 +87,6 @@ in
"plex"
"prowlarr"
"radarr"
"readeck"
"ryot"
"sonarr"
"synapse"
@@ -95,5 +95,6 @@ in
// enableList mkEnabledIp [
"audiobookshelf"
"vaultwarden"
"readeck"
];
}