1
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

View File

@ -65,7 +65,9 @@ in
networking.wireguard.enable = true; networking.wireguard.enable = true;
networking.wireguard.interfaces = { networking.wireguard.interfaces = {
wg-clerie = { 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; ips = cfg.ipv6s ++ cfg.ipv4s;
table = "wg-clerie"; table = "wg-clerie";
peers = [ peers = [