aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Washington <[email protected]>2021-09-10 16:11:41 +0000
committerAdam Washington <[email protected]>2021-09-10 16:11:41 +0000
commit8e52b4a38106510d978a6ec507fd14489dc08559 (patch)
tree0543fd81a10e7c818baf459522b258e467aeb593
parentTry the nixosModules route (diff)
downloadpia.nix-8e52b4a38106510d978a6ec507fd14489dc08559.tar.xz
pia.nix-8e52b4a38106510d978a6ec507fd14489dc08559.zip
Full functioning vpn module
-rw-r--r--flake.nix22
1 files 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=";