|
|
@ -15,6 +15,10 @@ with lib;
|
|
|
|
mode = "640";
|
|
|
|
mode = "640";
|
|
|
|
group = if (builtins.match ".*networkd.*" config.wirenix.configurer != null) then "systemd-network" else "root";
|
|
|
|
group = if (builtins.match ".*networkd.*" config.wirenix.configurer != null) then "systemd-network" else "root";
|
|
|
|
rekeyFile = config.wirenix.secretsDir + /wirenix-peer- + localPeerName + ".age";
|
|
|
|
rekeyFile = config.wirenix.secretsDir + /wirenix-peer- + localPeerName + ".age";
|
|
|
|
|
|
|
|
generator.tags = [
|
|
|
|
|
|
|
|
"wirenix"
|
|
|
|
|
|
|
|
"wirenix.peer"
|
|
|
|
|
|
|
|
];
|
|
|
|
generator.script = {pkgs, file, ...}: ''
|
|
|
|
generator.script = {pkgs, file, ...}: ''
|
|
|
|
priv=$(${pkgs.wireguard-tools}/bin/wg genkey)
|
|
|
|
priv=$(${pkgs.wireguard-tools}/bin/wg genkey)
|
|
|
|
${pkgs.wireguard-tools}/bin/wg pubkey <<< "$priv" > ${lib.escapeShellArg (lib.removeSuffix ".age" file + ".pub")}
|
|
|
|
${pkgs.wireguard-tools}/bin/wg pubkey <<< "$priv" > ${lib.escapeShellArg (lib.removeSuffix ".age" file + ".pub")}
|
|
|
@ -27,6 +31,10 @@ with lib;
|
|
|
|
mode = "640";
|
|
|
|
mode = "640";
|
|
|
|
group = if (builtins.match ".*networkd.*" config.wirenix.configurer != null) then "systemd-network" else "root";
|
|
|
|
group = if (builtins.match ".*networkd.*" config.wirenix.configurer != null) then "systemd-network" else "root";
|
|
|
|
rekeyFile = config.wirenix.secretsDir + /wirenix-subnet- + name + ".age";
|
|
|
|
rekeyFile = config.wirenix.secretsDir + /wirenix-subnet- + name + ".age";
|
|
|
|
|
|
|
|
generator.tags = [
|
|
|
|
|
|
|
|
"wirenix"
|
|
|
|
|
|
|
|
"wirenix.subnet"
|
|
|
|
|
|
|
|
];
|
|
|
|
generator.script = {pkgs, ...}: ''
|
|
|
|
generator.script = {pkgs, ...}: ''
|
|
|
|
psk=$(${pkgs.wireguard-tools}/bin/wg genpsk)
|
|
|
|
psk=$(${pkgs.wireguard-tools}/bin/wg genpsk)
|
|
|
|
echo "$psk"
|
|
|
|
echo "$psk"
|
|
|
|