mirror of
https://github.com/nix-community/nixos-generators.git
synced 2024-09-11 12:15:29 +03:00
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
34 lines
700 B
Nix
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
|