Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

posts/writing-your-own-nix-flake-checks/ #61

Open
utterances-bot opened this issue Oct 1, 2023 · 4 comments
Open

posts/writing-your-own-nix-flake-checks/ #61

utterances-bot opened this issue Oct 1, 2023 · 4 comments

Comments

@utterances-bot
Copy link

Writing your own Nix Flake checks | Harsh Shandilya

Quick how-to for writing ad-hoc checks for your own Nix Flakes

https://msfjarvis.dev/posts/writing-your-own-nix-flake-checks/

Copy link

Smaug123 commented Oct 1, 2023

Thanks for this - I think you might be missing doCheck = true? My reading of https://nixos.org/manual/nixpkgs/stable/#ssec-check-phase is that the check phase is skipped unless you explicitly set doCheck.

@msfjarvis
Copy link
Owner

Thanks for this - I think you might be missing doCheck = true? My reading of https://nixos.org/manual/nixpkgs/stable/#ssec-check-phase is that the check phase is skipped unless you explicitly set doCheck.

To my knowledge if a derivation is passed to the checks output it's check phase is run unconditionally, otherwise yes you're correct about doCheck for regular derivations.

Copy link

I stumbled across this too, and from https://nixos.org/manual/nixpkgs/stable/#ssec-check-phase (and the behavior I observed), I'm pretty sure that doCheck is false by default:

doCheck
Controls whether the check phase is executed. By default it is skipped, but if doCheck is set to true, the check phase is usually executed.

Copy link
Owner

Finally had the opportunity to test this, I don't know what drove my misconception but the doCheck is definitely required, I've amended the code examples. Thanks for the corrections folks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants