From e798f573f07bfb4b88973496e2292558c3c7b405 Mon Sep 17 00:00:00 2001
From: Dan Peebles <pumpkin@me.com>
Date: Sun, 26 Feb 2017 02:02:22 +0000
Subject: [PATCH] make-disk-image.nix: set last fsck time on ext4 images to
 enable resize-on-startup

---
 nixos/lib/make-disk-image.nix | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/nixos/lib/make-disk-image.nix b/nixos/lib/make-disk-image.nix
index d9d76b5919a5..8c5de22f30ff 100644
--- a/nixos/lib/make-disk-image.nix
+++ b/nixos/lib/make-disk-image.nix
@@ -145,9 +145,11 @@ pkgs.vmTools.runInLinuxVM (
 
       umount /mnt
 
-      # Make sure resize2fs works
+      # Make sure resize2fs works. Note that resize2fs has stricter criteria for resizing than a normal
+      # mount, so the `-c 0` and `-i 0` don't affect it. Setting it to `now` doesn't produce deterministic
+      # output, of course, but we can fix that when/if we start making images deterministic.
       ${optionalString (fsType == "ext4") ''
-        tune2fs -c 0 -i 0 $rootDisk
+        tune2fs -T now -c 0 -i 0 $rootDisk
       ''}
     ''
 )