diff --git a/machines/back.nix b/machines/back.nix index bd66e1a..f4f50b2 100644 --- a/machines/back.nix +++ b/machines/back.nix @@ -1,10 +1,11 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: { imports = [ ../secrets/machines/back.nix ../system/baremetal-server.nix ../system/ucode-intel.nix + ../system/zfs.nix ]; system.stateVersion = "23.11"; @@ -46,8 +47,6 @@ ''; }; - boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages; - fileSystems."/" = { device = "/dev/mapper/nixos-root"; fsType = "btrfs"; @@ -76,8 +75,4 @@ device = "/dev/md0"; fsType = "vfat"; }; - - services.zfs.autoScrub.enable = true; - services.zfs.autoSnapshot.enable = true; - services.zfs.trim.enable = true; } diff --git a/system/zfs.nix b/system/zfs.nix new file mode 100644 index 0000000..f9a931f --- /dev/null +++ b/system/zfs.nix @@ -0,0 +1,12 @@ +{ config, pkgs, ... }: + +{ + boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages; + boot.supportedFilesystems = [ "boot" ]; + + environment.systemPackages = with pkgs; [ zfs ]; + + services.zfs.autoScrub.enable = true; + services.zfs.autoSnapshot.enable = true; + services.zfs.trim.enable = true; +}