try again
This commit is contained in:
parent
2937e59e91
commit
ebf2bc1540
1 changed files with 95 additions and 110 deletions
|
|
@ -256,33 +256,18 @@ lib.mkMerge [
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
KeyringMode = "shared";
|
KeyringMode = "shared";
|
||||||
# We need a path that includes standard tools (mkdir, mount, find, date, stat)
|
Environment = "PATH=${
|
||||||
# and bcachefs tools.
|
|
||||||
# Environment = "PATH=${
|
|
||||||
# lib.makeBinPath [
|
|
||||||
# pkgs.coreutils
|
|
||||||
# pkgs.util-linux
|
|
||||||
# pkgs.findutils
|
|
||||||
# pkgs.gawk
|
|
||||||
# pkgs.bcachefs-tools
|
|
||||||
# pkgs.gnugrep
|
|
||||||
# ]
|
|
||||||
# }:/bin:/sbin";
|
|
||||||
};
|
|
||||||
|
|
||||||
script = ''
|
|
||||||
# This forces Nix to include these packages in the initrd closure
|
|
||||||
export PATH="${
|
|
||||||
lib.makeBinPath [
|
lib.makeBinPath [
|
||||||
pkgs.coreutils
|
pkgs.coreutils
|
||||||
pkgs.util-linux
|
pkgs.util-linux
|
||||||
pkgs.findutils
|
# pkgs.findutils
|
||||||
pkgs.gawk
|
# pkgs.gawk
|
||||||
pkgs.bcachefs-tools
|
# pkgs.bcachefs-tools
|
||||||
pkgs.gnugrep
|
|
||||||
]
|
]
|
||||||
|
}:/bin:/sbin";
|
||||||
|
};
|
||||||
|
|
||||||
}:$PATH"
|
script = ''
|
||||||
# 1. Enable Debugging
|
# 1. Enable Debugging
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
|
|
@ -294,7 +279,7 @@ lib.mkMerge [
|
||||||
bcachefs subvolume create /primary_tmp/@root
|
bcachefs subvolume create /primary_tmp/@root
|
||||||
fi
|
fi
|
||||||
# Robust replacement for 'mountpoint -q'
|
# Robust replacement for 'mountpoint -q'
|
||||||
if grep -qs "/primary_tmp " /proc/mounts; then
|
if ls /primary_tmp; then
|
||||||
echo "Cleanup: Unmounting /primary_tmp"
|
echo "Cleanup: Unmounting /primary_tmp"
|
||||||
umount /primary_tmp
|
umount /primary_tmp
|
||||||
fi
|
fi
|
||||||
|
|
@ -328,7 +313,7 @@ lib.mkMerge [
|
||||||
|
|
||||||
# Get list of snapshots sorted by name (which effectively sorts by date: YYYY-MM-DD...)
|
# Get list of snapshots sorted by name (which effectively sorts by date: YYYY-MM-DD...)
|
||||||
# ls -r puts newest first
|
# ls -r puts newest first
|
||||||
snapshots=$(ls -1r /primary_tmp/@snapshots/old_roots | grep -E '^[0-9]{4}-[0-9]{2}-[0-9]{2}')
|
snapshots=$(ls -1Ar /primary_tmp/@snapshots/old_roots)
|
||||||
|
|
||||||
declare -A kept_weeks
|
declare -A kept_weeks
|
||||||
declare -A kept_months
|
declare -A kept_months
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue