Skip to content

Flake Generator

We provide endpoints that can generate a fully working flake with the package specs you provide.

These endpoints are located at the flake.nix and flake.zip paths:

Terminal window
# Generate a flake.nix containing latest ruby and nodejs.
curl https://nix-versions.oeiuwq.com/flake.nix/ruby@latest/nodejs@latest -o flake.nix
# An archive containing flake.nix. This is useful as input for your own flakes.
curl https://nix-versions.oeiuwq.com/flake.zip/ruby@latest/nodejs@latest -o flake.zip

Keeping up to date with versioned packages

Section titled “Keeping up to date with versioned packages”

One advantage of using pinned-versions flakes as inputs for your own flakes is that if you have:

{
inputs.tools.url = "https://nix-versions.oeiuwq.com/flake.zip/go@~1.24/*.pip@25";
}

then, every time you do nix flake update tools you are certain that if new versions of go or pip are available matching their respective constraint, you will get the new versions. But if an incompatible version is available you won’t get that update, preventing potential problems in your dev environment.

This ensures your packages are still updated but compatible with the version constraint you identify as stable releases.

You can inspect the content of generated flake.zip with the following command:

Terminal window
nix flake show https://nix-versions.oeiuwq.com/flake.zip/go@1.24.x/ruby@~3.4 --no-write-lock-file

Requesting for go@1.24.x and ruby@~3.4 will generate a flake with the following structure:

{
overlays.default # An overlay containing `{ ruby = ...; go = ...; }` at their respective versions.
packages.${system} = {
go = ...; # Go package at specified version
ruby = ...; # Ruby package at specified version
default = ...; # An environment (`buildEnv`) containing the paths of specified tools.
};
devShells.${system} = {
default = ...; # A numtide/devshell with the specified tools.
};
}

The flake itself is generated by using ntv and uses its flakeModules to create flake outputs.

You can create quick one-shot environments by using the following command:

nix develop https://nix-versions.oeiuwq.com/flake.zip/go@1.24.x/ruby@~3.4 --no-write-lock-file

If you need to pin some tools to specific versions on your own flakes, just use our flake.zip endpoint.

{
inputs.tools.url = "https://nix-versions.oeiuwq.com/flake.zip/go@~1.24";
outputs = inputs: {
# Go 1.24 is available at:
# inputs.tools.packages.${system}.go
};
}

On your devenv.yaml file define an input:

inputs:
tools:
url: "https://nix-versions.oeiuwq.com/flake.zip/go@~1.24"
Contribute Community Sponsor