mirror of
https://github.com/hercules-ci/flake-parts.git
synced 2024-12-14 11:47:31 +00:00
flakeModules.partitions: Improve and fix docs
This commit is contained in:
parent
1e6fc322ad
commit
1728089f3e
2 changed files with 27 additions and 2 deletions
|
@ -15,7 +15,12 @@ let
|
|||
default = { };
|
||||
description = ''
|
||||
Location of a flake whose inputs to add to the inputs module argument in the partition.
|
||||
Note that flake `follows` are resolved without any awareness of inputs that are not in the flake.
|
||||
As a consequence, a `follows` entry in the flake inputs can not refer to inputs that are not in that specific flake.
|
||||
|
||||
Implementation note: if the type of `extraInputsFlake` is a path, it is loaded with an expression-based reimplementation of `builtins.getFlake`, as `getFlake` is incapable of loading paths in pure mode as of writing.
|
||||
'';
|
||||
example = lib.literalExpression "./dev";
|
||||
};
|
||||
extraInputs = mkOption {
|
||||
type = types.lazyAttrsOf types.raw;
|
||||
|
@ -51,8 +56,16 @@ let
|
|||
description = ''
|
||||
A re-evaluation of the flake-parts top level modules.
|
||||
|
||||
You may define config definitions, imports, etc here, and it can be read like any other submodule.
|
||||
You may define config definitions, `imports`, etc here, and it can be read like any other submodule.
|
||||
'';
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
imports = [
|
||||
./dev/flake-module.nix
|
||||
];
|
||||
}
|
||||
'';
|
||||
visible = "shallow";
|
||||
};
|
||||
};
|
||||
config = {
|
||||
|
@ -95,6 +108,11 @@ in
|
|||
|
||||
See the `partitions` options to understand the purpose.
|
||||
'';
|
||||
example = {
|
||||
"devShells" = "dev";
|
||||
"checks" = "dev";
|
||||
"herculesCI" = "dev";
|
||||
};
|
||||
};
|
||||
partitions = mkOption {
|
||||
type = types.attrsOf (types.submodule partitionModule);
|
||||
|
@ -116,6 +134,14 @@ in
|
|||
is cheap, it can only happen after fetching the input, which is not
|
||||
as cheap.
|
||||
'';
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
dev = {
|
||||
extraInputsFlake = ./dev;
|
||||
module = ./dev/flake-module.nix;
|
||||
};
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
config = {
|
||||
|
|
|
@ -58,7 +58,6 @@
|
|||
partitionedAttrs.devShells = "dev";
|
||||
partitionedAttrs.herculesCI = "dev";
|
||||
partitions.dev.extraInputsFlake = ./dev;
|
||||
partitions.dev.extraInputs.flake-parts = inputs.self;
|
||||
partitions.dev.module = {
|
||||
imports = [ ./dev/flake-module.nix ];
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue