Skip to content

Commit

Permalink
nixos/openvpn: add extraArgs option
Browse files Browse the repository at this point in the history
  • Loading branch information
aanderse committed Sep 2, 2024
1 parent 77289d3 commit 5e8cc27
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion nixos/modules/services/networking/openvpn.nix
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ let

path = [ pkgs.iptables pkgs.iproute2 pkgs.nettools ];

serviceConfig.ExecStart = "@${openvpn}/sbin/openvpn openvpn --suppress-timestamps --config ${configFile}";
serviceConfig.ExecStart = "@${openvpn}/sbin/openvpn openvpn --suppress-timestamps --config ${configFile} ${cfg.extraArgs}";
serviceConfig.Restart = "always";
serviceConfig.Type = "notify";
};
Expand Down Expand Up @@ -181,6 +181,15 @@ in
'';
};

extraArgs = mkOption {
default = null;

This comment has been minimized.

Copy link
@growler

growler Sep 11, 2024

Contributor

I guess either the default should be [ ], and the service configuration should be rendered as

serviceConfig.ExecStart = "... ${lib.escapeShellArgs cfg.extraArgs}";

This comment has been minimized.

Copy link
@aanderse

aanderse Sep 11, 2024

Author Member

oof

seems like somehow i missed an optionalString in there... thanks for catching this

PR incoming

type = listOf str;
description = ''
Additional command line arguments to pass to this OpenVPN instance.
'';
apply = lib.escapeShellArgs;
};

authUserPass = mkOption {
default = null;
description = ''
Expand Down

0 comments on commit 5e8cc27

Please sign in to comment.