fix race-condition between system-build and flake-modification-time check
This commit is contained in:
parent
450e62d142
commit
03da1c3be6
@ -19,9 +19,6 @@
|
||||
}:
|
||||
''
|
||||
do_update() {
|
||||
hostname=$(${hostname})
|
||||
new_system=$(nix build --refresh --no-link --print-out-paths "${cfg.flake}#nixosConfigurations.''${hostname}.config.system.build.toplevel")
|
||||
|
||||
last_flake_update_time() {
|
||||
nix flake metadata --refresh --json "$1" | ${jq} .lastModified
|
||||
}
|
||||
@ -77,6 +74,10 @@ do_update() {
|
||||
fi
|
||||
}
|
||||
|
||||
hostname=$(${hostname})
|
||||
flake_update_time=$(last_flake_update_time "${cfg.flake}")
|
||||
new_system=$(nix build --refresh --no-link --print-out-paths "${cfg.flake}#nixosConfigurations.''${hostname}.config.system.build.toplevel")
|
||||
|
||||
latest_system=$(boot_system_path)
|
||||
|
||||
|
||||
@ -99,7 +100,6 @@ do_update() {
|
||||
fi
|
||||
|
||||
system_update_time=$(last_update_time)
|
||||
flake_update_time=$(last_flake_update_time "${cfg.flake}")
|
||||
|
||||
echo "last system update: $(${date} -d @"$system_update_time")"
|
||||
echo "last flake update: $(${date} -d @"$flake_update_time")"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user