aboutsummaryrefslogtreecommitdiff
path: root/modules/wireguard/nixos
diff options
context:
space:
mode:
Diffstat (limited to 'modules/wireguard/nixos')
-rw-r--r--modules/wireguard/nixos/default.nix50
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;
- };
- };
- };
- }