🧹 restructure layout
This commit is contained in:
parent
40c2a5fb29
commit
268374ad58
115 changed files with 2641 additions and 2085 deletions
|
|
@ -1,27 +1,45 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.my.services.openvpn;
|
||||
in
|
||||
{
|
||||
age.secrets = {
|
||||
homeVPN = {
|
||||
file = ../../secrets/home-vpn.age;
|
||||
owner = "1000";
|
||||
};
|
||||
homeVPNPassword = {
|
||||
file = ../../secrets/home-vpn-password.age;
|
||||
owner = "1000";
|
||||
options.my.services.openvpn = {
|
||||
enable = mkOption {
|
||||
default = false;
|
||||
type = types.bool;
|
||||
example = true;
|
||||
};
|
||||
};
|
||||
services.openvpn.servers = {
|
||||
homeVPN = {
|
||||
config = "config /run/agenix/homeVPN ";
|
||||
autoStart = false;
|
||||
updateResolvConf = true;
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
age.secrets = {
|
||||
homeVPN = {
|
||||
file = ../../secrets/home-vpn.age;
|
||||
owner = "1000";
|
||||
};
|
||||
homeVPNPassword = {
|
||||
file = ../../secrets/home-vpn-password.age;
|
||||
owner = "1000";
|
||||
};
|
||||
};
|
||||
services.openvpn.servers = {
|
||||
homeVPN = {
|
||||
config = "config /run/agenix/homeVPN ";
|
||||
autoStart = false;
|
||||
updateResolvConf = true;
|
||||
};
|
||||
};
|
||||
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" ];
|
||||
};
|
||||
};
|
||||
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" ];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue