nix: add NixOS module and tests (#2857)

This commit is contained in:
Kristoffer Dalby
2025-11-12 07:11:38 -06:00
committed by GitHub
parent 000d5c3b0c
commit d14be8d43b
8 changed files with 1085 additions and 28 deletions

41
nix/README.md Normal file
View File

@@ -0,0 +1,41 @@
# Headscale NixOS Module
This directory contains the NixOS module for Headscale.
## Rationale
The module is maintained in this repository to keep the code and module
synchronized at the same commit. This allows faster iteration and ensures the
module stays compatible with the latest Headscale changes. All changes should
aim to be upstreamed to nixpkgs.
## Files
- **[`module.nix`](./module.nix)** - The NixOS module implementation
- **[`example-configuration.nix`](./example-configuration.nix)** - Example
configuration demonstrating all major features
- **[`tests/`](./tests/)** - NixOS integration tests
## Usage
Add to your flake inputs:
```nix
inputs.headscale.url = "github:juanfont/headscale";
```
Then import the module:
```nix
imports = [ inputs.headscale.nixosModules.default ];
```
See [`example-configuration.nix`](./example-configuration.nix) for configuration
options.
## Upstream
- [nixpkgs module](https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/networking/headscale.nix)
- [nixpkgs package](https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/he/headscale/package.nix)
The module in this repository may be newer than the nixpkgs version.