diff options
| author | Alejandro Soto <alejandro@34project.org> | 2022-08-08 04:30:53 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2022-08-08 04:30:53 -0600 |
| commit | f74c0f26e887467f1edd3bda5f03da3786180eb3 (patch) | |
| tree | 3c08da31ce090660bdf1251cba574f576e8d05f9 /sys/fs/layout.nix | |
| parent | 45d3adf99b4fce0e850813579a47866b3ff835aa (diff) | |
sys/fs: add single layout assertion
Diffstat (limited to '')
| -rw-r--r-- | sys/fs/layout.nix | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/fs/layout.nix b/sys/fs/layout.nix index 999492d..897cffe 100644 --- a/sys/fs/layout.nix +++ b/sys/fs/layout.nix @@ -73,5 +73,12 @@ in { layoutOpts = [ layout.sysHddBtrfs ]; valid = filter ({ snd, ... }: snd != null) (zipLists layoutMaps layoutOpts); in optionalAttrs (valid != []) ((head valid).fst (head valid).snd); + + assertions = [ + { + assertion = length (filter (layout: layout != null) (attrValues cfg.fs.layout)) <= 1; + message = "Cannot enable more than one filesystem layout"; + } + ]; }; } |
