System Gen172 @ 2025-04-24-01:41:46
This commit is contained in:
parent
a54fb3cea4
commit
9cda35a91a
@ -8,11 +8,6 @@
|
|||||||
in {
|
in {
|
||||||
options.networking.wg.client = {
|
options.networking.wg.client = {
|
||||||
enable = lib.mkEnableOption "Enable WireGuard client";
|
enable = lib.mkEnableOption "Enable WireGuard client";
|
||||||
port = lib.mkOption {
|
|
||||||
type = lib.types.port;
|
|
||||||
default = 51820;
|
|
||||||
description = "Port for WireGuard client";
|
|
||||||
};
|
|
||||||
autoConnect = lib.mkOption {
|
autoConnect = lib.mkOption {
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
@ -25,11 +20,9 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
networking.firewall.allowedUDPPorts = [cfg.port];
|
|
||||||
networking.wg-quick.interfaces.wg0 = {
|
networking.wg-quick.interfaces.wg0 = {
|
||||||
inherit (peers.jonas) address;
|
inherit (peers.jonas) address;
|
||||||
inherit (cfg) privateKeyFile;
|
inherit (cfg) privateKeyFile;
|
||||||
listenPort = cfg.port;
|
|
||||||
autostart = cfg.autoConnect;
|
autostart = cfg.autoConnect;
|
||||||
peers = [
|
peers = [
|
||||||
peers.harbor
|
peers.harbor
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user