feat: add package settings
This commit is contained in:
parent
9fb80e319d
commit
1f7ae040bc
2 changed files with 17 additions and 32 deletions
|
|
@ -60,41 +60,14 @@ in
|
|||
options = global.config.packages.context.options;
|
||||
};
|
||||
|
||||
settings = lib.types.submodule {
|
||||
options = global.config.packages.settings.options;
|
||||
};
|
||||
|
||||
platform =
|
||||
lib.types.coerce lib.types.string lib.systems.withBuildInfo
|
||||
lib.systems.types.platformWithBuildInfo;
|
||||
|
||||
# builder = lib.types.submodules.portable {
|
||||
# name = "Builder";
|
||||
# module = (
|
||||
# { config, name ? "builder" }:
|
||||
# {
|
||||
# freeform = lib.types.any;
|
||||
#
|
||||
# options = {
|
||||
# name = lib.options.create {
|
||||
# description = "The name of the builder.";
|
||||
# type = lib.types.string;
|
||||
# default = lib.attrs.when (name != "builder") {
|
||||
# value = name;
|
||||
# };
|
||||
# writable = false;
|
||||
# };
|
||||
#
|
||||
# build = lib.options.create {
|
||||
# description = "The build function which takes a package definition and creates a derivation.";
|
||||
# type = lib.types.function lib.types.artifact;
|
||||
# };
|
||||
#
|
||||
# settings = lib.options.create {
|
||||
# description = "The settings for the builder.";
|
||||
# type = lib.types.submodule ({ config }: {});
|
||||
# default.value = { };
|
||||
# };
|
||||
# };
|
||||
# }
|
||||
# );
|
||||
# };
|
||||
builder =
|
||||
let
|
||||
normalize =
|
||||
|
|
@ -851,8 +824,14 @@ in
|
|||
|
||||
context = lib.options.create {
|
||||
description = "The context information that the package provides.";
|
||||
default.value = { };
|
||||
type = lib.types.context;
|
||||
default.value = { };
|
||||
};
|
||||
|
||||
settings = lib.options.create {
|
||||
description = "The settings for the package.";
|
||||
type = lib.types.settings;
|
||||
default.value = { };
|
||||
};
|
||||
|
||||
hooks = lib.options.create {
|
||||
|
|
|
|||
|
|
@ -24,6 +24,12 @@ in
|
|||
default.value = { };
|
||||
type = lib.types.attrs.of lib.types.option;
|
||||
};
|
||||
|
||||
settings.options = lib.options.create {
|
||||
description = "The available settings for packages.";
|
||||
default.value = { };
|
||||
type = lib.types.attrs.of lib.types.option;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue