From 72624394013bb4b284dd5c3ad3441625f71b49c6 Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 19 Jul 2018 21:52:11 +0200 Subject: add top-level layout type --- lib/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib') 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} -- cgit v1.2.3