From 5e8cc2796282a951dc81d49efd15903de0a7f157 Mon Sep 17 00:00:00 2001 From: Aaron Andersen Date: Mon, 2 Sep 2024 09:49:02 -0400 Subject: [PATCH] nixos/openvpn: add extraArgs option --- nixos/modules/services/networking/openvpn.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/networking/openvpn.nix b/nixos/modules/services/networking/openvpn.nix index fba6d5e48f92..d122390c88ca 100644 --- a/nixos/modules/services/networking/openvpn.nix +++ b/nixos/modules/services/networking/openvpn.nix @@ -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"; }; @@ -181,6 +181,15 @@ in ''; }; + extraArgs = mkOption { + default = null; + type = listOf str; + description = '' + Additional command line arguments to pass to this OpenVPN instance. + ''; + apply = lib.escapeShellArgs; + }; + authUserPass = mkOption { default = null; description = ''