···4646just lint
4747```
48484949+Nix users can enter a devshell with `nix develop`, or `direnv allow` to auto-enter via the bundled `.envrc`. Pre-built artifacts (including the devshell) are available from our [binary cache](docs/install-nix.md#binary-cache).
5050+4951## Production Deployment
50525153### Quick Deploy (Docker/Podman Compose)
···59616062### Installation Guides
61636464+- [Nix](docs/install-nix.md)
6265- [Debian](docs/install-debian.md)
6366- [Containers](docs/install-containers.md)
6467- [Kubernetes](docs/install-kubernetes.md)
···99102## License
100103101104AGPL-3.0-or-later. Documentation is CC BY-SA 4.0. See [LICENSE](LICENSE) for details.
102102-
+70
docs/install-nix.md
···11+# Tranquil PDS production installation on NixOS
22+33+This guide covers installing Tranquil PDS on NixOS via the flake and the bundled NixOS module.
44+55+## Prerequisites
66+77+- A server :p
88+- Disk space enough for blobs (depends on usage; plan for ~1GB per active user as a baseline)
99+- A domain name pointing to your server's IP
1010+- A wildcard TLS certificate for `*.pds.example.com` (user handles are served as subdomains)
1111+- Flakes enabled (`experimental-features = nix-command flakes` in `nix.conf`)
1212+1313+## Add the flake as an input
1414+1515+In your system flake:
1616+1717+```nix
1818+{
1919+ inputs.tranquil.url = "git+https://tangled.org/tranquil.farm/tranquil-pds";
2020+2121+ outputs = { self, nixpkgs, tranquil, ... }: {
2222+ nixosConfigurations.pds = nixpkgs.lib.nixosSystem {
2323+ system = "x86_64-linux";
2424+ modules = [
2525+ tranquil.nixosModules.default
2626+ ./configuration.nix
2727+ ];
2828+ };
2929+ };
3030+}
3131+```
3232+3333+## Enable the service
3434+3535+In `configuration.nix`:
3636+3737+```nix
3838+{
3939+ services.tranquil-pds = {
4040+ enable = true;
4141+ database.createLocally = true;
4242+ settings = {
4343+ server.hostname = "pds.example.com";
4444+ # see example.toml for all options
4545+ };
4646+ };
4747+}
4848+```
4949+5050+This will set up the local postgres database for you automatically. If you prefer to manage postgres yourself, leave `database.createLocally` at its default (`false`) and set `settings.database.url` manually.
5151+5252+See [example.toml](../example.toml) for the full set of configuration options.
5353+5454+## Binary cache
5555+5656+Pre-built artifacts from the flake — the package, frontend, and devshell — are published to [tranquil.cachix.org](https://tranquil.cachix.org). To pull from it instead of building locally, add to your NixOS config:
5757+5858+```nix
5959+nix.settings = {
6060+ substituters = [ "https://tranquil.cachix.org" ];
6161+ trusted-public-keys = [ "tranquil.cachix.org-1:PoO+mGL6a6LcJiPakMDHN4E218/ei/7v2sxeDtNkSRg=" ];
6262+};
6363+```
6464+6565+> [!NOTE]
6666+> Due to a current spindle limitation, the aarch64 package is cross-compiled on an x86_64 builder and published under a separate attribute. If you're running on aarch64, set the package manually:
6767+>
6868+> ```nix
6969+> services.tranquil-pds.package = inputs.tranquil.packages.x86_64-linux.tranquil-pds-aarch64;
7070+> ```