added zfs2.nix to test a repair for the breaking change from the latest flake.lock update

This commit is contained in:
serenity-F 2025-02-28 22:21:29 +10:00
parent b012ab1e3f
commit 3a9b71ab89
3 changed files with 83 additions and 29 deletions

View file

@ -1,9 +1,9 @@
## ZFS Support NixOS module
# # ZFS Support NixOS module
## temporary location while we figure out how ZFS works,
## eventually this will be embedded into the flake in a better way
{ lib, pkgs, ... }:
{ config, lib, pkgs, ... }:
let
## This 'let' binding creates an attribute set
@ -11,22 +11,16 @@ let
## a package to specify when building our kernel.
latestZfsLinux = lib.pipe pkgs.linuxKernel.packages [
builtins.attrValues
(builtins.filter (
kPkgs:
(builtins.tryEval kPkgs).success
&& kPkgs ? kernel
&& kPkgs.kernel.pname == "linux"
&& !kPkgs.zfs.meta.broken
))
(builtins.filter (kPkgs:
(builtins.tryEval kPkgs).success && kPkgs ? kernel && kPkgs.kernel.pname
== "linux" && !kPkgs.zfs.meta.broken))
(builtins.sort (a: b: (lib.versionOlder a.kernel.version b.kernel.version)))
lib.last
];
in
{
in {
imports = [
];
imports = [ ];
## Enable zfs in kernel and boot
boot = {
@ -38,31 +32,25 @@ in
};
};
#fileSystems."/home/serenity/Disks/Orcus" = {
#device = "orcus";
#fsType = "zfs";
#options = [ "users" ];
#};
#fileSystems."/home/serenity/Disks/Orcus" = {
#device = "orcus";
#fsType = "zfs";
#options = [ "users" ];
#};
environment.systemPackages = with pkgs; [
zfs
];
environment.systemPackages = with pkgs; [ zfs ];
## Enable trim for ZFS SSDs
services = {
zfs = {
## Trim for SSSds with ZFS
#trim.enable = true;
#trim.enable = true;
## Autoscrub data integrity ZFS service,
## more to be added soon
autoScrub = {
enable = true;
};
autoScrub = { enable = true; };
};
};
networking = {
hostId = "603b0c8b";
};
networking = { hostId = "603b0c8b"; };
}