aboutsummaryrefslogtreecommitdiff
path: root/nixos/modules
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2022-07-19 13:33:48 +0200
committerKarel Kočí <cynerd@email.cz>2022-07-19 13:33:48 +0200
commit027bcf9b43546063e62578858eee50ac278334f3 (patch)
tree1ed5e40f784941d10afc7c984a6403c2107e5cec /nixos/modules
parent2742cf5f2cb278540740204205dbcc49bdc91b55 (diff)
downloadnixos-personal-027bcf9b43546063e62578858eee50ac278334f3.tar.gz
nixos-personal-027bcf9b43546063e62578858eee50ac278334f3.tar.bz2
nixos-personal-027bcf9b43546063e62578858eee50ac278334f3.zip
nixos: rework openvpn
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/openvpn.nix36
1 files changed, 28 insertions, 8 deletions
diff --git a/nixos/modules/openvpn.nix b/nixos/modules/openvpn.nix
index abcd1f0..d070cb2 100644
--- a/nixos/modules/openvpn.nix
+++ b/nixos/modules/openvpn.nix
@@ -9,18 +9,38 @@ let
in {
options = {
- cynerd.openvpn.enable = mkOption {
- type = types.bool;
- default = false;
- description = "My personal OpenVPN";
+ cynerd.openvpn = {
+ personal = mkOption {
+ type = types.bool;
+ default = false;
+ description = "My personal OpenVPN";
+ };
+ oldpersonal = mkOption {
+ type = types.bool;
+ default = false;
+ description = "My personal old OpenVPN";
+ };
+ elektroline = mkOption {
+ type = types.bool;
+ default = false;
+ description = "Elektroline OpenVPN";
+ };
};
};
- config = mkIf cnf.enable {
- services.openvpn.servers.personal = {
- config = "config /run/secrets/personal.ovpn";
+ config = {
+ services.openvpn.servers = {
+ personal = mkIf cnf.personal {
+ config = "config /run/secrets/personal.ovpn";
+ };
+ oldpersonal = mkIf cnf.oldpersonal {
+ config = "config /run/secrets/old.ovpn";
+ };
+ elektroline = mkIf cnf.elektroline {
+ autoStart = false;
+ config = "config /run/secrets/elektroline.ovpn";
+ };
};
};
}
-