From 0d93baa00d751e110bf35507be1d74fbdb843e1a Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sat, 18 Mar 2023 16:17:13 -0300 Subject: etc/guix/system.scm: Better handling of binfmt architectures To allow the same `systems.scm` configuration file to be used in hardwares of different architectures and prevent registering in binfmt the architecture of the bare metal machine, dynamically filter out the current architecture of the declared `desired-architectures`. --- etc/guix/system.scm | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/etc/guix/system.scm b/etc/guix/system.scm index 14d215f..3136b62 100644 --- a/etc/guix/system.scm +++ b/etc/guix/system.scm @@ -90,6 +90,23 @@ Seiko Epson Color Ink Jet Printers.") license:lgpl2.1)))) +(define current-architecture + (car + (string-split %host-type + #\-))) + +(define desired-architectures + '("i386" + "x86_64" + "arm" + "aarch64")) + +(define platforms + (filter (lambda (name) + (not (equal? name current-architecture))) + desired-architectures)) + + (operating-system (kernel ng.linux:linux) (initrd ng.initrd:microcode-initrd) @@ -173,7 +190,7 @@ Seiko Epson Color Ink Jet Printers.") (service qemu-binfmt-service-type (qemu-binfmt-configuration (platforms - (lookup-qemu-platforms "arm" "aarch64")))) + (apply lookup-qemu-platforms platforms)))) (service cups-service-type (cups-configuration (web-interface? #t) -- cgit v1.2.3