System Gen162 @ 2025-04-23-23:20:41
This commit is contained in:
@@ -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 [];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user