System Gen159 @ 2025-04-23-00:25:53
This commit is contained in:
27
modules/networking/wireguard/client.nix
Normal file
27
modules/networking/wireguard/client.nix
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.networking.wg.client;
|
||||
peers = import ./peers.nix {};
|
||||
in {
|
||||
options.networking.wg.client = {
|
||||
enable = lib.mkEnableOption "Enable WireGuard client";
|
||||
privateKeyFile = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
description = "Path to the private key file for the WireGuard client";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
networking.wg-quick.interfaces.wg0 = {
|
||||
inherit (peers.jonas) address;
|
||||
inherit (cfg) privateKeyFile;
|
||||
|
||||
peers = [
|
||||
peers.harbor
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user