From f7445ae7398387df587c96a4406c753bed60283c Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 25 Dec 2022 21:15:32 +0100 Subject: [PATCH] module: define only if devices are given --- module.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/module.nix b/module.nix index 40b7490..b216132 100644 --- a/module.nix +++ b/module.nix @@ -5,7 +5,8 @@ let in { options.disko = { devices = lib.mkOption { - type = types.devices; + type = lib.types.nullOr types.devices; + default = null; }; enableConfig = lib.mkOption { description = '' @@ -17,7 +18,7 @@ in { default = true; }; }; - config = { + config = lib.mkIf (cfg.devices != null) { system.build.formatScript = pkgs.writers.writeDash "disko-create" '' export PATH=${lib.makeBinPath (types.diskoLib.packages cfg.devices pkgs)}:$PATH ${types.diskoLib.create cfg.devices}