No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-27 21:39:47 +01:00
.gitignore feat(flake): helper commands 2024-10-13 08:48:54 +00:00
cli.nix fix(cli): strengthen superuser escalation check 2024-11-05 12:28:12 +00:00
flake.lock feat(flake.nix): multi-system nixos module 2024-10-02 13:38:02 +00:00
flake.nix Update yae.json 2026-10-27 21:39:47 +01:00
LICENSE Add AGPL V3 2023-06-20 12:22:55 +00:00
README.md docs(readme): add secrets file format information 2024-11-05 11:38:16 +00:00
yae.json Update yae.json 2026-10-27 21:39:47 +01:00

🔒 pia.nix

Private Internet Access VPN Configurations & CLI for NixOS

Flake-based Installation

Add the pia.nix NixOS module to your system flake and configuration.

{
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
  inputs.pia.url = "github:Fuwn/pia.nix";
  inputs.pia.inputs.nixpkgs.follows = "nixpkgs";

  outputs = { nixpkgs, pia, self }: {
    nixosConfigurations.yourConfiguration = nixpkgs.lib.nixosSystem {
      modules = [ pia.nixosModules."x86_64-linux".default ];
    };
  };
}

Module Set-up

Configure pia.nix in your NixOS configuration through the services.pia attribute set.

{ config, ... }: {
  services.pia.enable = true;

  # Hardcoded username and password
  services.pia.authUserPass.username = "hooty";
  services.pia.authUserPass.password = "hunter42";

  # Alternatively, you can use the `authUserPassFile` attribute if you are using
  # a Nix secrets manager. Here's an example using sops-nix.
  #
  # The secret you provide to `authUserPassFile` should be a multiline string with
  # a single username on the first line a single password on the second line.
  services.pia.authUserPassFile = config.sops.secrets.pia.path;
}

Usage

# List all available VPN regions
pia list

# List all available VPN regions with fuzzy search support
pia search

# Activate VPN in a specific region
pia start japan

# Uses `pia search` to activate VPN in a specific region
pia start

# Deactivate VPN in a specific region
pia stop japan

# Uses `pia search` to deactivate VPN in a specific region
pia stop

Credits

This repository started off as a fork of ~rprospero/nixos-pia, which provided a starting point for populating OpenVPN with Private Internet Access' VPN configurations.