secrets: add wireguard peers

This commit is contained in:
Bruno BELANYI 2021-02-17 12:03:41 +00:00
parent 8b069ab820
commit 2523b764bd
9 changed files with 34 additions and 1 deletions

1
secrets/wireguard/.gitattributes vendored Normal file
View file

@ -0,0 +1 @@
/default.nix filter diff

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,30 @@
{ lib, ... }:
let
peerSpec = {
# "Server"
porthos = {
clientNum = 1;
externalIp = "91.121.177.163";
};
# "Clients"
aramis = {
clientNum = 2;
};
richelieu = {
clientNum = 3;
};
};
makePeer = name: attrs: with lib; {
inherit (attrs) clientNum;
publicKey = fileContents (./. + "/${name}/public.key");
privateKey = fileContents (./. + "/${name}/secret.key");
} // optionalAttrs (attrs ? externalIp) {
inherit (attrs) externalIp;
};
in
{
peers = builtins.mapAttrs makePeer peerSpec;
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.