diff options
author | Leon Schuermann <leon.git@is.currently.online> | 2018-01-15 14:34:58 +0700 |
---|---|---|
committer | Leon Schuermann <leon.git@is.currently.online> | 2018-01-15 14:34:58 +0700 |
commit | e45a06ebd1d761ccd48b6279c7ebb4429b17a6aa (patch) | |
tree | e2c9c9e7ce97faea019c97c7b0b3b742f7aa3540 /nixos | |
parent | 940d1a99f9f6f83a75f1d7ceb9e7d7f0d69610ee (diff) |
openvpn: add option to store credentials
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/networking/openvpn.nix | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/nixos/modules/services/networking/openvpn.nix b/nixos/modules/services/networking/openvpn.nix index 3fbf5a9f0227a..8a059f609546b 100644 --- a/nixos/modules/services/networking/openvpn.nix +++ b/nixos/modules/services/networking/openvpn.nix @@ -50,6 +50,11 @@ let "up ${pkgs.writeScript "openvpn-${name}-up" upScript}"} ${optionalString (cfg.down != "" || cfg.updateResolvConf) "down ${pkgs.writeScript "openvpn-${name}-down" downScript}"} + ${optionalString (cfg.authUserPass != null) + "auth-user-pass ${pkgs.writeText "openvpn-credentials-${name}" '' + ${cfg.authUserPass.username} + ${cfg.authUserPass.password} + ''}"} ''; in { @@ -161,6 +166,27 @@ in ''; }; + authUserPass = mkOption { + default = null; + description = '' + This option can be used to store the username / password credentials + with the "auth-user-pass" authentication method. + ''; + type = types.nullOr (types.submodule { + + options = { + username = mkOption { + description = "The username to store inside the credentials file."; + type = types.string; + }; + + password = mkOption { + description = "The password to store inside the credentials file."; + type = types.string; + }; + }; + }); + }; }; }); |