refactor(nixos): centralize VPN controls
This commit is contained in:
@@ -27,15 +27,9 @@
|
|||||||
peer = {
|
peer = {
|
||||||
publicKey = "sGEkSD+gEdIMXi4PBN3AhwHGc4tWMtcjOIey3s7yb3I=";
|
publicKey = "sGEkSD+gEdIMXi4PBN3AhwHGc4tWMtcjOIey3s7yb3I=";
|
||||||
endpoint = "100.0.90.192:51820";
|
endpoint = "100.0.90.192:51820";
|
||||||
allowedIPs = [ "10.23.0.0/16" ];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
registry.shell-shortcut.neogaia = {
|
|
||||||
vpn-on = "sudo systemctl start wireguard-wg-home.target";
|
|
||||||
vpn-off = "sudo systemctl stop 'wireguard-wg-home*.service' wireguard-wg-home.target";
|
|
||||||
};
|
|
||||||
|
|
||||||
modules.monorepo.enable = true;
|
modules.monorepo.enable = true;
|
||||||
modules.shell.herdr.enable = true;
|
modules.shell.herdr.enable = true;
|
||||||
modules.shell.gitea-axi.enable = true;
|
modules.shell.gitea-axi.enable = true;
|
||||||
|
|||||||
@@ -82,6 +82,11 @@ in
|
|||||||
|
|
||||||
sops.secrets.${cfg.privateKeySecret}.sopsFile = cfg.sopsFile;
|
sops.secrets.${cfg.privateKeySecret}.sopsFile = cfg.sopsFile;
|
||||||
|
|
||||||
|
registry.shell-shortcut.${config.networking.hostName} = {
|
||||||
|
vpn-on = "sudo systemctl start wireguard-${cfg.interface}.target";
|
||||||
|
vpn-off = "sudo systemctl stop 'wireguard-${cfg.interface}*.service' wireguard-${cfg.interface}.target";
|
||||||
|
};
|
||||||
|
|
||||||
systemd.targets."wireguard-${cfg.interface}" = lib.mkIf (!cfg.autoStart) {
|
systemd.targets."wireguard-${cfg.interface}" = lib.mkIf (!cfg.autoStart) {
|
||||||
wantedBy = lib.mkForce [ ];
|
wantedBy = lib.mkForce [ ];
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user