Skip to content

Add a Nix flake so Atomic builds on NixOS - #2041

Closed
joepio wants to merge 3 commits into
developfrom
claude/nixos-build-w2jfdq
Closed

joepio wants to merge 3 commits into
developfrom
claude/nixos-build-w2jfdq

Conversation

@joepio

@joepio joepio commented Oct 3, 2026

Copy link
Copy Markdown
Member

Requested by Joep · project thread

Before: The repo had no Nix files. On NixOS the build tools that pnpm and wasm-pack download (wasm-bindgen, wasm-opt) can't run, and there was no way to build the server with Nix.

After: nix develop gives a shell with Rust 1.98.1 (with the wasm32 std), Node 22, pnpm 10, wasm-pack, wasm-bindgen 0.2.122 and wasm-opt. nix build / nix run builds the server in the Nix sandbox.

How: flake.nix uses nixpkgs only (nixos-unstable ships exactly the Rust version in rust-toolchain.toml; the dev shell warns if they drift). flake.lock pins the channel tarball. The package builds atomic-server with ATOMICSERVER_SKIP_JS_BUILD, so build.rs never calls pnpm.

Limits, also written in CONTRIBUTING.md:

  • The data browser can't be built in the sandbox yet (it needs network, and the devonian git dependency). The package embeds a placeholder page; pass a real bundle with .override { dataBrowser = ./path/to/dist; }. A pure frontend derivation needs a pnpm.fetchDeps hash, which has to be generated on a machine with GitHub access.
  • The server-side plugin runtime is left out, because nixpkgs has no wasm32-wasip2 std.

Tested on x86_64 Linux (not NixOS itself): nix build .#atomic-server succeeds (23 min cold), the binary starts and serves on / with HTTP 200, and in nix develop the tool versions are right and cargo check -p atomic-wasm --target wasm32-unknown-unknown passes. The full pnpm install and build:wasm were not run, because devonian is blocked here.


Generated by Claude Code

joepio added 3 commits October 3, 2026 19:17
nix develop provides the pinned Rust, Node, pnpm, wasm-pack, wasm-bindgen and
wasm-opt, which cannot be downloaded and run on NixOS. nix build builds the
server in the sandbox with a placeholder data browser (overridable); the
server-side plugin runtime is left out as nixpkgs has no wasm32-wasip2 std.
@joepio joepio self-assigned this Oct 3, 2026
joepio added a commit that referenced this pull request Oct 5, 2026
… chat, search, CI) (#2060)

Combines #1530, #1638, #1663, #1835, #1869, #1896, #1898, #1911, #1912, #1913, #1914, #1918, #1919, #1929, #1931, #1949, #1958, #1959, #1961, #1963, #1968, #1975, #1981, #1985, #1988, #2038, #2041, #2047 and #2050, tested in one full Mancave run on the exact head (run 4999, green).

joepio commented Oct 5, 2026

Copy link
Copy Markdown
Member Author

Landed on develop in the combined batch #2060 (95707c0), tested together in one full run. Closing as included.


Generated by Claude Code

@joepio joepio closed this Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant