nixos-generators/checks/test-all-formats.nix
DavHau f4a79d08d7 feat(all-formats.nix): add formatConfigs
While the `all-formats.nix` module allows to import all formats at once, it lacks an interface to customize formats or add formats.

This is fixed by adding the top-level option `formatConfigs` (attrsOf deferredModule).

All format modules created under `config.formatConfigs` are mapped so their outputs are available under `config.formats` which has also been moved to the top-level (previously `config.system.formats`).

Done:
- add option `formatConfigs`
- move option `system.formats` -> `formats`
- add test for customizing a format
2023-07-03 11:54:20 +03:00

34 lines
700 B
Nix

{
nixpkgs ? <nixpkgs>,
system ? builtins.currentSystem,
lib ? import (nixpkgs + /lib),
}: let
nixosSystem = import (nixpkgs + /nixos/lib/eval-config.nix);
conf = nixosSystem {
inherit system;
modules = [
../configuration.nix
../all-formats.nix
];
};
exclude =
(lib.optionalAttrs (system != "aarch64-linux") {
sd-aarch64 = true;
sd-aarch64-installer = true;
})
// (lib.optionalAttrs (system != "x86_64-linux") {
azure = true;
vagrant-virtualbox = true;
virtualbox = true;
vmware = true;
});
testedFormats =
lib.filterAttrs
(name: _: ! exclude ? ${name})
conf.config.formats;
in
testedFormats