2022-10-24 14:30:19 +02:00
|
|
|
{ lib, ... }: {
|
2023-04-17 20:00:07 +02: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 14:30:19 +02:00
|
|
|
config = {
|
|
|
|
_module.freeformType = lib.types.anything;
|
|
|
|
ok =
|
|
|
|
lib.evalModules {
|
2023-04-17 19:48:53 +02:00
|
|
|
class = "nixos";
|
2022-10-24 14:30:19 +02:00
|
|
|
modules = [
|
|
|
|
./module-class-is-nixos.nix
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
fail =
|
|
|
|
lib.evalModules {
|
2023-04-17 19:48:53 +02:00
|
|
|
class = "nixos";
|
2022-10-24 14:30:19 +02:00
|
|
|
modules = [
|
|
|
|
./module-class-is-nixos.nix
|
|
|
|
./module-class-is-darwin.nix
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
fail-anon =
|
|
|
|
lib.evalModules {
|
2023-04-17 19:48:53 +02:00
|
|
|
class = "nixos";
|
2022-10-24 14:30:19 +02:00
|
|
|
modules = [
|
|
|
|
./module-class-is-nixos.nix
|
|
|
|
{ _file = "foo.nix#darwinModules.default";
|
2023-04-17 20:14:07 +02:00
|
|
|
_class = "darwin";
|
2023-04-10 17:26:25 +02:00
|
|
|
config = {};
|
2022-10-24 14:30:19 +02:00
|
|
|
imports = [];
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2023-04-17 20:14:07 +02:00
|
|
|
sub.nixosOk = { _class = "nixos"; };
|
2023-04-17 20:00:07 +02:00
|
|
|
sub.nixosFail = { imports = [ ./module-class-is-darwin.nix ]; };
|
2022-10-24 14:30:19 +02:00
|
|
|
};
|
|
|
|
}
|