From 725b238a1eeae54453f16ed8a9bfbe5885b65c1a Mon Sep 17 00:00:00 2001 From: Nikolaos Karaolidis Date: Fri, 28 Feb 2025 23:31:19 +0000 Subject: [PATCH] Update impermanence config Signed-off-by: Nikolaos Karaolidis --- hosts/common/configs/system/impermanence/options.nix | 2 +- hosts/common/configs/system/impermanence/scripts/wipe.sh | 7 +------ hosts/common/configs/system/nix-cleanup/cleanup.sh | 7 +------ hosts/elara/default.nix | 2 +- hosts/installer/default.nix | 2 +- 5 files changed, 5 insertions(+), 15 deletions(-) diff --git a/hosts/common/configs/system/impermanence/options.nix b/hosts/common/configs/system/impermanence/options.nix index 0ccdf85..54e2e6d 100644 --- a/hosts/common/configs/system/impermanence/options.nix +++ b/hosts/common/configs/system/impermanence/options.nix @@ -49,7 +49,7 @@ in { impermanence.device = mkOption { type = str; - default = config.disko.devices.disk.main.content.partitions.root.content.name; + default = config.disko.devices.disk.main.content.partitions.root.content.content.device; description = '' LUKS BTRFS partition to wipe on boot. ''; diff --git a/hosts/common/configs/system/impermanence/scripts/wipe.sh b/hosts/common/configs/system/impermanence/scripts/wipe.sh index e3942f0..62c03e4 100644 --- a/hosts/common/configs/system/impermanence/scripts/wipe.sh +++ b/hosts/common/configs/system/impermanence/scripts/wipe.sh @@ -8,13 +8,8 @@ delete_subvolume_recursively() { btrfs subvolume delete "$1" } -if [[ -z "$DEVICE" ]]; then - echo "Error: DEVICE variable is not set." - exit 1 -fi - mkdir -p /mnt/btrfs -mount "/dev/mapper/$DEVICE" /mnt/btrfs +mount "$DEVICE" /mnt/btrfs if [[ -e /mnt/btrfs/@ ]]; then mkdir -p /mnt/btrfs/@.bak diff --git a/hosts/common/configs/system/nix-cleanup/cleanup.sh b/hosts/common/configs/system/nix-cleanup/cleanup.sh index 157c326..b1892ea 100644 --- a/hosts/common/configs/system/nix-cleanup/cleanup.sh +++ b/hosts/common/configs/system/nix-cleanup/cleanup.sh @@ -18,13 +18,8 @@ if [[ -e /mnt/btrfs && -n $(mountpoint -q /mnt/btrfs) ]]; then exit 1 fi -if [[ -z "$DEVICE" ]]; then - echo "Error: DEVICE variable is not set." - exit 1 -fi - mkdir -p /mnt/btrfs -mount "/dev/mapper/$DEVICE" /mnt/btrfs +mount "$DEVICE" /mnt/btrfs if [[ -e /mnt/btrfs/@.bak ]]; then if [[ -n "$(ls -A /mnt/btrfs/@.bak)" ]]; then diff --git a/hosts/elara/default.nix b/hosts/elara/default.nix index 4ccb030..ad16f2c 100644 --- a/hosts/elara/default.nix +++ b/hosts/elara/default.nix @@ -55,5 +55,5 @@ sops.defaultSopsFile = ./secrets/secrets.yaml; environment.impermanence.device = - config.disko.devices.disk.usb.content.partitions.root.content.name; + config.disko.devices.disk.usb.content.partitions.root.content.content.device; } diff --git a/hosts/installer/default.nix b/hosts/installer/default.nix index c4dbd8f..2759638 100644 --- a/hosts/installer/default.nix +++ b/hosts/installer/default.nix @@ -41,5 +41,5 @@ sops.defaultSopsFile = ./secrets/secrets.yaml; environment.impermanence.device = - config.disko.devices.disk.installer.content.partitions.root.content.name; + config.disko.devices.disk.installer.content.partitions.root.content.content.device; }