-
Notifications
You must be signed in to change notification settings - Fork 90
Add direct flake evaluation support #228
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
Conversation
|
Unstable got updated last week with nix 2.24 wich means this branch is now pretty much required to use flakes. I've been using it myself and haven't found issues. |
Me too. |
588e36d to
e651b72
Compare
Too rigid :/ Let's just let rustfmt handle it.
This reverts commit 141fe82.
e651b72 to
33c41ab
Compare
| applyFlags = "--evaluator ${evaluator} ${extraApplyFlags}" | ||
| + lib.optionalString (!pure) "--impure"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will break when extraApplyFlags is used, and !pure since the concatenation doesn't include a space.
Using a list seems worth it!
Just noticed that when updating my nixpkgs and trying to fix :)
This PR adds support for evaluating flakes directly using
nix evalto make pure evaluation work with Nix 2.21+. Fixes #202.Been procrastinating on this for a long time, but with NixOS 24.11 releasing soon carrying Nix 2.24 as the default, it's finally time to do it.
This is based on the existing experimental support for the
colmenaHiveoutput. Instead of using theeval.nixbundled with the Colmena executable against the "raw"colmenaoutput, thecolmenaHiveoutput contains the "prepared" hive.Usage
Your flake needs to depend on Colmena as an input and expose a new
colmenaHiveoutput containing the result ofcolmena.lib.makeHive:{ inputs = { + # ADDED: Colmena input + colmena.url = "github:zhaofengli/colmena"; # ... Rest of configuration ... }; outputs = { self, colmena, ... }: { + # ADDED: New colmenaHive output + colmenaHive = colmena.lib.makeHive self.outputs.colmena; # Your existing colmena output colmena = { # ... Rest of configuration ... }; }; }Then, add
--experimental-flake-evaltocolmenainvocations.Current Limitations
The following isn't supported with
--experimental-flake-eval:colmena eval --instantiate--evaluator streaming