System Gen162 @ 2025-04-23-23:20:41

This commit is contained in:
2025-04-23 23:20:42 +02:00
parent 3cb4093f45
commit 002308415d
2 changed files with 10 additions and 8 deletions

View File

@@ -8,6 +8,11 @@
in {
options.networking.wg.client = {
enable = lib.mkEnableOption "Enable WireGuard client";
autoConnect = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Automatically connect to the WireGuard server with systemd";
};
privateKeyFile = lib.mkOption {
type = lib.types.path;
description = "Path to the private key file for the WireGuard client";
@@ -23,5 +28,9 @@ in {
peers.harbor
];
};
systemd.services."wg-quick@wg0".wantedBy =
if cfg.autoConnect
then lib.mkDefault []
else lib.mkForce [];
};
}