summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2022-11-10 09:36:31 +0100
committerlassulus <lassulus@lassul.us>2022-11-10 09:36:31 +0100
commit78d9448fcff61f666d2cdd03af9c8c80795f01f4 (patch)
tree5a430e09a8c1b6ae0d0902191168839e08cc6692
parentc6152351f876bda3db3cf07ac3541868114bdedf (diff)
types: make deviceDependencies optional
-rw-r--r--types.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/types.nix b/types.nix
index 2dd2151..ba7aa2f 100644
--- a/types.nix
+++ b/types.nix
@@ -130,7 +130,7 @@ rec {
create :: types.devices -> str
*/
create = devices: let
- sortedDeviceList = diskoLib.sortDevicesByDependencies (diskoLib.meta devices).deviceDependencies devices;
+ sortedDeviceList = diskoLib.sortDevicesByDependencies ((diskoLib.meta devices).deviceDependencies or {}) devices;
in ''
set -efux
${concatStrings (map (dev: attrByPath (dev ++ [ "_create" ]) "" devices) sortedDeviceList)}
@@ -141,7 +141,7 @@ rec {
*/
mount = devices: let
fsMounts = diskoLib.deepMergeMap (dev: dev._mount.fs or {}) (flatten (map attrValues (attrValues devices)));
- sortedDeviceList = diskoLib.sortDevicesByDependencies (diskoLib.meta devices).deviceDependencies devices;
+ sortedDeviceList = diskoLib.sortDevicesByDependencies ((diskoLib.meta devices).deviceDependencies or {}) devices;
in ''
set -efux
# first create the neccessary devices