aboutsummaryrefslogtreecommitdiff
path: root/modules/wireguard/options.nix
blob: 8e5398e56a761221f13a67079553c73a5d50ae67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{lib, ...}: let
  inherit (lib) mkOption mkEnableOption;
in {
  options = {
    collinux.wireguard = {
      enable = mkEnableOption "wireguard";
      ip = mkOption {
        type = lib.types.str;
        description = "host's ip address on the wireguard network (with cidr)";
      };
      gateway = mkOption {
        type = lib.types.str;
        description = "host's gateway";
      };
      privateKeyFile = mkOption {
        type = lib.types.str;
        description = "path to local private key file";
        example = "/run/secretd.d/wireguard-key";
      };
      peers = mkOption {
        type = lib.types.attrsOf (lib.types.submodule {
          options = {
            publicKey = mkOption {
              type = lib.types.str;
              description = "peer's public key";
            };
            ip = mkOption {
              type = lib.types.str;
              description = "peer's IP address";
            };
            endpoint = mkOption {
              type = lib.types.str;
              description = "peer's endpoint";
            };
          };
        });
      };
    };
  };
}