summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-11-12 12:50:00 +0100
committerAlyssa Ross <hi@alyssa.is>2023-11-12 12:50:00 +0100
commit08ca71ccd37191b82ababada3f39d2b56940d114 (patch)
treea959993c4d6a9d341b058095c98069fde619adda
parent5e1c84a774a64c6747340f5a5584ec0d7706ee0d (diff)
downloadspectrum-08ca71ccd37191b82ababada3f39d2b56940d114.tar
spectrum-08ca71ccd37191b82ababada3f39d2b56940d114.tar.gz
spectrum-08ca71ccd37191b82ababada3f39d2b56940d114.tar.bz2
spectrum-08ca71ccd37191b82ababada3f39d2b56940d114.tar.lz
spectrum-08ca71ccd37191b82ababada3f39d2b56940d114.tar.xz
spectrum-08ca71ccd37191b82ababada3f39d2b56940d114.tar.zst
spectrum-08ca71ccd37191b82ababada3f39d2b56940d114.zip
host/rootfs: fix pkgsGui for cross compilation
When cross compiling, we don't need to disable systemd for packages
used at build time, and so would require way more overrides.  So only
apply the overlay for the runtime packages.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
-rw-r--r--host/rootfs/default.nix38
1 files changed, 21 insertions, 17 deletions
diff --git a/host/rootfs/default.nix b/host/rootfs/default.nix
index 1bff907..b76f0f6 100644
--- a/host/rootfs/default.nix
+++ b/host/rootfs/default.nix
@@ -21,32 +21,36 @@ pkgs.pkgsStatic.callPackage (
 }:
 
 let
-  inherit (lib) concatMapStringsSep;
+  inherit (lib) concatMapStringsSep optionalAttrs systems;
   inherit (nixosAllHardware.config.hardware) firmware;
 
   start-vm = import ../start-vm {
     config = config // { pkgs = pkgs.pkgsStatic; };
   };
 
-  pkgsGui = pkgs.pkgsMusl.extend (final: super: {
-    libgudev = super.libgudev.overrideAttrs ({ ... }: {
-      # Tests use umockdev, which is not compatible with libudev-zero.
-      doCheck = false;
-    });
+  pkgsGui = pkgs.pkgsMusl.extend (
+    final: super:
+    (optionalAttrs (systems.equals pkgs.pkgsMusl.stdenv.hostPlatform super.stdenv.hostPlatform) {
+      libgudev = super.libgudev.overrideAttrs ({ ... }: {
+        # Tests use umockdev, which is not compatible with libudev-zero.
+        doCheck = false;
+      });
 
-    systemd = final.libudev-zero;
-    systemdMinimal = final.libudev-zero;
+      systemd = final.libudev-zero;
+      systemdLibs = final.libudev-zero;
+      systemdMinimal = final.libudev-zero;
 
-    seatd = super.seatd.override {
-      systemdSupport = false;
-    };
+      seatd = super.seatd.override {
+        systemdSupport = false;
+      };
 
-    weston = super.weston.overrideAttrs ({ mesonFlags ? [], ... }: {
-      mesonFlags = mesonFlags ++ [
-        "-Dsystemd=false"
-      ];
-    });
-  });
+      weston = super.weston.overrideAttrs ({ mesonFlags ? [], ... }: {
+        mesonFlags = mesonFlags ++ [
+          "-Dsystemd=false"
+        ];
+      });
+    })
+  );
 
   foot = pkgsGui.foot.override { allowPgo = false; };