nixpkgs/modules/generic/meta-maintainers/test.nix
Robert Hensing 0c156a7144 modules/generic/meta-maintainers: init
This factors out `meta.maintainers` from NixOS `misc/meta.nix` for use in arbitrary
Module System applications.

It is useful beyond NixOS and not coupled to it, although it is currently coupled to Nixpkgs'
`lib.maintainers`.
That restriction could be lifted optionally if there's future demand.
2025-08-06 14:58:50 +02:00

35 lines
680 B
Nix

# Run:
# $ nix-instantiate --eval 'modules/generic/meta-maintainers/test.nix'
#
# Expected output:
# { }
#
# Debugging:
# drop .test from the end of this file, then use nix repl on it
rec {
lib = import ../../../lib;
example = lib.evalModules {
modules = [
../meta-maintainers.nix
{
_file = "eelco.nix";
meta.maintainers = [ lib.maintainers.eelco ];
}
];
};
test =
assert
example.config.meta.maintainers == {
${toString ../meta-maintainers.nix} = [
lib.maintainers.pierron
lib.maintainers.roberth
];
"eelco.nix" = [ lib.maintainers.eelco ];
};
{ };
}
.test