add zfs module with options

This commit is contained in:
Noah Masur 2023-02-25 11:22:31 -05:00
parent 30fe7c2d18
commit d56a48cf65
3 changed files with 19 additions and 3 deletions

View File

@ -19,6 +19,7 @@ nixpkgs.lib.nixosSystem {
disko.nixosModules.disko
{
server = true;
zfs.enable = true;
gui.enable = false;
theme = { colors = (import ../../colorscheme/gruvbox).dark; };
nixpkgs.overlays = overlays;
@ -36,9 +37,9 @@ nixpkgs.lib.nixosSystem {
neovim.enable = true;
boot.zfs.enabled = true;
boot.kernelPackages =
config.boot.zfs.package.latestCompatibleLinuxPackages;
# boot.zfs.enabled = true;
# boot.kernelPackages =
# config.boot.zfs.package.latestCompatibleLinuxPackages;
# boot.zfs.extraPools = [ "mypool" ];
# services.zfs.autoScrub.enable = true;
# services.zfs.autoScrub.interval = "daily";

View File

@ -10,6 +10,7 @@
./server.nix
./sleep.nix
./wifi.nix
./zfs.nix
];
options = {

View File

@ -0,0 +1,14 @@
{ config, pkgs, lib, ... }: {
options = { zfs.enable = lib.mkEnableOption "ZFS file system."; };
config =
lib.mkIf (pkgs.stdenv.isLinux && config.server && config.zfs.enable) {
# Only use compatible Linux kernel, since ZFS can be behind
boot.kernelPackages =
config.boot.zfs.package.latestCompatibleLinuxPackages;
};
}