disko-deactivate: fix jq syntax

This commit is contained in:
Jörg Thalheim
2025-04-08 19:53:48 +02:00
committed by Jörg Thalheim
parent 8f806681d7
commit a8e75da08f
2 changed files with 3 additions and 1 deletions

View File

@@ -69,7 +69,7 @@ def deactivate:
def walk:
[
(.mountpoints[] | select(. != null) | "umount -R (. | shellquote)"),
(.mountpoints[] | select(. != null) | "umount -R \(. | shellquote)"),
((.children // []) | map(walk)),
remove,
deactivate

View File

@@ -55,6 +55,8 @@ pkgs.nixosTest {
permission = machine.succeed("stat -c %a /tmp/age.key").strip()
assert permission == "600", f"expected permission 600 on /tmp/age.key, got {permission}"
# Some distros like to automount disks with spaces
machine.succeed('mkdir -p "/mnt/with spaces" && mkfs.ext4 /dev/vdb && mount /dev/vdb "/mnt/with spaces"')
machine.succeed("${disko}/bin/disko-install --disk main /dev/vdb --extra-files /tmp/age.key /var/lib/secrets/age.key --flake ${../..}#testmachine")
# test idempotency
machine.succeed("${disko}/bin/disko-install --mode mount --disk main /dev/vdb --flake ${../..}#testmachine")