Make impermanence reset work on unencrypted hosts.

This commit is contained in:
2025-10-24 14:49:32 +01:00
parent ce7b3bbe16
commit 4921679140

View File

@@ -64,7 +64,7 @@ in
# Note `lib.mkBefore` is used instead of `lib.mkAfter` here. # Note `lib.mkBefore` is used instead of `lib.mkAfter` here.
boot.initrd.postDeviceCommands = pkgs.lib.mkBefore '' boot.initrd.postDeviceCommands = pkgs.lib.mkBefore ''
mkdir /mnt mkdir /mnt
mount /dev/mapper/luksroot /mnt mount ${config.fileSystems."/".device} /mnt
if [[ -e /mnt/root ]]; then if [[ -e /mnt/root ]]; then
mkdir -p /mnt/old_roots mkdir -p /mnt/old_roots
timestamp=$(date --date="@$(stat -c %Y /mnt/root)" "+%Y-%m-%-d_%H:%M:%S") timestamp=$(date --date="@$(stat -c %Y /mnt/root)" "+%Y-%m-%-d_%H:%M:%S")