Skip to content

Instantly share code, notes, and snippets.

@erikarvstedt
Last active February 16, 2023 15:27
Show Gist options
  • Save erikarvstedt/63786344ef1a9b852310d02581443eac to your computer and use it in GitHub Desktop.
Save erikarvstedt/63786344ef1a9b852310d02581443eac to your computer and use it in GitHub Desktop.
## Build a Nix derivation without binary cache substitution
# Use a separate, temporary Nix store, so we can debug derivations that are already
# available in the main store
store="--store /tmp/store"
sudo rm -rf /tmp/store
# Fetch all build deps from the binary cache
nix print-dev-env $store --substitute myflake#output >/dev/null
# Build just the drv, without substitution
nix build --no-link --print-out-paths -L $store --no-substitute myflake#output
# Cleanup
sudo rm -rf /tmp/store
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment