Reformat using nixpkgs-fmt

This commit is contained in:
Tim Schubert 2021-01-02 14:23:50 +01:00
parent 368ed0797d
commit 5a734099bf
Signed by: dadada
GPG key ID: EEB8D1CE62C4DFEA
36 changed files with 209 additions and 168 deletions

View file

@ -21,13 +21,14 @@ let
};
};
};
in {
in
{
options.dadada.vpnServer = {
enable = mkEnableOption "Enable wireguard gateway";
peers = mkOption {
description = "Set of extensions and public keys of peers";
type = with types; attrsOf (submodule wgPeer);
default = {};
default = { };
};
};
config = mkIf cfg.enable {
@ -37,11 +38,13 @@ in {
privateKeyFile = "/var/lib/wireguard/wg0-key";
ips = [ "fd42:dead:beef:1337::0/64" ];
listenPort = 51234;
peers = map (peer: (
{
allowedIPs = [ "fd42:dead:beef:1337::${peer.id}/128" ];
publicKey = peer.key;
})) (attrValues cfg.peers);
peers = map
(peer: (
{
allowedIPs = [ "fd42:dead:beef:1337::${peer.id}/128" ];
publicKey = peer.key;
}))
(attrValues cfg.peers);
};
};
}