clan.core.state: wrap all commands in shell scripts

Otherwise we cannot execute them via ssh and also have nix store
dependencies.
This commit is contained in:
Jörg Thalheim
2024-06-19 11:42:14 +02:00
parent 06e6c24a64
commit e68ebc8d6c
6 changed files with 117 additions and 31 deletions

View File

@@ -125,7 +125,6 @@ in
}
${lib.concatMapStringsSep "\n" (target: ''
${mountHook target}
set -x
echo "Creating backup '${target.name}'"
${lib.optionalString (target.preBackupHook != null) ''
@@ -139,7 +138,7 @@ in
state:
lib.optionalString (state.preBackupCommand != null) ''
echo "Running pre-backup command for ${state.name}"
if ! ( ${state.preBackupCommand} ) then
if ! /run/current-system/sw/bin/${state.preBackupCommand}; then
preCommandErrors["${state.name}"]=1
fi
''