aaaaa
This commit is contained in:
parent
8da8606655
commit
486fe5fc8b
4 changed files with 9 additions and 0 deletions
|
|
@ -10,6 +10,7 @@
|
|||
agenix.secrets."ovpnCrt1" = { };
|
||||
agenix.secrets."ovpnPw1" = { };
|
||||
agenix.secrets."ovpnPw2" = { };
|
||||
agenix.secrets."ovpnScript" = { };
|
||||
agenix.secrets."tailscaleKey" = { };
|
||||
services.tailscale-openvpn = {
|
||||
enable = true;
|
||||
|
|
@ -19,6 +20,7 @@
|
|||
de = config.age.secrets.ovpnDe.path;
|
||||
tu = config.age.secrets.ovpnTu.path;
|
||||
};
|
||||
script = config.age.secrets.ovpnScript.path;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ with lib;
|
|||
type = types.attrsOf types.str;
|
||||
};
|
||||
tsAuthKey = mkOption { type = types.str; };
|
||||
script = mkOption { type = types.str; };
|
||||
};
|
||||
config =
|
||||
let
|
||||
|
|
@ -50,6 +51,11 @@ with lib;
|
|||
"/run/agenix.d" = { hostPath = "/run/agenix.d"; isReadOnly = true; };
|
||||
};
|
||||
config = {
|
||||
systemd.services.ovpnScript = {
|
||||
wantedBy = ["multi-user.target"];
|
||||
script = ''${pkgs.bash}/bin/bash /host${cfg.script}'';
|
||||
path = [ pkgs.dig ];
|
||||
};
|
||||
services.openvpn.servers.${name} = {
|
||||
config = ''
|
||||
config /host${cfg.config.${name}}
|
||||
|
|
|
|||
BIN
secrets/ovpnScript.age
Normal file
BIN
secrets/ovpnScript.age
Normal file
Binary file not shown.
|
|
@ -55,5 +55,6 @@ in
|
|||
"ovpnCrt1.age".publicKeys = pubkeys.ragon.host "picard";
|
||||
"ovpnPw1.age".publicKeys = pubkeys.ragon.host "picard";
|
||||
"ovpnPw2.age".publicKeys = pubkeys.ragon.host "picard";
|
||||
"ovpnScript.age".publicKeys = pubkeys.ragon.host "picard";
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue