NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.98k stars 13.98k forks source link

Allow setting `authUserPass.username` without the password (OpenVPN) or ask for both #351142

Closed j-a-m-l closed 2 hours ago

j-a-m-l commented 2 hours ago

Describe the bug

A clear and concise description of what the bug is.

  services.openvpn.servers = {
    myvpn = {
      config = "config myvpn.opvn";

      # This fails because the password is not included
      authUserPass = {
        username = "my-vpn-user";
      };
    };
  };

Steps To Reproduce

Steps to reproduce the behavior:

  1. Configure the VPN client to use password (auth-user-pass)
  2. Set only the username
  3. Start the service (systemctl start openvpn-myvpn.service)

Expected behavior

It should ask for the password, but instead it fails with

error: The option `services.openvpn.servers.myvpn.authUserPass.password' is used but not defined.
j-a-m-l commented 2 hours ago

Probably this is more like a feature request, so I'm going to close it.