A NixOS flake providing the NordVPN client package and a NixOS module for easy system integration.
- 📦 NordVPN client package for NixOS
- 🔧 NixOS module for system-wide VPN configuration
- 🔒 Automatic firewall rule configuration
- 👥 User group management
- 🚀 Systemd service integration
- 🏗️ Support for x86_64-linux and aarch64-linux
Add this flake to your NixOS configuration:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nordvpn-flake.url = "github:connerohnesorge/nordvpn-flake";
};
outputs = { nixpkgs, nordvpn-flake, ... }: {
nixosConfigurations.yourhostname = nixpkgs.lib.nixosSystem {
modules = [
nordvpn-flake.nixosModules.default
./configuration.nix
];
};
};
}Enable and configure NordVPN in your NixOS configuration:
{
services.nordvpn = {
enable = true;
users = [ "youruser" ]; # Users to add to nordvpn group
};
}This will:
- Install the NordVPN client
- Configure systemd service for the NordVPN daemon
- Set up necessary firewall rules (TCP 443, UDP 1194)
- Add specified users to the
nordvpngroup - Configure
networking.firewall.checkReversePath = false
See dotfiles for a complete example configuration namely flake.nix and engineer.nix.
After rebuilding your system:
# Log in to your NordVPN account
nordvpn login
# Connect to a server
# nordvpn connect
nordvpn c
# Check connection status
nordvpn status
# Disconnect
nordvpn disconnectnix build .#nordvpnnix run .#nordvpn -- --helpThis flake includes a development shell with useful Nix tools:
nix developAvailable development commands:
nix build .#nordvpn- Build the packagenix flake check- Check flake validitynixfmt-rfc-style .- Format nix filesstatix check .- Check for common nix issuesdeadnix .- Find dead code in nix files
- NixOS with flakes enabled
- x86_64-linux or aarch64-linux system
MIT License - see LICENSE for details
Contributions are welcome! Please feel free to submit a Pull Request.
- This flake requires
allowUnfree = trueas NordVPN is proprietary software - The NordVPN daemon runs as a system service and requires root privileges
- Users must be in the
nordvpngroup to interact with the VPN client
