feat(zfs): import ZFS pools and add the shared write group #31
Reference in New Issue
Block a user
Delete Branch "task-0005-storage-zfs-foundation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds
modules.zfs, the host-level ZFS pool import, and a sharedstoragegroup.Pools are imported as durable state (
boot.zfs.extraPools), never recreated, so service data survives any rebuild or reimage.Declared mountpoints become
fileSystemsentries withfsType = "zfs", orthogonal to the import — a pool with an empty map is still imported.storagegroup with a fixed gid (10000) lives inbase.nix, the substrate both the host base and the guest-base build on, so a host and every guest carry the identical number.That identity is the write mechanism: an identity-mapped container write lands on the pool as the same numeric group with no per-service permission juggling.
Verified identical (10000) on the host config and the sample guest's interior.
Deviations
The only host,
neogaia, is a laptop with no ZFS pools and a CachyOS kernel whosezfs-kernel-2.4.3build is marked broken, so a committed enablement would be both dishonest and unbuildable.This mirrors the networking foundation's verify-by-temporary-enablement decision.
The enabled build was verified through
extendModulesagainst a forced ZFS-supported kernel; the fullnixos-system-neogaiatoplevel built, andnix flake checkpasses on the committed, module-inert tree.poolsis typedattrsOf (attrsOf path)rather than a per-pool submodule; no per-pool option beyond the mount map is foreseen, so the submodule layer would have been speculative.modules.zfs, notmodules.storage.zfsunder astorage/directory. Nothing else lives under a storage namespace and the sibling foundationmodules.networkis likewise flat, so the extra level would have grouped a single member. The spec and ADR 0006 were updated to match.Review
Risk
Overall: High
storagegroup with fixed gid 10000 lands unconditionally inbase.nix, so it materializes on every host the flake builds.mkIf cfg.enablewith zero enablers, so nothing runs until a host opts in.Standards
No findings left unaddressed. The semicolon-in-comment hard violation, the multi-line-sentence gid comment, the speculative per-pool submodule, and the opaque value binding were all fixed in the diff before commit.
Spec
modules.zfsbuilds" is met out-of-band rather than by a committed host — reason:neogaiacannot honestly or buildably carry a ZFS enablement (no pools, broken ZFS kernel build), so it was verified viaextendModuleswith a ZFS-supported kernel, the same approach the networking foundation took.— Claude
08393cb3f3to7edc1ce94bfeat(storage): import ZFS pools and add the shared write groupto feat(zfs): import ZFS pools and add the shared write group