nix-config/modules/common/default.nix
Bruno BELANYI cea609adf6 common: add profiles
I will be migrating each sub-module one by one.
2025-07-07 14:47:31 +00:00

35 lines
786 B
Nix

# Modules that are common to various module systems
# Usually with very small differences, if any, between them.
{ lib, _class, ... }:
let
allowedClass = [
"darwin"
"home"
"nixos"
];
allowedClassString = lib.concatStringSep ", " (builtins.map lib.escapeNixString allowedClass);
in
{
imports = [
./profiles
];
config = {
assertions = [
{
assertion = type != null;
message = ''
You must provide `type` as part of specialArgs to use the common modules.
It must be one of ${allowedClassString}.
'';
}
{
assertion = type != null -> builtins.elem type allowedClass;
message = ''
`type` specialArgs must be one of ${allowedClassString}.
'';
}
];
};
}