2022-03-07 12:02:20 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
{
|
2022-03-23 12:49:55 +01:00
|
|
|
age.secrets = {
|
|
|
|
homeVPN = {
|
|
|
|
file = ../../secrets/home-vpn.age;
|
|
|
|
owner = "1000";
|
|
|
|
};
|
|
|
|
homeVPNPassword = {
|
|
|
|
file = ../../secrets/home-vpn-password.age;
|
|
|
|
owner = "1000";
|
|
|
|
};
|
|
|
|
};
|
2022-03-07 12:02:20 +01:00
|
|
|
services.openvpn.servers = {
|
|
|
|
homeVPN = {
|
|
|
|
config = "config /run/agenix/homeVPN ";
|
|
|
|
autoStart = false;
|
|
|
|
updateResolvConf = true;
|
|
|
|
};
|
|
|
|
};
|
2022-03-23 13:05:36 +01:00
|
|
|
systemd.services.openvpn-homeVPN-password = {
|
|
|
|
description = "Enter homeVPN password";
|
|
|
|
script = "cat /run/agenix/homeVPNPassword | systemd-tty-ask-password-agent";
|
|
|
|
wantedBy = [ "openvpn-homeVPN.service" ];
|
|
|
|
after = [ "openvpn-homeVPN.service" ];
|
|
|
|
};
|
2022-03-07 12:02:20 +01:00
|
|
|
}
|