disko: fix eval when no disko is configured
This commit is contained in:
parent
b7fe690365
commit
adca4a2674
|
@ -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 "";
|
||||
|
|
Loading…
Reference in New Issue