system-manager icon indicating copy to clipboard operation
system-manager copied to clipboard

Use an overlay for /etc instead of the current stateful approach

Open r-vdp opened this issue 10 months ago • 1 comments

We could maybe use the same mechanism as what we have in nixos for mounting having /etc be an overlayfs with an immutable erofs image generated by system-manager as the lower layer, and the embedding OS' /etc folder as the upper, writable directory.

An entrypoint for the nixos implementation is https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/system/etc/etc.nix

This idea is completely untested, so it may turn out not to work, but it's worth trying out.

The main advantage, is that we won't need to keep as much data (maybe none at all) in the state files, and that the whole process will be completely atomic and more performant.

r-vdp avatar Mar 06 '25 16:03 r-vdp

Good idea.

One thing to validate is how well erofs is supported on other distros since it was added quite recently. squashfs might be a good fallback otherwise.

zimbatm avatar Mar 06 '25 18:03 zimbatm