mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-08-09 05:14:41 -05:00
feat: wireguard test
This commit is contained in:
parent
30712af182
commit
b85ddb710d
23 changed files with 309 additions and 510 deletions
|
@ -2,7 +2,6 @@
|
|||
let
|
||||
inherit (flake.config.services.instances) wireGuard;
|
||||
service = wireGuard;
|
||||
|
||||
wireGuardInterface =
|
||||
{
|
||||
secret,
|
||||
|
@ -25,7 +24,6 @@ let
|
|||
];
|
||||
};
|
||||
};
|
||||
|
||||
interfaces = [
|
||||
{
|
||||
secret = "CA363";
|
||||
|
@ -48,20 +46,24 @@ let
|
|||
endpoint = "139.28.218.130:51820";
|
||||
}
|
||||
];
|
||||
|
||||
sopsPath = secret: {
|
||||
path = "${service.sops.path0}/${service.name}-${secret}";
|
||||
owner = "root";
|
||||
mode = "600";
|
||||
};
|
||||
in
|
||||
{
|
||||
networking.wg-quick.interfaces = builtins.listToAttrs (map wireGuardInterface interfaces);
|
||||
networking = {
|
||||
wg-quick.interfaces = builtins.listToAttrs (map wireGuardInterface interfaces);
|
||||
};
|
||||
|
||||
sops.secrets = builtins.listToAttrs (
|
||||
map (interface: {
|
||||
name = "${service.name}-${interface.secret}";
|
||||
value = sopsPath interface.secret;
|
||||
}) interfaces
|
||||
);
|
||||
sops.secrets =
|
||||
let
|
||||
sopsPath = secret: {
|
||||
path = "${service.sops.path0}/${service.name}-${secret}";
|
||||
owner = "root";
|
||||
mode = "600";
|
||||
};
|
||||
in
|
||||
builtins.listToAttrs (
|
||||
(map (interface: {
|
||||
name = "${service.name}-${interface.secret}";
|
||||
value = sopsPath interface.secret;
|
||||
}) interfaces)
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue