mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-08-09 13:24:38 -05:00
38 lines
827 B
Nix
Executable file
38 lines
827 B
Nix
Executable file
{ config, flake, ... }:
|
|
let
|
|
inherit (flake.config.services.instances) wireGuard;
|
|
inherit (flake.config.machines.devices) deimos;
|
|
service = wireGuard;
|
|
in
|
|
{
|
|
networking = {
|
|
wireguard.interfaces = {
|
|
wg0 = {
|
|
ips = [ "${deimos.wireguard.ip0}/32" ];
|
|
privateKeyFile = config.sops.secrets."${service.name}-deimos-private".path;
|
|
};
|
|
};
|
|
};
|
|
|
|
sops =
|
|
let
|
|
sopsPath = secret: {
|
|
path = "${service.sops.path0}/${service.name}-${secret}-pass";
|
|
owner = "root";
|
|
mode = "600";
|
|
};
|
|
in
|
|
{
|
|
secrets = builtins.listToAttrs (
|
|
map
|
|
(secret: {
|
|
name = "${service.name}-${secret}";
|
|
value = sopsPath secret;
|
|
})
|
|
[
|
|
"deimos-private"
|
|
"deimos-public"
|
|
]
|
|
);
|
|
};
|
|
}
|