···1+---
2+layout: ../../layouts/PostLayout.astro
3+title: Nix package manager in fly.io Sprites
4+published: 2026-02-22
5+modified: 2026-02-22
6+---
7+8+Recently I stumbled upon [Fly.io](https://fly.io/)'s [Sprites](https://sprites.dev/).
9+10+[Tangled](https://tangled.org/) uses [`nix`](https://nixos.org/download) (the package manager)
11+and since I had my development setup for Tangled in a docker container(TODO: add footnote) it was a good excuse to play around with them.
12+13+## How to install
14+15+First, choose the multi-user installation:
16+17+`sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon`
18+19+> **Note**: The installer will complain, that you don't have `systemd` installed. This is expected—we will handle that next.
20+21+Next, add the `nix` daemon to the services of your Sprite:
22+23+`sprite-env services create nix-daemon --cmd sudo --args /nix/var/nix/profiles/default/bin/nix-daemon`
24+25+That's all. Yep.
26+27+## Errors I encountered
28+29+### `nix develop` hangs on `copying [something] to the store`
30+31+This was really annoying, because the Sprite would just crash after a few minutes stuck at this step.
32+33+The issue ended up being that the user is not trusted (in the `nix` context).
34+35+To fix it:
36+37+- Add `trusted-users = root sprite` to `/etc/nix/nix.conf`
38+- Restart the nix daemon (using `sprite-env`)
39+40+### `nix store info` hangs at `Store URL: daemon`
41+42+The issue here is most likely, that the daemon is not running as root.
43+44+You can verify this with `ls -la /nix/var/nix/daemon-socket/socket`. The owner should be `root` (not `sprite`).
45+46+To fix this, make sure you started the daemon with `sudo`.