Storage
Introduction
The storage module declares a nested tree of shared ZFS datasets. Each declaration produces a mount path that other modules consume, keeping dataset ownership, ZFS properties, and snapshot policy in one place.
Requirements
The configured ZFS pool must exist and be importable during boot. Dataset consumers should declare their requirements through this module rather than creating mountpoints independently.
Consumers should use generated paths such as
config.storage.datasets.media.children.movies.path instead
of reconstructing /storage/... paths themselves.
Invariants
- Child dataset mount paths are derived from their position in the declaration tree.
- Dataset declarations describe shared persistent storage and should not be replaced with unmanaged host paths.
- Snapshot settings inherit only through values explicitly assigned by module composition.
Recovery
Import the pool and verify dataset mountpoints before starting dependent services. If a path is unexpectedly empty, check whether the dataset is mounted before writing new data into the underlying directory.
Options
storage.enable
Enable shared host storage datasets and paths.
Type: boolean
Default:
falseDeclared by:
storage.dataPath
Root mount path for shared host storage.
Type: string (read only)
Default:
"/storage"Declared by:
storage.datasets
Nested shared host storage datasets.
Type: lazy attribute set of (submodule)
Default:
{ }Example:
{
media = {
owner = "media";
group = "media";
options.recordsize = "1M";
children.movies = {};
};
}Declared by:
storage.datasets.<name>.autoSnapshot
zfs-auto-snapshot policy for this dataset.
Type: submodule
Default:
{ }Declared by:
storage.datasets.<name>.autoSnapshot.enable
Whether zfs-auto-snapshot includes this dataset.
Type: null or boolean or string
Default:
nullDeclared by:
storage.datasets.<name>.autoSnapshot.daily
Daily zfs-auto-snapshot policy.
Type: null or boolean or string
Default:
nullDeclared by:
storage.datasets.<name>.autoSnapshot.frequent
Frequent zfs-auto-snapshot policy.
Type: null or boolean or string
Default:
nullDeclared by:
storage.datasets.<name>.autoSnapshot.hourly
Hourly zfs-auto-snapshot policy.
Type: null or boolean or string
Default:
nullDeclared by:
storage.datasets.<name>.autoSnapshot.monthly
Monthly zfs-auto-snapshot policy.
Type: null or boolean or string
Default:
nullDeclared by:
storage.datasets.<name>.autoSnapshot.weekly
Weekly zfs-auto-snapshot policy.
Type: null or boolean or string
Default:
nullDeclared by:
storage.datasets.<name>.children
Child datasets.
Type: lazy attribute set of (submodule)
Default:
{ }Declared by:
storage.datasets.<name>.group
Group that should own the dataset mountpoint.
Type: string
Default:
"pbovbel"Declared by:
storage.datasets.<name>.mode
Mode for the dataset mountpoint.
Type: string
Default:
"0755"Declared by:
storage.datasets.<name>.options
Raw ZFS dataset options.
Type: attribute set of string
Default:
{ }Declared by:
storage.datasets.<name>.owner
User that should own the dataset mountpoint.
Type: string
Default:
"pbovbel"Declared by:
storage.datasets.<name>.path
Generated mount path for this dataset.
Type: string (read only)
Default:
"/storage/‹name›"Declared by:
storage.pool
ZFS pool backing shared host storage.
Type: string (read only)
Default:
"storage"Declared by: