depot/third_party/nixpkgs/nixos/modules/programs/openvpn3.nix
Default email 5c370c0b2a Project import generated by Copybara.
GitOrigin-RevId: 33d1e753c82ffc557b4a585c77de43d4c922ebb5
2024-05-15 17:35:15 +02:00

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
];
};
}