docs(nixos): clarify host module options

This commit was merged in pull request #139.
This commit is contained in:
2026-10-07 18:20:53 -04:00
parent b3c4903c82
commit 65c84f5b39
2 changed files with 8 additions and 13 deletions

View File

@@ -5,7 +5,7 @@
...
}:
{
options.modules.host.cachyos.enable = lib.mkEnableOption "CachyOS kernel";
options.modules.host.cachyos.enable = lib.mkEnableOption "the CachyOS kernel";
config = lib.mkIf config.modules.host.cachyos.enable {
boot.kernelPackages = pkgs.linuxPackages_cachyos;

View File

@@ -3,13 +3,13 @@
lib,
...
}:
# The host-level ZFS pool import: durable service state a host mounts, never rebuilds.
# Imports existing ZFS pools that hold durable service state.
let
cfg = config.modules.host.zfs; # NOLINT(let_order)
in
{
options.modules.host.zfs = {
enable = lib.mkEnableOption "importing durable ZFS pools that hold service state";
enable = lib.mkEnableOption "ZFS pool imports for durable service state";
pools = lib.mkOption {
type = lib.types.attrsOf (lib.types.attrsOf lib.types.path);
@@ -23,29 +23,24 @@ in
}
'';
description = ''
The ZFS pools to import at boot, keyed by pool name, each pool mapping a
dataset path relative to it to that dataset's mountpoint. A pool is
durable state imported as it stands, never created or destroyed by a
rebuild, so a service's data survives any rebuild or reimage. A pool
with an empty map is still imported, leaving each dataset to its own ZFS
`mountpoint` property.
Lists pools that NixOS imports at boot.
Maps each dataset name to its mount point.
NixOS does not create or destroy these pools during rebuilds.
An empty map imports the pool without declaring file systems.
'';
};
};
config = lib.mkIf cfg.enable {
# The ZFS stack in the kernel and boot, needed even where the root filesystem is another kind.
boot.supportedFilesystems = [ "zfs" ];
# Derive a stable 32-bit host ID from the configured hostname.
# This module derives a stable host ID from the configured hostname.
networking.hostId = builtins.substring 0 8 (
builtins.hashString "sha256" config.networking.hostName
);
# The declared pools are imported at boot, distinct from any pool backing the root filesystem.
boot.zfs.extraPools = lib.attrNames cfg.pools;
# Each declared dataset is mounted at its host path as a native ZFS filesystem.
fileSystems = lib.mkMerge (
lib.mapAttrsToList (
pool: mounts: