Skip to main content

Documentation

Common ways to use nix develop with Nix O'matic.

Single package

Ask for a single package by name:

nix \
--extra-experimental-features 'nix-command flakes' \
develop 'https://nixomatic.com/?p=cowsay' \
--accept-flake-config \
--command -- cowsay 'Hello, world!'

Pipe data into a tool inside the environment:

echo 'Hello, world!' | \
nix \
--extra-experimental-features 'nix-command flakes' \
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 \
--extra-experimental-features 'nix-command flakes' \
develop 'https://nixomatic.com/?p=rustc,cargo' \
--accept-flake-config

Versioning

Use : to pin a package to a specific nixpkgs revision:

nix \
--extra-experimental-features 'nix-command flakes' \
develop 'https://nixomatic.com/?p=python3:3b93cf5' \
--accept-flake-config

Pin to a specific package version with @. Versions are resolved with nxv:

nix \
--extra-experimental-features 'nix-command flakes' \
develop 'https://nixomatic.com/[email protected]' \
--accept-flake-config

Mixed

Or mix and match both:

nix \
--extra-experimental-features 'nix-command flakes' \
develop 'https://nixomatic.com/?p=cowsay:ed142ab,python3:3b93cf5,[email protected]' \
--accept-flake-config