mirror of
https://github.com/nix-community/disko
synced 2024-11-10 06:14:14 +00:00
module: define only if devices are given
This commit is contained in:
parent
e3527b826d
commit
f7445ae739
1 changed files with 3 additions and 2 deletions
|
@ -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}
|
||||
|
|
Loading…
Reference in a new issue