removed old zfs module
This commit is contained in:
parent
746b25e2bc
commit
61a537697c
3 changed files with 24 additions and 80 deletions
|
|
@ -10,7 +10,7 @@
|
||||||
## Shared 'core' config options
|
## Shared 'core' config options
|
||||||
../../../core
|
../../../core
|
||||||
## Host-specific core modules
|
## Host-specific core modules
|
||||||
../../../core/modules/optional/zfs2.nix
|
../../../core/modules/optional/zfs.nix
|
||||||
../../../core/modules/optional/gaming.nix
|
../../../core/modules/optional/gaming.nix
|
||||||
../../../core/modules/optional/jellyfin.nix
|
../../../core/modules/optional/jellyfin.nix
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,18 +5,17 @@
|
||||||
|
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
## Black magic wizardry from https://wiki.nixos.org/wiki/ZFS
|
||||||
let
|
let
|
||||||
## This 'let' binding creates an attribute set
|
|
||||||
## called "LatestZfsLinux", which we can call as
|
zfsCompatibleKernelPackages = lib.filterAttrs (name: kernelPackages:
|
||||||
## a package to specify when building our kernel.
|
(builtins.match "linux_[0-9]+_[0-9]+" name) != null
|
||||||
latestZfsLinux = lib.pipe pkgs.linuxKernel.packages [
|
&& (builtins.tryEval kernelPackages).success
|
||||||
builtins.attrValues
|
&& (!kernelPackages.${config.boot.zfs.package.kernelModuleAttribute}.meta.broken))
|
||||||
(builtins.filter (kPkgs:
|
pkgs.linuxKernel.packages;
|
||||||
(builtins.tryEval kPkgs).success && kPkgs ? kernel && kPkgs.kernel.pname
|
latestKernelPackage = lib.last
|
||||||
== "linux" && !kPkgs.zfs.meta.broken))
|
(lib.sort (a: b: (lib.versionOlder a.kernel.version b.kernel.version))
|
||||||
(builtins.sort (a: b: (lib.versionOlder a.kernel.version b.kernel.version)))
|
(builtins.attrValues zfsCompatibleKernelPackages));
|
||||||
lib.last
|
|
||||||
];
|
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
||||||
|
|
@ -24,20 +23,24 @@ in {
|
||||||
|
|
||||||
## Enable zfs in kernel and boot
|
## Enable zfs in kernel and boot
|
||||||
boot = {
|
boot = {
|
||||||
kernelPackages = lib.mkForce latestZfsLinux;
|
## Sets system to use the kernel specified in the let binding above
|
||||||
|
kernelPackages = lib.mkForce latestKernelPackage;
|
||||||
supportedFilesystems = [ "zfs" ];
|
supportedFilesystems = [ "zfs" ];
|
||||||
zfs = {
|
zfs = {
|
||||||
|
## uhhh
|
||||||
extraPools = [ "orcus" ];
|
extraPools = [ "orcus" ];
|
||||||
|
## uhhh
|
||||||
forceImportRoot = false;
|
forceImportRoot = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
#fileSystems."/home/serenity/Disks/Orcus" = {
|
#fileSystems."/run/media/serenity/Orcus" = {
|
||||||
#device = "orcus";
|
#device = "orcus";
|
||||||
#fsType = "zfs";
|
#fsType = "zfs";
|
||||||
#options = [ "users" ];
|
#options = [ "users" ];
|
||||||
#};
|
#};
|
||||||
|
|
||||||
|
## Adding ZFS package to system just in case
|
||||||
environment.systemPackages = with pkgs; [ zfs ];
|
environment.systemPackages = with pkgs; [ zfs ];
|
||||||
|
|
||||||
## Enable trim for ZFS SSDs
|
## Enable trim for ZFS SSDs
|
||||||
|
|
@ -51,6 +54,13 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
## Automount service for the ZFS pools
|
||||||
|
## Is supposed to be enabled by default
|
||||||
|
#systemd.services.zfs-mount = {
|
||||||
|
#enable = true;
|
||||||
|
#};
|
||||||
|
|
||||||
|
## Unsure why this is here actually ?
|
||||||
networking = { hostId = "603b0c8b"; };
|
networking = { hostId = "603b0c8b"; };
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,66 +0,0 @@
|
||||||
# # 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
|
|
||||||
|
|
||||||
{ config, lib, pkgs, ... }:
|
|
||||||
|
|
||||||
## Black magic wizardry from https://wiki.nixos.org/wiki/ZFS
|
|
||||||
let
|
|
||||||
|
|
||||||
zfsCompatibleKernelPackages = lib.filterAttrs (name: kernelPackages:
|
|
||||||
(builtins.match "linux_[0-9]+_[0-9]+" name) != null
|
|
||||||
&& (builtins.tryEval kernelPackages).success
|
|
||||||
&& (!kernelPackages.${config.boot.zfs.package.kernelModuleAttribute}.meta.broken))
|
|
||||||
pkgs.linuxKernel.packages;
|
|
||||||
latestKernelPackage = lib.last
|
|
||||||
(lib.sort (a: b: (lib.versionOlder a.kernel.version b.kernel.version))
|
|
||||||
(builtins.attrValues zfsCompatibleKernelPackages));
|
|
||||||
|
|
||||||
in {
|
|
||||||
|
|
||||||
imports = [ ];
|
|
||||||
|
|
||||||
## Enable zfs in kernel and boot
|
|
||||||
boot = {
|
|
||||||
## Sets system to use the kernel specified in the let binding above
|
|
||||||
kernelPackages = lib.mkForce latestKernelPackage;
|
|
||||||
supportedFilesystems = [ "zfs" ];
|
|
||||||
zfs = {
|
|
||||||
## uhhh
|
|
||||||
extraPools = [ "orcus" ];
|
|
||||||
## uhhh
|
|
||||||
forceImportRoot = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
#fileSystems."/run/media/serenity/Orcus" = {
|
|
||||||
#device = "orcus";
|
|
||||||
#fsType = "zfs";
|
|
||||||
#options = [ "users" ];
|
|
||||||
#};
|
|
||||||
|
|
||||||
## Adding ZFS package to system just in case
|
|
||||||
environment.systemPackages = with pkgs; [ zfs ];
|
|
||||||
|
|
||||||
## Enable trim for ZFS SSDs
|
|
||||||
services = {
|
|
||||||
zfs = {
|
|
||||||
## Trim for SSSds with ZFS
|
|
||||||
#trim.enable = true;
|
|
||||||
## Autoscrub data integrity ZFS service,
|
|
||||||
## more to be added soon
|
|
||||||
autoScrub = { enable = true; };
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
## Automount service for the ZFS pools
|
|
||||||
## Is supposed to be enabled by default
|
|
||||||
#systemd.services.zfs-mount = {
|
|
||||||
#enable = true;
|
|
||||||
#};
|
|
||||||
|
|
||||||
## Unsure why this is here actually ?
|
|
||||||
networking = { hostId = "603b0c8b"; };
|
|
||||||
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue