![Rebecca Turner](/assets/img/avatar_default.png)
Currently, the `lib/tests/modules.sh` test checks the output of `nix-instantiate --eval` without `--json`, which outputs an unspecified human-readable format. This patch modifies `modules.sh` to use the `--json` output instead, to be robust against future changes to `nix-instantiate` output.
28 lines
592 B
Nix
28 lines
592 B
Nix
{ lib, config, ... }: {
|
|
|
|
options.valueIsFunction = lib.mkOption {
|
|
default = lib.mapAttrs (name: lib.isFunction) config.value;
|
|
};
|
|
|
|
options.value = lib.mkOption {
|
|
type = lib.types.anything;
|
|
};
|
|
|
|
options.applied = lib.mkOption {
|
|
default = lib.mapAttrs (name: fun: fun null) config.value;
|
|
};
|
|
|
|
config = lib.mkMerge [
|
|
{
|
|
value.single-lambda = x: x;
|
|
value.multiple-lambdas = x: { inherit x; };
|
|
value.merging-lambdas = x: { inherit x; };
|
|
}
|
|
{
|
|
value.multiple-lambdas = x: [ x ];
|
|
value.merging-lambdas = y: { inherit y; };
|
|
}
|
|
];
|
|
|
|
}
|