2023-09-18 03:56:58 +01:00
|
|
|
{config, ...}: let
|
|
|
|
currentHostName = config.networking.hostName;
|
|
|
|
in {
|
|
|
|
services.secrets = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
requiredVaultPaths = [
|
|
|
|
"private-public-keys/data/wireguard/chaos-internal/${currentHostName}"
|
|
|
|
];
|
|
|
|
|
|
|
|
secrets = {
|
2023-09-18 15:40:33 +01:00
|
|
|
wg_public = {
|
|
|
|
fetchScript = ''
|
|
|
|
simple_get "/private-public-keys/wireguard/chaos-internal/${currentHostName}" .public > "$secretFile"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
wg_private = {
|
2023-09-18 03:56:58 +01:00
|
|
|
fetchScript = ''
|
|
|
|
simple_get "/private-public-keys/wireguard/chaos-internal/${currentHostName}" .private > "$secretFile"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|