summaryrefslogtreecommitdiff
path: root/sys/fs
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2022-08-08 04:30:53 -0600
committerAlejandro Soto <alejandro@34project.org>2022-08-08 04:30:53 -0600
commitf74c0f26e887467f1edd3bda5f03da3786180eb3 (patch)
tree3c08da31ce090660bdf1251cba574f576e8d05f9 /sys/fs
parent45d3adf99b4fce0e850813579a47866b3ff835aa (diff)
sys/fs: add single layout assertion
Diffstat (limited to '')
-rw-r--r--sys/fs/layout.nix7
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";
+ }
+ ];
};
}