1
0
Fork 0
mirror of https://github.com/hercules-ci/flake-parts.git synced 2024-12-14 11:47:31 +00:00

Merge pull request #102 from hercules-ci/perInput-doc

perInput: Improve description
This commit is contained in:
Robert Hensing 2023-01-07 00:27:42 +01:00 committed by GitHub
commit aa1f6ca773
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -69,12 +69,26 @@ in
}; };
perInput = mkOption { perInput = mkOption {
description = "Function from system to function from flake to `system`-specific attributes."; description = ''
A function that pre-processes flake inputs.
It is called for users of `perSystem` such that `inputs'.''${name} = config.perInput system inputs.''${name}`.
This is used for [`inputs'`](../module-arguments.html#inputs) and [`self'`](../module-arguments.html#self).
The attributes returned by the `perInput` function definitions are merged into a single namespace (per input),
so each module should return an attribute set with usually only one or two predictable attribute names. Otherwise,
the `inputs'` namespace gets polluted.
'';
type = types.functionTo (types.functionTo (types.lazyAttrsOf types.unspecified)); type = types.functionTo (types.functionTo (types.lazyAttrsOf types.unspecified));
}; };
perSystem = mkOption { perSystem = mkOption {
description = "A function from system to flake-like attributes omitting the `<system>` attribute."; description = ''
A function from system to flake-like attributes omitting the `<system>` attribute.
Modules defined here have access to the suboptions and [some convenient module arguments](../module-arguments.html).
'';
type = mkPerSystemType ({ config, system, ... }: { type = mkPerSystemType ({ config, system, ... }: {
_file = ./perSystem.nix; _file = ./perSystem.nix;
config = { config = {