mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-15 14:26:33 +01:00
fa9727cf1e
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.
33 lines
682 B
Nix
33 lines
682 B
Nix
{ lib, config, ... }: {
|
|
|
|
options = {
|
|
processedToplevel = lib.mkOption {
|
|
type = lib.types.raw;
|
|
};
|
|
unprocessedNesting = lib.mkOption {
|
|
type = lib.types.raw;
|
|
};
|
|
multiple = lib.mkOption {
|
|
type = lib.types.raw;
|
|
};
|
|
priorities = lib.mkOption {
|
|
type = lib.types.raw;
|
|
};
|
|
unprocessedNestingEvaluates = lib.mkOption {
|
|
default = builtins.tryEval config.unprocessedNesting;
|
|
};
|
|
};
|
|
|
|
config = {
|
|
processedToplevel = lib.mkIf true 10;
|
|
unprocessedNesting.foo = throw "foo";
|
|
multiple = lib.mkMerge [
|
|
"foo"
|
|
"foo"
|
|
];
|
|
priorities = lib.mkMerge [
|
|
"foo"
|
|
(lib.mkForce "bar")
|
|
];
|
|
};
|
|
}
|