diff options
| author | Adam Washington <[email protected]> | 2021-09-10 16:11:41 +0000 |
|---|---|---|
| committer | Adam Washington <[email protected]> | 2021-09-10 16:11:41 +0000 |
| commit | 8e52b4a38106510d978a6ec507fd14489dc08559 (patch) | |
| tree | 0543fd81a10e7c818baf459522b258e467aeb593 | |
| parent | Try the nixosModules route (diff) | |
| download | pia.nix-8e52b4a38106510d978a6ec507fd14489dc08559.tar.xz pia.nix-8e52b4a38106510d978a6ec507fd14489dc08559.zip | |
Full functioning vpn module
| -rw-r--r-- | flake.nix | 22 |
1 files changed, 12 insertions, 10 deletions
@@ -1,26 +1,28 @@ { inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.05"; }; outputs = { self, nixpkgs }: { - nixosModules.vpn = { config }: { + nixosModule = { lib, config, ... }: { options = { - services.pia.authUserPass = { + services.pia = { enable = nixpkgs.lib.mkOption { default = false; type = nixpkgs.lib.types.bool; }; - username = nixpkgs.lib.mkOption { - default = false; - type = nixpkgs.lib.types.string; - }; - password = nixpkgs.lib.mkOption { - default = false; - type = nixpkgs.lib.types.string; + authUserPass = { + username = nixpkgs.lib.mkOption { + default = false; + type = nixpkgs.lib.types.str; + }; + password = nixpkgs.lib.mkOption { + default = false; + type = nixpkgs.lib.types.str; + }; }; }; }; config = nixpkgs.lib.mkIf config.services.pia.enable { services.openvpn.servers = let - resources = nixpkgs.fetchzip { + resources = nixpkgs.legacyPackages.x86_64-linux.fetchzip { name = "pia-vpn-config"; url = "https://www.privateinternetaccess.com/openvpn/openvpn.zip"; sha256 = "ZA8RS6eIjMVQfBt+9hYyhaq8LByy5oJaO9Ed+x8KtW8="; |