TryNix boots Linux in WebAssembly to run 310,000 Nix packages in-browser
Developer fzakaria's new tool eliminates local installation by fetching Nix store paths directly into a browser-based VM.
Developer fzakaria has released TryNix, a browser-based tool that allows users to execute any version of a Nix package directly within a web tab. The project transforms the browser into a functional Nix client, removing the need for local installation to test specific software environments.
Operating as a purely static web page, TryNix boots a Linux kernel using WebAssembly via qemu-wasm. The system can run over 310,083 package versions from the history of nixpkgs by fetching Nix store paths from public caches. To achieve this, the tool leverages 'access-control-allow-origin: *' (CORS) headers served by GitHub Pages, Cachix, and cache.nixos.org to pull binaries directly into the browser. The technical stack is completed by an in-memory Nix store and a Ghostty terminal emulator embedded in the page. To ensure fast startup times, the site resumes a pre-booted VM snapshot rather than performing a full boot from scratch.
The Path to Browser-Based Nix
TryNix is the result of a series of iterative projects by fzakaria aimed at expanding Nix's accessibility. It builds upon previous work including 'nixpkgs-multiverse,' which indexed all package versions, as well as 'grail' for version ranges and 'omniflake.' By combining these indexing capabilities with WebAssembly virtualization, fzakaria has solved the friction of environment setup, allowing users to jump into a specific software state instantly.
Implications for Software Distribution
This shift toward executable environments in the browser has significant implications for software documentation and peer review. Instead of static instructions, tutorials can now provide links to exact, pinned environments that users can interact with immediately. For developers, the tool streamlines the pull request process, enabling reviewers to test artifacts via a URL without performing local builds.
Furthermore, the tool addresses the perennial "works on my machine" conflict in bug reporting. By sharing a specific URL, developers can provide a precise reproduction environment that is guaranteed to be identical for the recipient. As fzakaria noted, "'Works on my machine' is a URL now for reproduction."
Technical Constraints and Outlook
Despite its flexibility, TryNix is bound by the architectural limits of its runtime. Because WebAssembly utilizes a 32-bit address space, the system faces a hard memory limit of 4GiB, with a current practical limit of approximately 1.5GiB for the closure.
Future utility will likely depend on how these memory constraints evolve and whether more public caches adopt the necessary CORS headers to support similar client-side fetching. For now, TryNix serves as a proof of concept for a future where software environments are as portable and shareable as a hyperlink.