Impermanence 25.05 not populating /usr

Hey everyone!

I’m using impermanence and I recently upgraded to NixOS version 25.05. However, I ran into a problem: my system wouldn’t boot because /usr wasn’t populated, which is usually managed by impermanence.

As a temporary workaround, I’ve set /usr to persist, but this isn’t a long-term solution. Does anyone have a proper fix for this issue?

Everything worked fine on 24.11.

Thanks in advance!

Definitely need more details. What errors are you getting? /usr doesn’t get populated with much (just /usr/bin/env normally; it should otherwise be empty). And it’s not impermanence that populates it, it’s just something NixOS does whenever a config is activated, which includes during boot.

2 Likes

Yeah my persistent /usr only has /usr/bin in it and not even /usr/bin/env:

sudo ls /usr/
bin

And this is empty altogether:

sudo ls /usr/bin

When I add it to my impermanence config like this:

  environment.persistence."/persistent" = {
    enable = true;
    hideMounts = true;
    directories = [
	...
	"/usr/"
	]

It works and without adding /usr/ it doesn’t. The error I’m getting on startup is the following:

104[!!!!!] Refusing to run in unsupported envi...ment where /usr/ is not populated.
systemd[1]: Freezing execution.

It sounds like something is going wrong during activation and the usrbinenv activation script isn’t working. There should be earlier messages about this. Is your rootfs not writable?

Thanks for your quick reply!

Unfortunately there is no error before that during bootup. My / It is a tmpfs that is mounted as rw. It is configured like this:

  fileSystems."/" =
    {
        fsType = "tmpfs";
        options = [ "defaults" "size=16G" "mode=755" ];
        neededForBoot = true;
    };

The only two other filesystems I have are /boot and /persistent which are both written to disk.

I didn’t change anything in my config and only upgraded from 24.11 to 25.05 so that is the most likely culprit.

Note that failures in the activation script may not cause the bootup process to stop and might just log the messages.

At this point I think I just need to see the rest of your config. I’m also trying to think of a good way to get into a shell to do things like checking dmesg. Like you could put init=/nix/var/nix/profiles/system/sw/bin/bash in the kernel params (replacing the init= that’s there by default) and then run activation manually and look through dmesg.

2 Likes

Found the issue. Thanks for your help! It was envfs. If I enable envfs I have problems booting and without everything works.

services.envfs.enable = true;

Can someone check if their system works with both envfs and impermanence enabled on 25.05?