From 8e52b4a38106510d978a6ec507fd14489dc08559 Mon Sep 17 00:00:00 2001 From: Adam Washington Date: Fri, 10 Sep 2021 16:11:41 +0000 Subject: Full functioning vpn module --- flake.nix | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/flake.nix b/flake.nix index 5439548..7e8788a 100644 --- a/flake.nix +++ b/flake.nix @@ -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="; -- cgit v1.2.3