main
1{
2 den,
3 lib,
4 ...
5}: {
6 den.aspects.develop.binfmt = {
7 nixos = {
8 host,
9 config,
10 ...
11 }: let
12 currentHostSystem = host.system;
13 allHostSystems = lib.filter (sys: lib.hasSuffix "linux" sys) (lib.attrNames den.hosts);
14 emulatedSystems = lib.filter (sys: sys != currentHostSystem) allHostSystems;
15
16 notVM = config.hardware.facter.report.virtualisation == "none";
17 in {
18 boot.binfmt.emulatedSystems = lib.optionals notVM emulatedSystems;
19 };
20 };
21}