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 = {
|
||||
Type = "oneshot";
|
||||
KeyringMode = "shared";
|
||||
# We need a path that includes standard tools (mkdir, mount, find, date, stat)
|
||||
# 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="${
|
||||
Environment = "PATH=${
|
||||
lib.makeBinPath [
|
||||
pkgs.coreutils
|
||||
pkgs.util-linux
|
||||
pkgs.findutils
|
||||
pkgs.gawk
|
||||
pkgs.bcachefs-tools
|
||||
pkgs.gnugrep
|
||||
# pkgs.findutils
|
||||
# pkgs.gawk
|
||||
# pkgs.bcachefs-tools
|
||||
]
|
||||
}:/bin:/sbin";
|
||||
};
|
||||
|
||||
}:$PATH"
|
||||
script = ''
|
||||
# 1. Enable Debugging
|
||||
set -x
|
||||
|
||||
|
|
@ -294,7 +279,7 @@ lib.mkMerge [
|
|||
bcachefs subvolume create /primary_tmp/@root
|
||||
fi
|
||||
# Robust replacement for 'mountpoint -q'
|
||||
if grep -qs "/primary_tmp " /proc/mounts; then
|
||||
if ls /primary_tmp; then
|
||||
echo "Cleanup: Unmounting /primary_tmp"
|
||||
umount /primary_tmp
|
||||
fi
|
||||
|
|
@ -328,7 +313,7 @@ lib.mkMerge [
|
|||
|
||||
# Get list of snapshots sorted by name (which effectively sorts by date: YYYY-MM-DD...)
|
||||
# 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_months
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue