sops-nix icon indicating copy to clipboard operation
sops-nix copied to clipboard

Sops runs before mount home

Open bobberb opened this issue 10 months ago • 3 comments

I am on a BTRFS system and I watch every boot as sops fails to deploy because the home as not been mounted. Is there an option to get around this?

bobberb avatar Feb 05 '25 15:02 bobberb

You may need neededForBoot = true; on the home mount so that it runs before the action phase. Other using userborn might help, because than sops becomes a systemd service where one can add a mount unit as a requirement.

Mic92 avatar Feb 06 '25 02:02 Mic92

I just ran into this issue as well. One of my NixOS systems uses btrfs. Thanks for the tip about neededForBoot - that solved it for me. I added the following to my configuration:

fileSystems."/home".neededForBoot = true;

But it would be great if this workaround would be on the sops-nix README for other users who run into this issue.

anders130 avatar Jul 31 '25 16:07 anders130

I just ran into this issue as well. One of my NixOS systems uses btrfs. Thanks for the tip about neededForBoot - that solved it for me. I added the following to my configuration:

fileSystems."/home".neededForBoot = true;

But it would be great if this workaround would be on the sops-nix README for other users who run into this issue.

I added your line and did a rebuild. This was my output:

Failed to install generation 150: Failed to install the initrd.: Failed to copy from "/nix/store/r5q4z92fpgnc01p16q7x6yzxpzn283ma-initrd-linux-6.12.40/initrd" to the temporary file "/boot/EFI/nixos/initrd-6.12.40-cwkvomg4tyniqywp3mntmibhh7cg3gpt6l2xo4hlqqj5xcxqjiga..tmp": No space left on device (os error 28)
Failed to install bootloader

Can I collect the garbage from the boot directory?

Edit: I use lanzaboote and fixed the error by manually deleting old kernels: see here

theRoboxx avatar Aug 04 '25 21:08 theRoboxx