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/modules/system/zfs.nix
James Patrick 4e9b865e33 de-pluralized systems -> system
This was not being used consistently.
2022-07-16 19:07:34 -04:00

28 lines
679 B
Nix

{ config, lib, pkgs, ... }:
let cfg = config.this.system.zfs;
in with lib; {
options.this.system.zfs.enable = mkEnableOption "zfs";
config = mkIf cfg.enable {
boot = {
supportedFilesystems = [ "zfs" ];
zfs = {
forceImportRoot = false;
forceImportAll = false;
};
# this was required for the initial setup of the zpool.
# see https://nixos.org/nixos/options.html#boot.zfs.forceimportroot
# kernelParams = ["zfs_force=1"];
};
services.zfs = {
autoScrub.enable = true;
# enable default auto-snapshots
autoSnapshot = {
enable = true;
flags = "-k -p --utc";
};
};
};
}