system/preservation: use static symlink for files in /etc

This commit is contained in:
Lu Wang 2025-01-13 13:17:05 +08:00
parent afaea05ad3
commit 73840cc9b5
Signed by: rebmit
SSH key fingerprint: SHA256:3px8QV1zEerIrEWHaqtH5rR9kjetyRST5EipOPrd+bU
2 changed files with 9 additions and 10 deletions

View file

@ -9,5 +9,8 @@
pkiBundle = "/etc/secureboot"; pkiBundle = "/etc/secureboot";
}; };
preservation.preserveAt."/persist".directories = [ "/etc/secureboot" ]; environment.etc."secureboot" = {
source = "/persist/etc/secureboot";
mode = "direct-symlink";
};
} }

View file

@ -64,21 +64,17 @@
user = "root"; user = "root";
group = "root"; group = "root";
} }
{
file = "/etc/machine-id";
inInitrd = true;
how = "symlink";
mode = "-";
user = "root";
group = "root";
configureParent = true;
}
]; ];
}; };
} }
); );
}; };
environment.etc."machine-id" = {
source = "/persist/etc/machine-id";
mode = "direct-symlink";
};
# https://github.com/NixOS/nixpkgs/pull/351151#issuecomment-2549025171 # https://github.com/NixOS/nixpkgs/pull/351151#issuecomment-2549025171
systemd.services.systemd-machine-id-commit = { systemd.services.systemd-machine-id-commit = {
unitConfig.ConditionPathIsMountPoint = [ unitConfig.ConditionPathIsMountPoint = [