nixos-rebuild: Sync /nix/store only
We only care about /nix/store because its contents might be out of sync with /nix/var/nix/db. Syncing other filesystems might cause unnecessary delays or hangs (e.g. I encountered a case where an NFS mount was taking a very long time to sync).
This commit is contained in:
parent
044c7d091b
commit
136f77b7b9
@ -41,7 +41,7 @@ if ($action eq "switch" || $action eq "boot") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Just in case the new configuration hangs the system, do a sync now.
|
# Just in case the new configuration hangs the system, do a sync now.
|
||||||
system("@coreutils@/bin/sync") unless ($ENV{"NIXOS_NO_SYNC"} // "") eq "1";
|
system("@coreutils@/bin/sync", "-f", "/nix/store") unless ($ENV{"NIXOS_NO_SYNC"} // "") eq "1";
|
||||||
|
|
||||||
exit 0 if $action eq "boot";
|
exit 0 if $action eq "boot";
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user