2023-01-27 00:08:51 +00:00
|
|
|
{ device, subvolumes ? [ ] }:
|
|
|
|
|
2023-03-04 00:49:00 +00:00
|
|
|
{ lib, ... }:
|
|
|
|
|
2023-01-27 00:08:51 +00:00
|
|
|
{
|
2023-03-11 04:26:21 +00:00
|
|
|
fileSystems = (builtins.foldl'
|
2023-01-27 00:08:51 +00:00
|
|
|
(acc: subvol:
|
|
|
|
let
|
|
|
|
length = builtins.stringLength subvol;
|
|
|
|
dirName = builtins.substring 1 length subvol;
|
|
|
|
in
|
|
|
|
acc // {
|
|
|
|
"/storage/${dirName}" = {
|
|
|
|
inherit device;
|
|
|
|
fsType = "btrfs";
|
|
|
|
options = [ "defaults" "compress=zstd" "rw" "subvol=${subvol}" ];
|
|
|
|
};
|
|
|
|
})
|
|
|
|
{ }
|
2023-03-04 00:49:00 +00:00
|
|
|
subvolumes);
|
2023-01-27 00:08:51 +00:00
|
|
|
}
|