aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2018-07-19 21:52:11 +0200
committerlassulus <lassulus@lassul.us>2018-07-19 21:52:11 +0200
commit72624394013bb4b284dd5c3ad3441625f71b49c6 (patch)
tree56f7cff525c31755ab4598727c65df95e26be511 /lib
parent6232ab30786768118fe130d80fc980cec48b08e7 (diff)
add top-level layout type
Diffstat (limited to 'lib')
-rw-r--r--lib/default.nix7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/default.nix b/lib/default.nix
index 2075b27..bc3aac7 100644
--- a/lib/default.nix
+++ b/lib/default.nix
@@ -12,6 +12,9 @@ let
};
};
+ config.layout = q: x:
+ foldl' mergeAttrs {} (mapAttrsToList (name: config-f { device = name; }) x.content);
+
config.lv = q: x:
config-f { device = "/dev/${q.vgname}/${q.name}"; } x.content;
@@ -35,6 +38,10 @@ let
mkfs.${x.format} ${q.device}
'';
+ format.layout = q: x: ''
+ ${concatStrings (mapAttrsToList (name: format-f { device = name; }) x.content)}
+ '';
+
format.lv = q: x: ''
lvcreate -L ${x.size} -n ${q.name} ${q.vgname}
${format-f { device = "/dev/${q.vgname}/${q.name}"; } x.content}