tweak: host modules
This commit is contained in:
parent
1872ffe9a2
commit
952d8b731b
3 changed files with 21 additions and 29 deletions
|
|
@ -11,6 +11,9 @@
|
|||
# modules that comprise the host specific configuration
|
||||
modules = with self.nixosModules; [
|
||||
|
||||
# user modules
|
||||
serenity
|
||||
|
||||
# shared system modules
|
||||
core # shared configuration options
|
||||
user-parts # user variables
|
||||
|
|
@ -18,24 +21,20 @@
|
|||
# host-specific modules
|
||||
hades-configuration # host specific configuration options below
|
||||
hades-hardware # hardware configuration options for host
|
||||
zfs-hades # specific zfs configuration for host
|
||||
zfs-support # zfs support module for hades specific zpool
|
||||
|
||||
# feature modules
|
||||
virtualisation
|
||||
network-proxy
|
||||
zfs-support
|
||||
kde-connect
|
||||
terminal
|
||||
terminal-emulator
|
||||
desktop
|
||||
music
|
||||
music-production
|
||||
gaming
|
||||
multimedia
|
||||
virtual-reality
|
||||
|
||||
# user modules
|
||||
serenity
|
||||
virtualisation # virtual machines
|
||||
network-proxy # basic dns crypt proxy
|
||||
kde-connect # phone <-> desktop connectivity
|
||||
terminal # most terminal programs
|
||||
terminal-emulator # terminal program for desktops
|
||||
desktop # most desktop programs
|
||||
music # music consumption
|
||||
music-production # music creation
|
||||
gaming # gaming modules, steam, osu, etc.
|
||||
multimedia # image and video programs
|
||||
virtual-reality # configuration for vr setup
|
||||
|
||||
];
|
||||
|
||||
|
|
|
|||
58
modules/hosts/hades/zfs-support.nix
Normal file
58
modules/hosts/hades/zfs-support.nix
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
{ self, inputs, ... }:
|
||||
|
||||
{
|
||||
|
||||
flake.nixosModules.zfs-support =
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
|
||||
# matches kernel to latest with zfs support
|
||||
# Black magic wizardry from https://wiki.nixos.org/wiki/ZFS
|
||||
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 = [ inputs.home-manager.nixosModules.home-manager ];
|
||||
|
||||
boot = {
|
||||
# sets system to use latest zfs compatible kernel
|
||||
kernelPackages = lib.mkForce latestKernelPackage;
|
||||
# adds zfs support at boot
|
||||
supportedFilesystems = [ "zfs" ];
|
||||
# zfs boot settings
|
||||
boot.zfs = {
|
||||
forceImportRoot = false;
|
||||
# imports hades specific zpool
|
||||
extraPools = [ "orcus" ];
|
||||
};
|
||||
};
|
||||
|
||||
# adds zfs to system packages
|
||||
environment.systemPackages = with pkgs; [ zfs ];
|
||||
|
||||
# is this needed? - YES nixos yelled at me about it
|
||||
networking.hostId = "603b0c8b";
|
||||
|
||||
# data integrity service
|
||||
services.zfs.autoScrub.enable = true;
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue