2022-06-16 17:23:12 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.programs.openvpn3;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.programs.openvpn3 = {
|
2022-09-09 14:08:57 +00:00
|
|
|
enable = mkEnableOption (lib.mdDoc "the openvpn3 client");
|
2023-10-19 13:55:26 +00:00
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = pkgs.openvpn3.override {
|
|
|
|
enableSystemdResolved = config.services.resolved.enable;
|
|
|
|
};
|
|
|
|
defaultText = literalExpression ''pkgs.openvpn3.override {
|
|
|
|
enableSystemdResolved = config.services.resolved.enable;
|
|
|
|
}'';
|
|
|
|
description = lib.mdDoc ''
|
|
|
|
Which package to use for `openvpn3`.
|
|
|
|
'';
|
|
|
|
};
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2023-10-19 13:55:26 +00:00
|
|
|
services.dbus.packages = [
|
|
|
|
cfg.package
|
2022-06-16 17:23:12 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
users.users.openvpn = {
|
|
|
|
isSystemUser = true;
|
|
|
|
uid = config.ids.uids.openvpn;
|
|
|
|
group = "openvpn";
|
|
|
|
};
|
|
|
|
|
|
|
|
users.groups.openvpn = {
|
|
|
|
gid = config.ids.gids.openvpn;
|
|
|
|
};
|
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
environment.systemPackages = [
|
|
|
|
cfg.package
|
2022-06-16 17:23:12 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|