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

bug: cannot apply without --impure #202

Open
nrdxp opened this issue Apr 1, 2024 · 5 comments
Open

bug: cannot apply without --impure #202

nrdxp opened this issue Apr 1, 2024 · 5 comments

Comments

@nrdxp
Copy link
Contributor

nrdxp commented Apr 1, 2024

As of a recent update of nixos-unstable (maybe 2-3 weeks ago), I haven't been able to run colmena apply without adding the --impure argument due to colmena wanting to make some lockfile changes to it's "Internal Colmena Expressions" flake that get's placed in the /tmp directory.

I am a bit surprised nobody else reported this, so perhaps there is something about my particular flake (which is quite complex at this point) that could be causing this, but in any case, since it seems to be an internal colmena function to create this temporary flake, I figured it was worth reporting.

It may be as simply as running a nix flake lock on this temporary flake before doing anything else, but I don't understand enough what colmena is doing (yet) to say for sure.

@xddxdd
Copy link

xddxdd commented Apr 4, 2024

I also saw a similar issue. This happens if I made some changes to my config without committing everything. The exact error message is cannot update unlocked flake input 'hive' in pure mode.

I patched colmena to disable its use of pure mode: https://github.com/xddxdd/nixos-config/blob/11358a9fddadb544e85a2ecba1aaa987023e98ed/patches/colmena-disable-pure-eval.patch

But I'm not sure if this is the correct approach.

@nrdxp
Copy link
Contributor Author

nrdxp commented Apr 4, 2024

Ah yeah, I usually have a least a few uncommitted changes laying around so I didn't even think about that, but you are right, if I stash everything the error goes away. This seems to be a different definition of "pure" than Nix itself, which is perfectly happy to build an unclean tree in "pure" eval mode itself, and until recently it seems, so was Colmena

@msanft
Copy link

msanft commented Apr 5, 2024

Running into the same issue since the last update of my flake.

@nrdxp
Copy link
Contributor Author

nrdxp commented Apr 5, 2024

I would have imagined that this line would take care of locking the flake:
https://github.com/zhaofengli/colmena/blob/main/src/nix/hive/assets.rs#L55

So something more complex must be going on 🤔

@Silver-Golden
Copy link

Also impacting us, was a pita to track down this issue as well

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