diff options
author | KFears <kfearsoff@gmail.com> | 2022-06-07 16:42:23 +0500 |
---|---|---|
committer | KFears <kfearsoff@gmail.com> | 2022-06-12 01:19:51 +0500 |
commit | 49834aef6c3cbf58dea93e77201eb3d088738bda (patch) | |
tree | e35a7661937daae14f2f32ed813c90ca8f6c4815 | |
parent | 445f0e645e3d9ef72df29a49bb46b3f8d303eb55 (diff) |
nixos/openvpn3: add enable option
-rw-r--r-- | nixos/modules/module-list.nix | 1 | ||||
-rw-r--r-- | nixos/modules/programs/openvpn3.nix | 33 |
2 files changed, 34 insertions, 0 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index c6d8f4acba380..43ae28ac02c5f 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -197,6 +197,7 @@ ./programs/npm.nix ./programs/noisetorch.nix ./programs/oblogout.nix + ./programs/openvpn3.nix ./programs/pantheon-tweaks.nix ./programs/partition-manager.nix ./programs/plotinus.nix diff --git a/nixos/modules/programs/openvpn3.nix b/nixos/modules/programs/openvpn3.nix new file mode 100644 index 0000000000000..f3101d3cebdc9 --- /dev/null +++ b/nixos/modules/programs/openvpn3.nix @@ -0,0 +1,33 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.programs.openvpn3; +in +{ + options.programs.openvpn3 = { + enable = mkEnableOption "the openvpn3 client"; + }; + + config = mkIf cfg.enable { + services.dbus.packages = with pkgs; [ + openvpn3 + ]; + + users.users.openvpn = { + isSystemUser = true; + uid = config.ids.uids.openvpn; + group = "openvpn"; + }; + + users.groups.openvpn = { + gid = config.ids.gids.openvpn; + }; + + environment.systemPackages = with pkgs; [ + openvpn3 + ]; + }; + +} |