Documentation
Common ways to use nix develop with Nix O'matic.
Single package
Ask for a single package by name:
- Nix
- Docker
nix \
--extra-experimental-features 'nix-command flakes' \
develop 'https://nixomatic.com/?p=cowsay' \
--accept-flake-config \
--command -- cowsay 'Hello, world!'
docker run -v nix-store:/nix --rm nixos/nix nix \
--extra-experimental-features 'nix-command flakes' \
--option build-users-group "" \
develop 'https://nixomatic.com/?p=cowsay' \
--accept-flake-config \
--command -- cowsay 'Hello, world!'
Pipe data into a tool inside the environment:
- Nix
- Docker
echo 'Hello, world!' | \
nix \
--extra-experimental-features 'nix-command flakes' \
develop 'https://nixomatic.com/?p=cowsay' \
--accept-flake-config \
--command -- cowsay
echo 'Hello, world!' | \
docker run -v nix-store:/nix --rm -i nixos/nix nix \
--extra-experimental-features 'nix-command flakes' \
--option build-users-group "" \
develop 'https://nixomatic.com/?p=cowsay' \
--accept-flake-config \
--command -- cowsay
Multiple packages
Request multiple packages with comma-separated values in an interactive shell:
- Nix
- Docker
nix \
--extra-experimental-features 'nix-command flakes' \
develop 'https://nixomatic.com/?p=rustc,cargo' \
--accept-flake-config
docker run -v nix-store:/nix --rm -it nixos/nix nix \
--extra-experimental-features 'nix-command flakes' \
--option build-users-group "" \
develop 'https://nixomatic.com/?p=rustc,cargo' \
--accept-flake-config
Versioning
Use : to pin a package to a specific nixpkgs revision:
- Nix
- Docker
nix \
--extra-experimental-features 'nix-command flakes' \
develop 'https://nixomatic.com/?p=python3:3b93cf5' \
--accept-flake-config
docker run -v nix-store:/nix --rm -it nixos/nix nix \
--extra-experimental-features 'nix-command flakes' \
--option build-users-group "" \
develop 'https://nixomatic.com/?p=python3:3b93cf5' \
--accept-flake-config
Pin to a specific package version with @. Versions are resolved with nixpkgs-multiverse, which indexes every version of every package nixpkgs ever shipped:
- Nix
- Docker
nix \
--extra-experimental-features 'nix-command flakes' \
develop 'https://nixomatic.com/?p=nodejs@20.11.1' \
--accept-flake-config
docker run -v nix-store:/nix --rm -it nixos/nix nix \
--extra-experimental-features 'nix-command flakes' \
--option build-users-group "" \
develop 'https://nixomatic.com/?p=nodejs@20.11.1' \
--accept-flake-config
If a version is not in the index, nix develop tells you which versions of that package do exist.
Listing available package versions
To find out before building, ask /versions. It answers from the same index revision the generated flake pins, so every version it lists is a version that flake accepts:
curl 'https://nixomatic.com/versions?p=nodejs'
{
"nodejs": ["0.10.21", "0.12.7", "…", "24.18.1"]
}
The answer is keyed by the spec you asked for, whether you asked about one package or ten, so you read every response the same way. Versions come oldest first. Ask for several packages the same way you would anywhere else — comma-separated, or by repeating p= — and each gets its own entry:
curl 'https://nixomatic.com/versions?p=nodejs,python3'
{
"nodejs": ["0.10.21", "0.12.7", "…", "24.18.1"],
"python3": ["3.3.2", "3.4.3", "…", "3.14.6"]
}
What a revision ships
Add : and a revision to ask what version that revision has, rather than every version there is. Each spec keeps its own entry, so several revisions of one package can be compared in a single request:
curl 'https://nixomatic.com/versions?p=python3:3b93cf5&p=python3:afb4584'
{
"python3:3b93cf5": "3.13.11",
"python3:afb4584": "3.14.6"
}
A revision ships one version of a package, so its entry is that version itself rather than a list of one, and null when that revision has no such package. This is evaluated from nixpkgs at that revision rather than looked up in an index, so the first request for a revision takes seconds.
What is not accepted
<package>@<version> is refused: a version is what this endpoint returns, not something to ask with. Ask for the package and look through the answer instead. Overrides are refused for the same kind of reason — they do not change what versions exist.
A package the index does not cover comes back with no versions rather than an error — an empty list, or null when asked at a revision — so an empty answer means either a misspelled package or one that was never indexed.
Mixed
Or mix and match both:
- Nix
- Docker
nix \
--extra-experimental-features 'nix-command flakes' \
develop 'https://nixomatic.com/?p=cowsay:ed142ab,python3:3b93cf5,nodejs@20.11.1' \
--accept-flake-config
docker run -v nix-store:/nix --rm -it nixos/nix nix \
--extra-experimental-features 'nix-command flakes' \
--option build-users-group "" \
develop 'https://nixomatic.com/?p=cowsay:ed142ab,python3:3b93cf5,nodejs@20.11.1' \
--accept-flake-config