Change:
NUMA? y # Disable some expensive (?) features. <del> FTRACE n </del> KPROBES n PM_TRACE_RTC n

Discussion:
Can not install an simple expression with . I always get the error Steps to reproduce the behavior: Create two files: Dockerfile And run The simple script is installed in the env :)
The full error for me: and that file says: I note that REPEAT shows up only once: ` And if I replace in that file it fixes the problem and nix-env --install works again.
Got similar problem after executing . The quick hack proposed by above worked for me too.
Might be related to this piece of code That is the only thing I found with "<REPEAT" keywords in it.
on obviously all files under are read-only, so how to change the offending ? (mind you, this occurred after trying to install from a local clone of , and nowhere in the source tree does this word occur).
Don't use nix-env
I was able to get around this by adding with just in it and doing: or Also worth noting that after I did this and upgraded my user profile and system, I no longer have in my manifest, and nix-env is back to working like normal. I'm not 100% sure what fixed it.
Dunno...I just used ` and ignored the warning that the file was read-only. root can do what he wants. ;)
I take it you're not on , there the nix-store itself is read-only (also for root), but the solution of works like a charm and is probably a more "idiomatic" workaround.
That’s right, I’m on MacOS.
As a minimal fix for this, I ran the following and after that was operational:
Let's reopen this until the fix hits nixpkgs master at least.
Wow, many thanks for your help really great community help here totally awesome I will add this to my docker-build-stuff and will test it.
what should I use instead?
Correct me if I'm wrong, but my understanding of is that it fixes generating the , but if I already have an (linked from ) with s in it, there's no way to recover the data that got hidden with s? So anyone who used in the few weeks in which it was broken, now has to use , with no other workaround? EDIT2: disregard above, that was quite far off from the right understanding, see
The fix is neither released nor in nixpkgs AFAICT.

The "fix" doesn't unbreak , it just avoids generating it (and you need the workaround mentioned above, or to roll back your user profile to a version without , to get rid of in the first place). But AFAICT it did get into nixpkgs: The comes from - it would've been before. EDIT: comment hidden because it was very confused, see
The already prior to this patch which is not part of any Nix release nor applied as a patch in nixpkgs.
Alright, I was quite wrong, but also after spending a few hours being confused it makes sense now. <details<summary(click to open some ramblings)</summarySo I decided to check the most direct way I can thing of: After every system upgrade, I run (or at least used to, before switching to the other day), and that succeeded. Presumably that left me with the broken with s in it. But why is everything I did since not causing the bug again? Best guess right now is the s aren't deduplicated in memory, so you can only trigger this with multiple installs/upgrades? </detailsIn short, I didn't notice the original repro had two installed packages and apparently the only multi-package operation I ever did was the bulk upgrade (after the system-level ). After the move to it's a bit annoying to mess with but I was able to use to demonstrate the problem still being in my :
I use nix on macOS. I have in . For a month or so now, I get this error whenever running after : I know from the above that I can work around it with , which does work, but it's not clear from the above comments what I'm supposed to do to fix it permanently?
Upgrading in a root shell fixed it for me. I also use the unstable channel and am on Fedora 35 however. I reinstalled Nix and rebooted twice just to fix this issue. I was pretty sure I had messed up something, and obviously I had the freshest packages on my user profile, so I don't understand what I did right to fix it.
what version of nix are you running? I had the same issue and was able to fix it by running a stable version of nix-env once: Install stable version of nix: Install a single derivation with the stable version of nixpkgs.

After that, the old version works as well. Afterwards, you can even to remove the stable version and it still works. I'm not sure why.
The bug is only triggered when installing/upgrading multiple packages, which share some attributes (the sharing comes from evaluating once in the same execution, there's no deduplication with what's already in the profile manifest). (that was the source of my confusion in as well) So you only need the workaround once (to "repair" the profile manifest), then either: to a version of Nix without the bug 't install/upgrade multiple packages at once if you must, you can use the workaround again afterwards