add wireguard config to all other hosts into wheatley and auto-enable

This commit is contained in:
Lillian Violet 2024-12-06 19:42:52 +01:00
parent 733d98a446
commit 2a29f5587a
3 changed files with 66 additions and 0 deletions

View file

@ -3,6 +3,7 @@
outputs,
lib,
pkgs,
config,
...
}: {
imports = [
@ -213,6 +214,27 @@
networking.hostName = "shodan";
sops.secrets."wg-private-key".mode = "0440";
sops.secrets."wg-private-key".owner = config.users.users.root.name;
networking.wireguard.enable = true;
networking.wg-quick.interfaces = {
wg0 = {
autostart = true;
dns = ["1.1.1.1"];
address = ["10.5.5.4/32"];
privateKeyFile = config.sops.secrets."wg-private-key".path;
peers = [
{
publicKey = "A02sO7uLdgflhPIRd0cbJONIaPP4z8HTxDkmX4NegFg=";
endpoint = "84.87.146.85:5181";
allowedIPs = ["10.47.47.0/24"];
}
];
};
};
security.tpm2.enable = true;
security.tpm2.pkcs11.enable = true; # expose /run/current-system/sw/lib/libtpm2_pkcs11.so
security.tpm2.tctiEnvironment.enable = true; # TPM2TOOLS_TCTI and TPM2_PKCS11_TCTI env variables