Conversation
Add a new `nix check` command that verifies installables can be built or substituted without creating result symlinks or downloading outputs. Key features: - Searches checks.<system>, then packages.<system>, then legacyPackages.<system> - Uses queryMissing() to determine substitutability without downloads - Checks derivations by building only what cannot be substituted - Requires explicit installable arguments with attribute paths - Supports --dry-run to show what would be built or fetched The command is useful for CI systems and development workflows where you want to verify buildability without producing local outputs.
|
It's confusing that this doesn't check the same things as |
|
@edolstra but then it would be confusing that it looks up in I think we could unify
As for moving this forward, I think this is a good incremental step. I think it'd be good to integrate this with The only changes I would expect to follow from this integration is having more eval-level checks in |
| "checks." + settings.thisSystem.get() + ".", | ||
| "packages." + settings.thisSystem.get() + ".", | ||
| "legacyPackages." + settings.thisSystem.get() + "."}; |
There was a problem hiding this comment.
| "checks." + settings.thisSystem.get() + ".", | |
| "packages." + settings.thisSystem.get() + ".", | |
| "legacyPackages." + settings.thisSystem.get() + "."}; | |
| "checks." + settings.thisSystem.get() + "." | |
| }; |
Having all the packages in the completions is counterproductive, and I haven't wanted to check buildability of a package yet.
There was a problem hiding this comment.
Look it's looking good so far. However it still needs to check the build ability of the package as well as potentially adding completions. Because this would help a user in this case, knowing exactly what to use, but this is not needed and be done in another pr later.
Something you want to look into is moving the nix flake check command to an alias with a warning of deprecation before deprecating.
This pr also needs a rebase to utilize new nix cpp code. EDIT: I have rebased this pr at https://github.com/DigitalBrewStudios/nix/tree/issue-13805 so all you need to do is a reset hard on the changes.
|
Something to consider here as well, to support on a non flake system, because I am not too sure how it would work logically, if it's a separate file like checks.nix or something to do with default.nix. |
Motivation
I can't do it anymore.
Yesterday I've made this mistake more than once:
nix run .#checks.x86_64-linux.somethingIt's horrible to type, and to add insult to injury, it fails because of my own stupidity.
I need to rewire my brain to type something sensible and nice.
nix check .#somethingI'm dogfooding this. Pretty great so far.
Context
nix checksubcommand #13805nix flake checkinsteadAdd 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.