diff options
| author | Collin Williams <96917990+bluedragon1221@users.noreply.github.com> | 2026-03-03 16:45:26 -0600 |
|---|---|---|
| committer | Collin Williams <96917990+bluedragon1221@users.noreply.github.com> | 2026-03-03 16:45:26 -0600 |
| commit | c29a14135736c2516bb5d951e6e97dc8143598db (patch) | |
| tree | 925628abfe934e3ea2cfd4a70357f8f9b5acb474 /modules/wireguard/nixos | |
| parent | ce2cc260710f801c10302847796b931f7ed19709 (diff) | |
changes
Diffstat (limited to 'modules/wireguard/nixos')
| -rw-r--r-- | modules/wireguard/nixos/default.nix | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/modules/wireguard/nixos/default.nix b/modules/wireguard/nixos/default.nix deleted file mode 100644 index 9f05e43..0000000 --- a/modules/wireguard/nixos/default.nix +++ /dev/null @@ -1,50 +0,0 @@ -{ - config, - lib, - ... -}: let - cfg = config.collinux.wireguard; -in - lib.mkIf cfg.enable { - networking.firewall.checkReversePath = "loose"; - - networking.useNetworkd = true; - systemd.network = { - enable = true; - - netdevs."10-wg" = { - netdevConfig = { - Kind = "wireguard"; - Name = "wg0"; - }; - - wireguardConfig = { - PrivateKeyFile = cfg.privateKeyFile; - ListenPort = 51820; - }; - - wireguardPeers = - cfg.peers - |> builtins.mapAttrs (_: m: - { - PublicKey = m.publicKey; - AllowedIPs = [m.ip]; - PersistentKeepalive = 25; - } - // (lib.optionalAttrs (m.endpoint != null) { - Endpoint = m.endpoint; - })) - |> builtins.attrValues; - }; - - networks."12-wireguard" = { - name = "wg0"; - - networkConfig = { - Address = cfg.ip; - DHCP = "no"; - Gateway = cfg.gateway; - }; - }; - }; - } |
