2022-10-24 12:30:19 +00:00
|
|
|
{ lib, ... }: {
|
2023-04-17 18:00:07 +00:00
|
|
|
options = {
|
|
|
|
sub = {
|
|
|
|
nixosOk = lib.mkOption {
|
|
|
|
type = lib.types.submoduleWith {
|
|
|
|
class = "nixos";
|
|
|
|
modules = [ ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
# Same but will have bad definition
|
|
|
|
nixosFail = lib.mkOption {
|
|
|
|
type = lib.types.submoduleWith {
|
|
|
|
class = "nixos";
|
|
|
|
modules = [ ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
mergeFail = lib.mkOption {
|
|
|
|
type = lib.types.submoduleWith {
|
|
|
|
class = "nixos";
|
|
|
|
modules = [ ];
|
|
|
|
};
|
|
|
|
default = { };
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
imports = [
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
sub = {
|
|
|
|
mergeFail = lib.mkOption {
|
|
|
|
type = lib.types.submoduleWith {
|
|
|
|
class = "darwin";
|
|
|
|
modules = [ ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
2022-10-24 12:30:19 +00:00
|
|
|
config = {
|
|
|
|
_module.freeformType = lib.types.anything;
|
|
|
|
ok =
|
|
|
|
lib.evalModules {
|
2023-04-17 17:48:53 +00:00
|
|
|
class = "nixos";
|
2022-10-24 12:30:19 +00:00
|
|
|
modules = [
|
|
|
|
./module-class-is-nixos.nix
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
fail =
|
|
|
|
lib.evalModules {
|
2023-04-17 17:48:53 +00:00
|
|
|
class = "nixos";
|
2022-10-24 12:30:19 +00:00
|
|
|
modules = [
|
|
|
|
./module-class-is-nixos.nix
|
|
|
|
./module-class-is-darwin.nix
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
fail-anon =
|
|
|
|
lib.evalModules {
|
2023-04-17 17:48:53 +00:00
|
|
|
class = "nixos";
|
2022-10-24 12:30:19 +00:00
|
|
|
modules = [
|
|
|
|
./module-class-is-nixos.nix
|
|
|
|
{ _file = "foo.nix#darwinModules.default";
|
2023-04-17 18:14:07 +00:00
|
|
|
_class = "darwin";
|
2023-04-10 15:26:25 +00:00
|
|
|
config = {};
|
2022-10-24 12:30:19 +00:00
|
|
|
imports = [];
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2023-04-17 18:14:07 +00:00
|
|
|
sub.nixosOk = { _class = "nixos"; };
|
2023-04-17 18:00:07 +00:00
|
|
|
sub.nixosFail = { imports = [ ./module-class-is-darwin.nix ]; };
|
2022-10-24 12:30:19 +00:00
|
|
|
};
|
|
|
|
}
|