modules: add common
This should define modules that are identical, or very similar. The driving force is to be able to use `my.profiles` on home-manager and NixOS without repeating myself. In the future I might migrate other modules, such as `nixos/system/nix`...
This commit is contained in:
parent
66ec807dc6
commit
2ed60a227e
1 changed files with 24 additions and 0 deletions
24
modules/common/default.nix
Normal file
24
modules/common/default.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# Modules that are common to various module systems
|
||||
# Usually with very small differences, if any, between them.
|
||||
{ lib, _class, ... }:
|
||||
let
|
||||
allowedClass = [
|
||||
"darwin"
|
||||
"homeManager"
|
||||
"nixos"
|
||||
];
|
||||
|
||||
allowedClassString = lib.concatStringSep ", " (builtins.map lib.escapeNixString allowedClass);
|
||||
in
|
||||
{
|
||||
config = {
|
||||
assertions = [
|
||||
{
|
||||
assertion = builtins.elem _class allowedClass;
|
||||
message = ''
|
||||
`_class` specialArgs must be one of ${allowedClassString}.
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue