summary refs log tree commit diff
path: root/nixos/modules/system/activation
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-03-03 15:21:42 +0100
committerEelco Dolstra <edolstra@gmail.com>2017-03-03 16:50:25 +0100
commit136f77b7b974f41362eddb750aae7ec9cb4c0a86 (patch)
treee45e035ea07b64afdcc2c4d2e6d01787b590eeb9 /nixos/modules/system/activation
parent044c7d091b980aba40521cd67e70022cdae60568 (diff)
downloadnixlib-136f77b7b974f41362eddb750aae7ec9cb4c0a86.tar
nixlib-136f77b7b974f41362eddb750aae7ec9cb4c0a86.tar.gz
nixlib-136f77b7b974f41362eddb750aae7ec9cb4c0a86.tar.bz2
nixlib-136f77b7b974f41362eddb750aae7ec9cb4c0a86.tar.lz
nixlib-136f77b7b974f41362eddb750aae7ec9cb4c0a86.tar.xz
nixlib-136f77b7b974f41362eddb750aae7ec9cb4c0a86.tar.zst
nixlib-136f77b7b974f41362eddb750aae7ec9cb4c0a86.zip
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).
Diffstat (limited to 'nixos/modules/system/activation')
-rw-r--r--nixos/modules/system/activation/switch-to-configuration.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/modules/system/activation/switch-to-configuration.pl b/nixos/modules/system/activation/switch-to-configuration.pl
index ca7932a3c5cd..88e7847cf8c8 100644
--- a/nixos/modules/system/activation/switch-to-configuration.pl
+++ b/nixos/modules/system/activation/switch-to-configuration.pl
@@ -41,7 +41,7 @@ if ($action eq "switch" || $action eq "boot") {
 }
 
 # 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";