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 nxv:
- Nix
- Docker
nix \
--extra-experimental-features 'nix-command flakes' \
develop 'https://nixomatic.com/[email protected]' \
--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/[email protected]' \
--accept-flake-config
Mixed
Or mix and match both:
- Nix
- Docker
nix \
--extra-experimental-features 'nix-command flakes' \
develop 'https://nixomatic.com/?p=cowsay:ed142ab,python3:3b93cf5,[email protected]' \
--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,[email protected]' \
--accept-flake-config