mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-08-08 21:04:38 -05:00
54 lines
1.3 KiB
Nix
54 lines
1.3 KiB
Nix
![]() |
{ config, flake, ... }:
|
||
|
let
|
||
|
inherit (flake.config.services.instances) wireGuard web;
|
||
|
inherit (flake.config.services) instances;
|
||
|
inherit (flake.config.machines.devices) ceres deimos;
|
||
|
service = wireGuard;
|
||
|
in
|
||
|
{
|
||
|
networking = {
|
||
|
hosts = {
|
||
|
${ceres.wireguard.ip0} = [ instances.searx.domains.url0 ];
|
||
|
};
|
||
|
wireguard.interfaces = {
|
||
|
wg0 = {
|
||
|
ips = [ "${deimos.wireguard.ip0}/32" ];
|
||
|
privateKeyFile = config.sops.secrets."${service.name}-deimos-private".path;
|
||
|
peers = [
|
||
|
{
|
||
|
publicKey = "fs58+Kz+eG9qAXvvMB2NkW+wa88yP61uam4HHWaBJVw=";
|
||
|
allowedIPs = [
|
||
|
"${ceres.wireguard.ip0}/32"
|
||
|
"${web.localhost.address4}/24"
|
||
|
];
|
||
|
endpoint = "${web.remotehost.address0}:${builtins.toString service.ports.port1}";
|
||
|
persistentKeepalive = 25;
|
||
|
}
|
||
|
];
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
|
||
|
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"
|
||
|
]
|
||
|
);
|
||
|
};
|
||
|
}
|