mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-11-13 12:13:46 +01:00
refactor(youko): create the /data-ro mountpoints in initrd tmpfiles
Root is tmpfs, so the backing dirs must exist before the /data bind mounts. initrd tmpfiles rules on /sysroot do that before switch-root, replacing the activation script. Assisted-by: Claude Code (claude-opus-5-5)
This commit is contained in:
1 parent
6fa6e6626e
commit
64c465660c
1 file changed
+7
-7
@@ -23,13 +23,13 @@ in
|
||||
];
|
||||
};
|
||||
|
||||
# Pre-create the backing directory and subvolume mountpoints on the root
|
||||
# filesystem. activation runs before sysinit.target (before all mount
|
||||
# units), and writes to /data-ro (not the ro-mounted /data), so this is
|
||||
# safe to re-run on nixos-rebuild switch.
|
||||
system.activationScripts.data-ro-backing.text = ''
|
||||
mkdir -p /data-ro/fileshare /data-ro/apps /data-ro/backups /data-ro/apps-snapshots
|
||||
'';
|
||||
# Root is tmpfs: create the backing dir and subvolume mountpoints before switch-root.
|
||||
boot.initrd.systemd.tmpfiles.settings.data-ro = {
|
||||
"/sysroot/data-ro/apps".d = { };
|
||||
"/sysroot/data-ro/apps-snapshots".d = { };
|
||||
"/sysroot/data-ro/backups".d = { };
|
||||
"/sysroot/data-ro/fileshare".d = { };
|
||||
};
|
||||
|
||||
fileSystems."/data/fileshare/public".depends = [ "/data/fileshare" ];
|
||||
|
||||
|
||||
Reference in new issue
Block a user