This is to avoid stealing keys from submodules. `class` might be common enough that reinterpreting existing `class` attributes in configurations as a declaration leads to fairly widespread problems.
36 lines
724 B
Nix
36 lines
724 B
Nix
{ lib, ... }: {
|
|
config = {
|
|
_module.freeformType = lib.types.anything;
|
|
ok =
|
|
lib.evalModules {
|
|
specialArgs.class = "nixos";
|
|
modules = [
|
|
./module-class-is-nixos.nix
|
|
];
|
|
};
|
|
|
|
fail =
|
|
lib.evalModules {
|
|
specialArgs.class = "nixos";
|
|
modules = [
|
|
./module-class-is-nixos.nix
|
|
./module-class-is-darwin.nix
|
|
];
|
|
};
|
|
|
|
fail-anon =
|
|
lib.evalModules {
|
|
specialArgs.class = "nixos";
|
|
modules = [
|
|
./module-class-is-nixos.nix
|
|
{ _file = "foo.nix#darwinModules.default";
|
|
class = "darwin";
|
|
config = {};
|
|
imports = [];
|
|
}
|
|
];
|
|
};
|
|
|
|
};
|
|
}
|