create workaround for only first of multiple consecutive updates being applied
This commit is contained in:
parent
a44fd5e362
commit
4fa6f97f49
@ -18,9 +18,7 @@
|
||||
...
|
||||
}:
|
||||
''
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
do_update() {
|
||||
hostname=$(${hostname})
|
||||
new_system=$(nix build --no-link --print-out-paths "${cfg.flake}#nixosConfigurations.''${hostname}.config.system.build.toplevel")
|
||||
|
||||
@ -106,7 +104,7 @@
|
||||
echo "last system update: $(${date} -d @"$system_update_time")"
|
||||
echo "last flake update: $(${date} -d @"$flake_update_time")"
|
||||
|
||||
if [[ "$system_update_time" -gt "$flake_update_time" ]]
|
||||
if [[ -z "$1" ]] && [[ "$system_update_time" -gt "$flake_update_time" ]]
|
||||
then
|
||||
echo ""
|
||||
echo "System is newer than remote!"
|
||||
@ -182,4 +180,12 @@
|
||||
fi
|
||||
"''${new_system}/bin/switch-to-configuration" "boot"
|
||||
fi
|
||||
}
|
||||
if do_update
|
||||
then
|
||||
while true
|
||||
do
|
||||
do_update "forced"
|
||||
done
|
||||
fi
|
||||
''
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user