Skip to content

Commit

Permalink
nixos/openvpn3: add /etc/openvpn3/configs to systemd.tmpfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
JarvisCraft committed Nov 5, 2024
1 parent 7ffd9ae commit c0f4180
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions nixos/modules/programs/openvpn3.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ let
json = pkgs.formats.json { };
cfg = config.programs.openvpn3;

inherit (lib) mkEnableOption mkPackageOption mkOption literalExpression max options lists;
inherit (lib)
mkEnableOption mkPackageOption mkOption literalExpression max options lists;
inherit (lib.types) bool submodule ints;
in {
options.programs.openvpn3 = {
Expand All @@ -16,7 +17,8 @@ in {
type = submodule {
options = {
settings = mkOption {
description = "Options stored in {file}`/etc/openvpn3/netcfg.json` configuration file";
description =
"Options stored in {file}`/etc/openvpn3/netcfg.json` configuration file";
default = { };
type = submodule {
freeformType = json.type;
Expand All @@ -25,7 +27,8 @@ in {
type = bool;
description = "Whether to use systemd-resolved integration";
default = config.services.resolved.enable;
defaultText = literalExpression "config.services.resolved.enable";
defaultText =
literalExpression "config.services.resolved.enable";
example = false;
};
};
Expand All @@ -40,7 +43,8 @@ in {
type = submodule {
options = {
settings = mkOption {
description = "Options stored in {file}`/etc/openvpn3/log-service.json` configuration file";
description =
"Options stored in {file}`/etc/openvpn3/log-service.json` configuration file";
default = { };
type = submodule {
freeformType = json.type;
Expand Down Expand Up @@ -101,7 +105,12 @@ in {
};
};

systemd.packages = [ cfg.package ];
systemd = {
packages = [ cfg.package ];
tmpfiles.rules = [
"d /etc/openvpn3/configs 0755 openvpn openvpn - -"
];
};
};

meta.maintainers = with lib.maintainers; [ shamilton progrm_jarvis ];
Expand Down

0 comments on commit c0f4180

Please sign in to comment.