mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-05 17:27:50 +00:00
[Filesystems] Move ZFS config into defaults/filesystems
This commit is contained in:
parent
19504aadd8
commit
47a4b3d778
3 changed files with 39 additions and 4 deletions
6
filesystems/default.nix
Normal file
6
filesystems/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./zfs.nix
|
||||
];
|
||||
}
|
||||
25
filesystems/zfs.nix
Normal file
25
filesystems/zfs.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{config, lib, pkgs, ...}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.aviallon.filesystems.zfs;
|
||||
in {
|
||||
options.aviallon.filesystems.zfs = {
|
||||
enable = mkEnableOption "ZFS support";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
boot.initrd.supportedFilesystems = ["zfs"]; # boot from zfs
|
||||
boot.supportedFilesystems = [ "zfs" ];
|
||||
|
||||
aviallon.filesystems.udevRules = mkAfter [
|
||||
# ZFS doesn't like additional schedulers
|
||||
''SUBSYSTEM=="block", ACTION!="remove", KERNEL=="sd[a-z]*[0-9]*|mmcblk[0-9]*p[0-9]*|nvme[0-9]*n[0-9]*p[0-9]*", ENV{ID_FS_TYPE}=="zfs_member", ATTR{../queue/scheduler}="none"''
|
||||
];
|
||||
|
||||
services.zfs.autoScrub.enable = true;
|
||||
services.zfs.autoSnapshot.enable = true;
|
||||
|
||||
# Can cause issues with ZFS
|
||||
boot.kernelParams = [ "nohibernate" ];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue