1
0
Fork 0

modules/wg-clerie: Lookup private key in sops too

This commit is contained in:
clerie 2024-04-21 18:22:07 +02:00
parent b5fca78654
commit dd1d36345c
1 changed files with 3 additions and 1 deletions

View File

@ -65,7 +65,9 @@ in
networking.wireguard.enable = true;
networking.wireguard.interfaces = {
wg-clerie = {
privateKeyFile = if cfg.privateKeyFile == null then config.age.secrets.wg-clerie.path else cfg.privateKeyFile;
privateKeyFile = if cfg.privateKeyFile != null then cfg.privateKeyFile else
if builtins.elem "wg-clerie" (attrNames config.sops.secrets) then config.sops.secrets.wg-clerie.path else
config.age.secrets.wg-clerie.path;
ips = cfg.ipv6s ++ cfg.ipv4s;
table = "wg-clerie";
peers = [