From e3a33fdf03ae06685422a0e3b526c08b85570f6a Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Wed, 24 Sep 2025 11:42:12 +0800 Subject: [PATCH] fix: podman cross platform - binfmt --- hosts/12kingdoms-shoukei/hardware-configuration.nix | 4 ++++ hosts/idols-ai/hardware-configuration.nix | 4 ++++ hosts/idols-ruby/default.nix | 4 ++++ hosts/k8s/kubevirt-shoryu/hardware-configuration.nix | 5 ----- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/hosts/12kingdoms-shoukei/hardware-configuration.nix b/hosts/12kingdoms-shoukei/hardware-configuration.nix index 15b78834..a8ed6dc9 100644 --- a/hosts/12kingdoms-shoukei/hardware-configuration.nix +++ b/hosts/12kingdoms-shoukei/hardware-configuration.nix @@ -28,6 +28,10 @@ in "x86_64-linux" "riscv64-linux" ]; + # This enables the kernel to preload the emulator binaries when the binfmt registrations are added, + # obviating the need to make the emulator binaries available inside chroots and chroot-like sandboxes. + boot.binfmt.preferStaticEmulators = true; # required to work with podman + # supported file systems, so we can mount any removable disks with these filesystems boot.supportedFilesystems = lib.mkForce [ "ext4" diff --git a/hosts/idols-ai/hardware-configuration.nix b/hosts/idols-ai/hardware-configuration.nix index 948a48b2..051db43e 100644 --- a/hosts/idols-ai/hardware-configuration.nix +++ b/hosts/idols-ai/hardware-configuration.nix @@ -43,6 +43,10 @@ "aarch64-linux" "riscv64-linux" ]; + # This enables the kernel to preload the emulator binaries when the binfmt registrations are added, + # obviating the need to make the emulator binaries available inside chroots and chroot-like sandboxes. + boot.binfmt.preferStaticEmulators = true; # required to work with podman + # supported file systems, so we can mount any removable disks with these filesystems boot.supportedFilesystems = [ "ext4" diff --git a/hosts/idols-ruby/default.nix b/hosts/idols-ruby/default.nix index 17ada8a6..1721285d 100644 --- a/hosts/idols-ruby/default.nix +++ b/hosts/idols-ruby/default.nix @@ -22,6 +22,10 @@ in { "aarch64-linux" "riscv64-linux" ]; + # This enables the kernel to preload the emulator binaries when the binfmt registrations are added, + # obviating the need to make the emulator binaries available inside chroots and chroot-like sandboxes. + boot.binfmt.preferStaticEmulators = true; # required to work with podman + # supported file systems, so we can mount any removable disks with these filesystems boot.supportedFilesystems = [ "ext4" diff --git a/hosts/k8s/kubevirt-shoryu/hardware-configuration.nix b/hosts/k8s/kubevirt-shoryu/hardware-configuration.nix index 1db440cd..d69566d0 100644 --- a/hosts/k8s/kubevirt-shoryu/hardware-configuration.nix +++ b/hosts/k8s/kubevirt-shoryu/hardware-configuration.nix @@ -33,11 +33,6 @@ ]; boot.extraModprobeConfig = "options kvm_amd nested=1"; # for amd cpu - # Enable binfmt emulation of aarch64-linux, this is required for cross compilation. - boot.binfmt.emulatedSystems = [ - "aarch64-linux" - "riscv64-linux" - ]; # supported file systems, so we can mount any removable disks with these filesystems boot.supportedFilesystems = [ "ext4"