disko: fix eval when no disko is configured

This commit is contained in:
Sandro - 2023-05-19 03:23:02 +02:00
parent b7fe690365
commit adca4a2674
Signed by: sandro
GPG Key ID: 3AF5A43A3EECC2E5
1 changed files with 5 additions and 5 deletions

View File

@ -6,7 +6,7 @@ in
{
options.disko.disks = lib.mkOption {
description = lib.mdDoc "Disk names to format.";
type = with lib.types; nullOr (listOf (submodule (_: {
type = with lib.types; listOf (submodule (_: {
options = {
device = lib.mkOption {
type = lib.types.str;
@ -46,8 +46,8 @@ in
description = "Wether to include a zfs parition.";
};
};
})));
default = null;
}));
default = [ ];
};
config = {
@ -62,10 +62,10 @@ in
message = "Ceph requires Luks!";
}
])
(lib.attrNames cfg.disks);
cfg.disks;
disko = {
devices = lib.mkIf (cfg.disks != null) (lib.head (map
devices = lib.mkIf (cfg.disks != [ ]) (lib.head (map
(disk:
let
diskName = if disk.name != "" then "-${disk.name}" else "";