Our Personal Data Server from scratch!
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

docs: nixos and binary cache

authored by

teq and committed by
Tangled
3e7a1997 7ed9c8ce

+73 -1
+3 -1
README.md
··· 46 46 just lint 47 47 ``` 48 48 49 + 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). 50 + 49 51 ## Production Deployment 50 52 51 53 ### Quick Deploy (Docker/Podman Compose) ··· 59 61 60 62 ### Installation Guides 61 63 64 + - [Nix](docs/install-nix.md) 62 65 - [Debian](docs/install-debian.md) 63 66 - [Containers](docs/install-containers.md) 64 67 - [Kubernetes](docs/install-kubernetes.md) ··· 99 102 ## License 100 103 101 104 AGPL-3.0-or-later. Documentation is CC BY-SA 4.0. See [LICENSE](LICENSE) for details. 102 -
+70
docs/install-nix.md
··· 1 + # Tranquil PDS production installation on NixOS 2 + 3 + This guide covers installing Tranquil PDS on NixOS via the flake and the bundled NixOS module. 4 + 5 + ## Prerequisites 6 + 7 + - A server :p 8 + - Disk space enough for blobs (depends on usage; plan for ~1GB per active user as a baseline) 9 + - A domain name pointing to your server's IP 10 + - A wildcard TLS certificate for `*.pds.example.com` (user handles are served as subdomains) 11 + - Flakes enabled (`experimental-features = nix-command flakes` in `nix.conf`) 12 + 13 + ## Add the flake as an input 14 + 15 + In your system flake: 16 + 17 + ```nix 18 + { 19 + inputs.tranquil.url = "git+https://tangled.org/tranquil.farm/tranquil-pds"; 20 + 21 + outputs = { self, nixpkgs, tranquil, ... }: { 22 + nixosConfigurations.pds = nixpkgs.lib.nixosSystem { 23 + system = "x86_64-linux"; 24 + modules = [ 25 + tranquil.nixosModules.default 26 + ./configuration.nix 27 + ]; 28 + }; 29 + }; 30 + } 31 + ``` 32 + 33 + ## Enable the service 34 + 35 + In `configuration.nix`: 36 + 37 + ```nix 38 + { 39 + services.tranquil-pds = { 40 + enable = true; 41 + database.createLocally = true; 42 + settings = { 43 + server.hostname = "pds.example.com"; 44 + # see example.toml for all options 45 + }; 46 + }; 47 + } 48 + ``` 49 + 50 + 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. 51 + 52 + See [example.toml](../example.toml) for the full set of configuration options. 53 + 54 + ## Binary cache 55 + 56 + 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: 57 + 58 + ```nix 59 + nix.settings = { 60 + substituters = [ "https://tranquil.cachix.org" ]; 61 + trusted-public-keys = [ "tranquil.cachix.org-1:PoO+mGL6a6LcJiPakMDHN4E218/ei/7v2sxeDtNkSRg=" ]; 62 + }; 63 + ``` 64 + 65 + > [!NOTE] 66 + > 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: 67 + > 68 + > ```nix 69 + > services.tranquil-pds.package = inputs.tranquil.packages.x86_64-linux.tranquil-pds-aarch64; 70 + > ```