Commit 6c01e46

HPCesia <me@hpcesia.com>
2026-06-23 15:27:27
Add binfmt for aarch64 compile
1 parent 4e96e62
Changed files (2)
modules
develop
roles
modules/develop/binfmt.nix
@@ -0,0 +1,21 @@
+{
+  den,
+  lib,
+  ...
+}: {
+  den.aspects.develop.binfmt = {
+    nixos = {
+      host,
+      config,
+      ...
+    }: let
+      currentHostSystem = host.system;
+      allHostSystems = lib.filter (sys: lib.hasSuffix "linux" sys) (lib.attrNames den.hosts);
+      emulatedSystems = lib.filter (sys: sys != currentHostSystem) allHostSystems;
+
+      notVM = config.hardware.facter.report.virtualisation == "none";
+    in {
+      boot.binfmt.emulatedSystems = lib.optionals notVM emulatedSystems;
+    };
+  };
+}
modules/roles/develop.nix
@@ -1,6 +1,7 @@
 {den, ...}: {
   den.aspects.roles.develop = {
     includes = with den.aspects; [
+      develop.binfmt
       develop.direnv
     ];
   };