mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-15 14:26:33 +01:00
43 lines
928 B
Nix
43 lines
928 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
cfg = config.programs.openvpn3;
|
|
in
|
|
{
|
|
options.programs.openvpn3 = {
|
|
enable = lib.mkEnableOption "the openvpn3 client";
|
|
package = lib.mkOption {
|
|
type = lib.types.package;
|
|
default = pkgs.openvpn3.override {
|
|
enableSystemdResolved = config.services.resolved.enable;
|
|
};
|
|
defaultText = lib.literalExpression ''pkgs.openvpn3.override {
|
|
enableSystemdResolved = config.services.resolved.enable;
|
|
}'';
|
|
description = ''
|
|
Which package to use for `openvpn3`.
|
|
'';
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
services.dbus.packages = [
|
|
cfg.package
|
|
];
|
|
|
|
users.users.openvpn = {
|
|
isSystemUser = true;
|
|
uid = config.ids.uids.openvpn;
|
|
group = "openvpn";
|
|
};
|
|
|
|
users.groups.openvpn = {
|
|
gid = config.ids.gids.openvpn;
|
|
};
|
|
|
|
environment.systemPackages = [
|
|
cfg.package
|
|
];
|
|
};
|
|
|
|
}
|