━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
nixos containers for cost-effective and capable gpu compute. vast.ai is the first target, there will be many more.
a nix-based container runtime that makes distributed gpu compute actually work. reproducible environments, tailscale networking, CUDA 12.8. everything you need to turn random gpus into a coherent compute cluster.
vast.ai is just the beginning. any gpu, anywhere, real init system, same environment.
├── checks # flake checks run on this repo
├── config # avalible `nix2gpu` config options
├── dev # `flake-parts` config for development of this repo
├── examples # working `nix2gpu` examples
├── services # extra modular service definitions
└── modules # implementation of `nix2gpu`
clean separation of concerns. the flake stays minimal, modules do the work.
create a nix2gpu container:
perSystem.nix2gpu.sample = { };# build
nix build .#sample
# push to registry
nix run .#sample.copyToGIthub
# run locally (docker or podman)
nix run .#sample.copyToContainerRuntime
nix run .#sample.shellcuda 12.8withcudnn,nccl,cublas- the whole showtailscalefor seamless and secure networking across a heterogeneous fleetdevelopment tools-gcc,python,uv,patchelfmodern shell-tmux,starship,atuin,ripgrep,fzf, the usual suspectsnix- becausedocker/OCIis a reasonable deployment target but an unreasonable build system
push to ghcr.io, point vast.ai at it:
ghcr.io/weyl-ai/nix2gpu:20250914-142437
or run your own registry. we don't care.
# optional
ROOT_PASSWORD=...
SSH_PUBLIC_KEYS=...
TAILSCALE_AUTHKEY=...passwordless root by default. we're already inside the machine.
vast.ai uses debian library paths (/lib/x86_64-linux-gnu). their nvidia-container-runtime injects driver libraries at container start. we handle this gracefully:
- wait for library injection
- patch
nvidia-smiwith nix interpreter - regenerate ldconfig cache
- seamless thereafter
it just works. deterministically.
nix develop # enter shell
nix build # build image
nix run .#<app> # run appscloud vendors want you to think gpu compute is complicated. it's not. it's just linux with extra libraries.
this project is an existence proof that complexity is optional.
send patches. fix things. make it better.
the code is MIT. use it however you want.
built at fleek. some testing in production. works on our machines, will expect it will work on yours. if not, we'll fix it.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━