lib/jsonschema: render defaults for submodule options
this relaxes the constraint that options of type `submodule` are always required, and will render benign default values.
This commit is contained in:
committed by
Valentin Gagarin
parent
9f7e9ca9df
commit
6a2e81373c
@@ -20,7 +20,7 @@
|
||||
default = false;
|
||||
description = "Is the user an admin?";
|
||||
};
|
||||
# a submodule option
|
||||
# a submodule option without default
|
||||
services = lib.mkOption {
|
||||
type = lib.types.submodule {
|
||||
options.opt = lib.mkOption {
|
||||
@@ -30,6 +30,17 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
# a submodule option with default
|
||||
programs = lib.mkOption {
|
||||
type = lib.types.submodule {
|
||||
options.opt = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "bar";
|
||||
description = "Another submodule option";
|
||||
};
|
||||
};
|
||||
default = { };
|
||||
};
|
||||
# attrs of int
|
||||
userIds = lib.mkOption {
|
||||
type = lib.types.attrsOf lib.types.int;
|
||||
|
||||
Reference in New Issue
Block a user