diff options
| author | Adam Washington <[email protected]> | 2021-11-04 13:24:58 +0000 |
|---|---|---|
| committer | Adam Washington <[email protected]> | 2021-11-04 13:24:58 +0000 |
| commit | 17fa1c0fd855b6a645050beaaca8b03f2e73105e (patch) | |
| tree | f1a24d7290973f508854ed0f25fb843aa45d3ce4 | |
| parent | Add Documentation (diff) | |
| download | pia.nix-17fa1c0fd855b6a645050beaaca8b03f2e73105e.tar.xz pia.nix-17fa1c0fd855b6a645050beaaca8b03f2e73105e.zip | |
Fix connection for vpns with underscores in the name
| -rw-r--r-- | flake.nix | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -28,15 +28,16 @@ sha256 = "ZA8RS6eIjMVQfBt+9hYyhaq8LByy5oJaO9Ed+x8KtW8="; stripRoot = false; }; - servers = map (builtins.replaceStrings [ ".ovpn" "_" ] [ "" "-" ]) + fixup = (builtins.replaceStrings [ ".ovpn" "_" ] [ "" "-" ]); + servers = (builtins.filter (name: !(isNull (builtins.match ".+ovpn$" name))) (builtins.attrNames (builtins.readDir resources))); make_server = (name: { - name = name; + name = fixup name; value = { autoStart = false; authUserPass = config.services.pia.authUserPass; - config = "config ${resources}/${name}.ovpn"; + config = "config ${resources}/${name}"; updateResolvConf = true; }; }); |