Get buildable outputs of a flake, for projects that use nix-systems.
# Get all buildable flake outputs
OUTS=$(nix run github:nix-systems/flake-outputs github:srid/haskell-template)
for OUT in $OUTS
do
# Build them
nix build --no-link .#"$OUT"
# Push to cachix
nix build --no-link --print-out-paths .#"$OUT" | cachix push mycache
done
This is useful in CI1 to automate building of all outputs, regardless of IFD or use of multi-systems.
Footnotes
-
Jenkins, for example: https://github.com/juspay/jenkins-nix-ci/issues/12 ↩