Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2024-12-18 23:29:49 +00:00
parent e23e71560f
commit bcad2979bf
10 changed files with 146 additions and 117 deletions

View File

@@ -16,8 +16,13 @@ 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/luks /mnt/btrfs
mount "/dev/mapper/$DEVICE" /mnt/btrfs
if [[ -e /mnt/btrfs/@.bak ]]; then
if [[ -n "$(ls -A /mnt/btrfs/@.bak)" ]]; then

View File

@@ -1,4 +1,4 @@
{ pkgs, ... }:
{ config, pkgs, ... }:
{
environment.systemPackages = [
(pkgs.writeShellApplication {
@@ -10,6 +10,7 @@
btrfs-progs
nix
];
runtimeEnv.DEVICE = config.environment.impermanence.device;
text = builtins.readFile ./cleanup.sh;
})
];