aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2023-03-18 16:17:13 -0300
committerEuAndreh <eu@euandre.org>2023-03-18 16:19:28 -0300
commit0d93baa00d751e110bf35507be1d74fbdb843e1a (patch)
treee64e174f5fbcf018ed2b3caae71e0460160fe389 /etc
parentetc/ssh/config.tmpl: Proper placement of the "Include" directive (diff)
downloaddotfiles-0d93baa00d751e110bf35507be1d74fbdb843e1a.tar.gz
dotfiles-0d93baa00d751e110bf35507be1d74fbdb843e1a.tar.xz
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`.
Diffstat (limited to 'etc')
-rw-r--r--etc/guix/system.scm19
1 files changed, 18 insertions, 1 deletions
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)