This repository has been archived on 2023-08-08. You can view files and clone it, but cannot push or open issues or pull requests.
nil/nixos/zfs.nix
2021-11-15 02:49:03 +00:00

22 lines
646 B
Nix

# /etc/nixos/zfs.nix (Don't forget to add it to configuration.nix)
# These are the options ZFS requires, but a normal system has, of course,
# more options (like a bootloader, or installed software).
{ config, pkgs, ... }:
{
# remove this after 1st boot
# see https://nixos.org/nixos/options.html#boot.zfs.forceimportroot
boot.kernelParams = ["zfs_force=1"];
boot.zfs.forceImportRoot = false;
boot.zfs.forceImportAll = false;
boot.supportedFilesystems = [ "zfs" ];
services.zfs.autoScrub.enable = true;
# this enables the zfs-auto-snapshot
services.zfs.autoSnapshot = {
enable = true;
flags = "-k -p --utc";
};
}