aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorAdam Washington <[email protected]>2021-09-10 15:35:32 +0000
committerAdam Washington <[email protected]>2021-09-10 15:35:32 +0000
commit45696d3f8e854a47faeedfa7492793f6bb5710b3 (patch)
tree03cbfce733f7cc0700184ec62e6f4f52c7c69fb5 /flake.nix
parentMake a real PIA module (diff)
downloadpia.nix-45696d3f8e854a47faeedfa7492793f6bb5710b3.tar.xz
pia.nix-45696d3f8e854a47faeedfa7492793f6bb5710b3.zip
Require explicit enable
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix10
1 files changed, 7 insertions, 3 deletions
diff --git a/flake.nix b/flake.nix
index b5a1a67..0470597 100644
--- a/flake.nix
+++ b/flake.nix
@@ -4,17 +4,21 @@
nixosModule = { config }: {
options = {
services.pia.authUserPass = {
- username = nixpkgs.lib.mkOption {
+ 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.bool;
+ type = nixpkgs.lib.types.string;
};
};
};
- config = {
+ config = nixpkgs.lib.mkIf config.services.pia.enable {
services.openvpn.servers = let
resources = nixpkgs.fetchzip {
name = "pia-vpn-config";