This is needed to prevent two layers of emulation when offering a build for a host running binfmt such as an x86 host trying to compile for aarch64 via binfmt
This is especially useful when trying to build images for embedded systems such as the pi, which have a vendor kernel that can't be booted as part of the disko image builder process
fixes an error when using this minimal configuration:
```nix
let
pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-23.11") { };
disko = fetchTarball "https://github.com/nix-community/disko/tarball/master";
in
pkgs.nixos {
imports = [
"${disko}/module.nix"
"${disko}/example/hybrid.nix"
];
}
```
when running:
```console
$ nix-build
...
error: 'default' at /nix/store/y981rwszq9yi36rvvz2vrr6hb22si0hc-source/lib/default.nix:391:23 called with unexpected argument 'system'
```
I do build my workstation with `documentation.nixos.includeAllModules`
to also have private modules and external stuff in my local options'
reference.
Not sure why exactly this breaks with
error: attribute 'loader' missing
at /nix/store/h6qicay9fgggx9nf6apdl6zkdpdp28xx-source/module.nix:46:19:
45| type = lib.types.bool;
46| default = config.boot.loader.systemd-boot.enable || config.boot.loader.grub.efiSupport;
| ^
47| };
but using defaultText is the usual fix that also works here.
As discussed in [this
comment](https://github.com/nix-community/disko/pull/143#discussion_r1097912402),
as a blanket rule converting everything possible to `inherit` like
statements can hurt readability.
Add config file for statix to disable these checks and fixes, then rerun
the autofix with these options.
Apply standard formatting and some statix conventions using;
```sh
nixpkgs-fmt **.nix && statix fix .
```
With the intent of making contribution a bit easier and reducing mental
load in hand formatting (in the same vein as [black]).
[black]: https://github.com/psf/black#the-uncompromising-code-formatter