about summary refs log tree commit diff
path: root/nixos/modules/tasks/filesystems
diff options
context:
space:
mode:
authorWill Fancher <elvishjerricco@gmail.com>2022-04-28 20:17:23 -0400
committerGitHub <noreply@github.com>2022-04-28 20:17:23 -0400
commit2e96b64e02d054850a8e5957526fd7d6a87f6958 (patch)
tree23d7b0127cf94562b45ea5d08ad0db552dc82218 /nixos/modules/tasks/filesystems
parentbf5f25a163489d9d7345521e7afb8b012006da68 (diff)
parent50925651bb58db3232a5c64b60a0faac880d6954 (diff)
downloadnixlib-2e96b64e02d054850a8e5957526fd7d6a87f6958.tar
nixlib-2e96b64e02d054850a8e5957526fd7d6a87f6958.tar.gz
nixlib-2e96b64e02d054850a8e5957526fd7d6a87f6958.tar.bz2
nixlib-2e96b64e02d054850a8e5957526fd7d6a87f6958.tar.lz
nixlib-2e96b64e02d054850a8e5957526fd7d6a87f6958.tar.xz
nixlib-2e96b64e02d054850a8e5957526fd7d6a87f6958.tar.zst
nixlib-2e96b64e02d054850a8e5957526fd7d6a87f6958.zip
Merge pull request #170123 from ElvishJerricco/systemd-shutdown-ramfs-fixup
Systemd shutdown ramfs fixup
Diffstat (limited to 'nixos/modules/tasks/filesystems')
-rw-r--r--nixos/modules/tasks/filesystems/zfs.nix5
1 files changed, 5 insertions, 0 deletions
diff --git a/nixos/modules/tasks/filesystems/zfs.nix b/nixos/modules/tasks/filesystems/zfs.nix
index fbfc61177d38..5eca68798d5d 100644
--- a/nixos/modules/tasks/filesystems/zfs.nix
+++ b/nixos/modules/tasks/filesystems/zfs.nix
@@ -466,6 +466,11 @@ in
         '') rootPools));
       };
 
+      systemd.shutdownRamfs.contents."/etc/systemd/system-shutdown/zpool".source = pkgs.writeShellScript "zpool-sync-shutdown" ''
+        exec ${cfgZfs.package}/bin/zpool sync
+      '';
+      systemd.shutdownRamfs.storePaths = ["${cfgZfs.package}/bin/zpool"];
+
       # TODO FIXME See https://github.com/NixOS/nixpkgs/pull/99386#issuecomment-798813567. To not break people's bootloader and as probably not everybody would read release notes that thoroughly add inSystem.
       boot.loader.grub = mkIf (inInitrd || inSystem) {
         zfsSupport = true;