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 /nixos/modules/programs | |
parent | 445f0e645e3d9ef72df29a49bb46b3f8d303eb55 (diff) |
nixos/openvpn3: add enable option
Diffstat (limited to 'nixos/modules/programs')
-rw-r--r-- | nixos/modules/programs/openvpn3.nix | 33 |
1 files changed, 33 insertions, 0 deletions
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 + ]; + }; + +} |