feat: added activation and resume scripts to storage and impermanence

This commit is contained in:
Leyla Becker 2025-11-08 21:10:18 -06:00
parent 1310b50794
commit 4da5d65d8f
2 changed files with 31 additions and 15 deletions

View file

@ -66,6 +66,20 @@ in {
}
];
# fixes issues with /var/lib/private not having the correct permissions https://github.com/nix-community/impermanence/issues/254
system.activationScripts."createPersistentStorageDirs".deps = ["var-lib-private-permissions" "users" "groups"];
system.activationScripts = {
"var-lib-private-permissions" = {
deps = ["specialfs"];
text = ''
mkdir -p /persist/system/root/var/lib/private
chmod 0700 /persist/system/root/var/lib/private
'';
};
};
programs.fuse.userAllowOther = true;
environment.persistence =
lib.mapAttrs (datasetName: dataset: {
enable = true;
@ -90,9 +104,6 @@ in {
# TODO: need for boot on filesystems
}
(lib.mkIf config.storage.zfs.enable {
# TODO: activationScripts config for private folders
# TODO: rollback post resume
# TODO: fuse userAllowOther
storage.zfs.datasets =
lib.mapAttrs (
datasetName: dataset: