lib: read types from subdir

This commit is contained in:
lassulus committed 2023-05-20 13:56:42 +02:00
1 parent 22b33a4fd6
commit 1c31612335
17 files changed
+10 -19

No files matched your search

+10 -19
View File
@@ -337,25 +337,16 @@ let
};
};
types = lib.mapAttrs (_: diskoLib.mkSubType) {
nodev = ./nodev.nix;
btrfs = ./btrfs.nix;
btrfs_subvol = ./btrfs_subvol.nix;
filesystem = ./filesystem.nix;
table = ./table.nix;
swap = ./swap.nix;
lvm_pv = ./lvm_pv.nix;
lvm_vg = ./lvm_vg.nix;
zfs = ./zfs.nix;
zpool = ./zpool.nix;
zfs_dataset = ./zfs_dataset.nix;
zfs_fs = ./zfs_fs.nix;
zfs_volume = ./zfs_volume.nix;
mdadm = ./mdadm.nix;
mdraid = ./mdraid.nix;
luks = ./luks.nix;
disk = ./disk.nix;
};
# import all tge types from the types directory
types = lib.listToAttrs (
map
(file: lib.nameValuePair
(lib.removeSuffix ".nix" file)
(diskoLib.mkSubType ./types/${file})
)
(lib.attrNames (builtins.readDir ./types))
);
};
in
diskoLib
File renamed without changes.
File renamed without changes.
View File
File renamed without changes.
File renamed without changes.
View File
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View File
File renamed without changes.
File renamed without changes.
View File
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.