mirror of
https://github.com/nix-community/disko.git
synced 2024-09-11 06:25:33 +03:00
types: meta.dependencies -> meta.deviceDependencies
This commit is contained in:
parent
8666475b74
commit
89cc8978eb
16
types.nix
16
types.nix
@ -81,15 +81,15 @@ rec {
|
||||
};
|
||||
in valueType;
|
||||
|
||||
/* Given a attrset of dependencies and a devices attrset
|
||||
returns a sorted list by dependencies. aborts if a loop is found
|
||||
/* Given a attrset of deviceDependencies and a devices attrset
|
||||
returns a sorted list by deviceDependencies. aborts if a loop is found
|
||||
|
||||
sortDevicesByDependencies :: AttrSet -> AttrSet -> [ [ str str ] ]
|
||||
*/
|
||||
sortDevicesByDependencies = dependencies: devices:
|
||||
sortDevicesByDependencies = deviceDependencies: devices:
|
||||
let
|
||||
dependsOn = a: b:
|
||||
elem a (attrByPath b [] dependencies);
|
||||
elem a (attrByPath b [] deviceDependencies);
|
||||
maybeSortedDevices = toposort dependsOn (diskoLib.deviceList devices);
|
||||
in
|
||||
if (hasAttr "cycle" maybeSortedDevices) then
|
||||
@ -182,7 +182,7 @@ rec {
|
||||
config.devices.mdadm
|
||||
config.devices.zpool
|
||||
])) // {
|
||||
sortedDeviceList = diskoLib.sortDevicesByDependencies config.meta.dependencies config.devices;
|
||||
sortedDeviceList = diskoLib.sortDevicesByDependencies config.meta.deviceDependencies config.devices;
|
||||
};
|
||||
};
|
||||
create = mkOption {
|
||||
@ -514,7 +514,7 @@ rec {
|
||||
readOnly = true;
|
||||
type = types.functionTo diskoLib.jsonType;
|
||||
default = dev: {
|
||||
dependencies.lvm_vg.${config.vg} = [ dev ];
|
||||
deviceDependencies.lvm_vg.${config.vg} = [ dev ];
|
||||
};
|
||||
};
|
||||
_create = mkOption {
|
||||
@ -673,7 +673,7 @@ rec {
|
||||
readOnly = true;
|
||||
type = types.functionTo diskoLib.jsonType;
|
||||
default = dev: {
|
||||
dependencies.zpool.${config.pool} = [ dev ];
|
||||
deviceDependencies.zpool.${config.pool} = [ dev ];
|
||||
};
|
||||
};
|
||||
_create = mkOption {
|
||||
@ -957,7 +957,7 @@ rec {
|
||||
readOnly = true;
|
||||
type = types.functionTo diskoLib.jsonType;
|
||||
default = dev: {
|
||||
dependencies.mdadm.${config.name} = [ dev ];
|
||||
deviceDependencies.mdadm.${config.name} = [ dev ];
|
||||
};
|
||||
};
|
||||
_create = mkOption {
|
||||
|
Loading…
Reference in New Issue
Block a user