I’d like to compile a staging-next
version of nixpkgs and record the commit ID it actually used. Regular
nix build ~/.config/home-manager --override-input nixpkgs github:NixOS/nixpkgs/staging-next
does print out the commit it used to the terminal, but this stopped working great for me after I started using GitHub - maralorn/nix-output-monitor: Pipe your nix-build output through the nix-output-monitor a.k.a nom to get additional information while building. (which prints a ton of text to the terminal, so the commit id usually leaves the terminal history). It doesn’t record the lock file (as expected).
I tried something like:
nix build ~/.config/home-manager --override-input nixpkgs github:NixOS/nixpkgs/staging-next --output-lock-file ~/.config/home-manager/flake-temp.lock
but that doesn’t write any lock file, it seems that the implicit --no-write-lockfile
overrides --output-lock-file
. is this a bug/missing feature?
Is there a good alternative to record the commit id being used or to find it out in retrospect?
`--override-input` does not affect `flake.lock` in `self.outPath` · Issue #6894 · NixOS/nix · GitHub seems related, but it suggests “no” as the answer.