{ lib, pkgs, ... }: let mkZfs = lib.mkOverride 810; # https://wiki.nixos.org/wiki/ZFS nixosConfig = { boot._loader = { grub.zfsSupport = mkZfs true; mode = mkZfs "efi"; }; services.zfs = { trim.enable = mkZfs true; autoSnapshot.enable = mkZfs true; autoScrub.enable = mkZfs true; }; # Make docker work with zfs virtualisation.docker.storageDriver = mkZfs "zfs"; # Ensure root pools are safely imported (default after 26.11) # NOTE: If NixOS fails to boot because it cannot import the root pool, # you should boot with the zfs_force=1 option as a kernel parameter # (e.g. by manually editing the kernel params via your bootloader). You # should only need to do this after unclean shutdowns. boot.zfs.forceImportRoot = mkZfs false; }; homeConfig = {}; in { imports = [ (lib._mkProfileArchetype "zfs" nixosConfig homeConfig) ]; }