[PATCH 1/3] host/rootfs: get rid of pkgsGui
The original purpose of pkgsGui was to have a dynamically linked package set that used libudev-zero. Now we don't use libudev-zero on the host, so it's no longer necessary. The one remaining override can be moved into the overlay until it's upstreamed[1]. Link: https://gitlab.freedesktop.org/accountsservice/accountsservice/-/merge_reque... [1] Signed-off-by: Alyssa Ross <hi@alyssa.is> --- host/rootfs/default.nix | 31 +++++++++++-------------------- pkgs/overlay.nix | 6 ++++++ 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/host/rootfs/default.nix b/host/rootfs/default.nix index f7974a4..2af6cbe 100644 --- a/host/rootfs/default.nix +++ b/host/rootfs/default.nix @@ -18,19 +18,10 @@ pkgsStatic.callPackage ( let inherit (nixosAllHardware.config.hardware) firmware; inherit (lib) - concatMapStringsSep concatStrings escapeShellArgs fileset optionalAttrs - mapAttrsToList systems trivial; + concatMapStringsSep concatStrings escapeShellArgs fileset mapAttrsToList + trivial; - pkgsGui = pkgsMusl.extend ( - _: super: - (optionalAttrs (systems.equals pkgsMusl.stdenv.hostPlatform super.stdenv.hostPlatform) { - flatpak = super.flatpak.override { - withMalcontent = false; - }; - }) - ); - - foot = pkgsGui.foot.override { allowPgo = false; }; + foot = pkgsMusl.foot.override { allowPgo = false; }; packages = [ cloud-hypervisor cryptsetup dbus execline inotify-tools iproute2 @@ -42,8 +33,8 @@ let extraConfig = builtins.readFile ./busybox-config; }) - # Take kmod from pkgsGui since we use pkgsGui.kmod.lib below anyway. - ] ++ (with pkgsGui; [ cosmic-files crosvm foot fuse3 kmod systemd ]); + # Take kmod from pkgsMusl since we use pkgsMusl.kmod.lib below anyway. + ] ++ (with pkgsMusl; [ cosmic-files crosvm foot fuse3 kmod systemd ]); nixosAllHardware = nixos ({ modulesPath, ... }: { imports = [ (modulesPath + "/profiles/all-hardware.nix") ]; @@ -64,7 +55,7 @@ let # https://inbox.vuxu.org/musl/20251017-dlopen-use-rpath-of-caller-dso-v1-1-46c... usrPackages = [ appvm kernel.modules firmware netvm - ] ++ (with pkgsGui; [ dejavu_fonts kmod.lib mesa westonLite ]); + ] ++ (with pkgsMusl; [ dejavu_fonts kmod.lib mesa westonLite ]); appvms = { appvm-firefox = callSpectrumPackage ../../vm/app/firefox.nix {}; @@ -88,16 +79,16 @@ let # Weston doesn't support SVG icons. inkscape -w 20 -h 20 \ -o $out/usr/share/icons/hicolor/20x20/apps/com.system76.CosmicFiles.png \ - ${pkgsGui.cosmic-files}/share/icons/hicolor/24x24/apps/com.system76.CosmicFiles.svg + ${pkgsMusl.cosmic-files}/share/icons/hicolor/24x24/apps/com.system76.CosmicFiles.svg ln -st $out/usr/bin \ ${concatMapStringsSep " " (p: "${p}/bin/*") packages} \ - ${pkgsGui.xdg-desktop-portal}/libexec/xdg-document-portal \ - ${pkgsGui.xdg-desktop-portal-gtk}/libexec/xdg-desktop-portal-gtk + ${pkgsMusl.xdg-desktop-portal}/libexec/xdg-document-portal \ + ${pkgsMusl.xdg-desktop-portal-gtk}/libexec/xdg-desktop-portal-gtk ln -st $out/usr/share/dbus-1 \ ${dbus}/share/dbus-1/session.conf ln -st $out/usr/share/dbus-1/services \ - ${pkgsGui.xdg-desktop-portal-gtk}/share/dbus-1/services/org.freedesktop.impl.portal.desktop.gtk.service + ${pkgsMusl.xdg-desktop-portal-gtk}/share/dbus-1/services/org.freedesktop.impl.portal.desktop.gtk.service ${concatStrings (mapAttrsToList (name: path: '' ln -s ${path} $out/usr/lib/spectrum/vm/${name} @@ -138,7 +129,7 @@ stdenvNoCC.mkDerivation { dontFixup = true; passthru = { - inherit appvm firmware kernel nixosAllHardware packagesSysroot pkgsGui; + inherit appvm firmware kernel nixosAllHardware packagesSysroot; }; meta = with lib; { diff --git a/pkgs/overlay.nix b/pkgs/overlay.nix index 0ca196c..fdddae0 100644 --- a/pkgs/overlay.nix +++ b/pkgs/overlay.nix @@ -4,5 +4,11 @@ (final: super: { cloud-hypervisor = import ./cloud-hypervisor { inherit final super; }; + flatpak = super.flatpak.override ( + final.lib.optionalAttrs final.stdenv.hostPlatform.isMusl { + withMalcontent = false; + } + ); + skawarePackages = import ./skaware-packages { inherit final super; }; }) base-commit: c43e5c63a028994d5f66a15db19f415bf3cb7736 -- 2.51.0
Will allow us to get Spectrum packages inside pkgsMusl.callPackage, like we currently do with pkgsStatic. Signed-off-by: Alyssa Ross <hi@alyssa.is> --- pkgs/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/default.nix b/pkgs/default.nix index cc60228..0d159c9 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -56,6 +56,7 @@ let # the CLI easily. inherit (pkgs) cloud-hypervisor dbus; + pkgsMusl = makeScopeWithSplicing pkgs.pkgsMusl; pkgsStatic = makeScopeWithSplicing pkgs.pkgsStatic; srcWithNix = fileset.difference -- 2.51.0
For as long as we're running mesa on the host, we'll need dynamic linking, so let's at least stick to a single package set. Since we're longer cross compiling, I've switched to taking inkscape and xorg from the default package set. They're only used for building, not installed in the image, so let's avoid having to build their large musl closures. Signed-off-by: Alyssa Ross <hi@alyssa.is> --- host/rootfs/default.nix | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/host/rootfs/default.nix b/host/rootfs/default.nix index 2af6cbe..50e03a3 100644 --- a/host/rootfs/default.nix +++ b/host/rootfs/default.nix @@ -4,15 +4,17 @@ import ../../lib/call-package.nix ( { callSpectrumPackage, spectrum-build-tools, src -, pkgsMusl, pkgsStatic, linux_latest +, pkgsMusl, linux_latest, inkscape, xorg }: -pkgsStatic.callPackage ( +pkgsMusl.callPackage ( { spectrum-host-tools , lib, stdenvNoCC, nixos, runCommand, writeClosure, erofs-utils, s6-rc -, busybox, cloud-hypervisor, cryptsetup, dbus, execline, inkscape -, iproute2, inotify-tools, jq, mdevd, s6, s6-linux-init, socat -, util-linuxMinimal, virtiofsd, xorg, xdg-desktop-portal-spectrum-host +, busybox, cloud-hypervisor, cosmic-files, crosvm, cryptsetup +, dejavu_fonts, dbus, execline, foot, fuse3, iproute2, inotify-tools +, jq, kmod, mdevd, mesa, s6, s6-linux-init, socat, systemd +, util-linuxMinimal, virtiofsd, westonLite, xdg-desktop-portal +, xdg-desktop-portal-gtk, xdg-desktop-portal-spectrum-host }: let @@ -21,20 +23,19 @@ let concatMapStringsSep concatStrings escapeShellArgs fileset mapAttrsToList trivial; - foot = pkgsMusl.foot.override { allowPgo = false; }; - packages = [ - cloud-hypervisor cryptsetup dbus execline inotify-tools iproute2 - jq mdevd s6 s6-linux-init s6-rc socat spectrum-host-tools - util-linuxMinimal virtiofsd xdg-desktop-portal-spectrum-host + cloud-hypervisor cosmic-files crosvm cryptsetup dbus execline + fuse3 inotify-tools iproute2 jq kmod mdevd s6 s6-linux-init s6-rc + socat spectrum-host-tools systemd util-linuxMinimal virtiofsd + xdg-desktop-portal-spectrum-host + + (foot.override { allowPgo = false; }) (busybox.override { # Use a separate file as it is a bit too big. extraConfig = builtins.readFile ./busybox-config; }) - - # Take kmod from pkgsMusl since we use pkgsMusl.kmod.lib below anyway. - ] ++ (with pkgsMusl; [ cosmic-files crosvm foot fuse3 kmod systemd ]); + ]; nixosAllHardware = nixos ({ modulesPath, ... }: { imports = [ (modulesPath + "/profiles/all-hardware.nix") ]; @@ -54,8 +55,9 @@ let # It doesn't get picked up from libsystemd-shared.so's RUNPATH due to # https://inbox.vuxu.org/musl/20251017-dlopen-use-rpath-of-caller-dso-v1-1-46c... usrPackages = [ - appvm kernel.modules firmware netvm - ] ++ (with pkgsMusl; [ dejavu_fonts kmod.lib mesa westonLite ]); + appvm dejavu_fonts kmod.lib mesa westonLite kernel.modules + firmware netvm + ]; appvms = { appvm-firefox = callSpectrumPackage ../../vm/app/firefox.nix {}; @@ -79,16 +81,16 @@ let # Weston doesn't support SVG icons. inkscape -w 20 -h 20 \ -o $out/usr/share/icons/hicolor/20x20/apps/com.system76.CosmicFiles.png \ - ${pkgsMusl.cosmic-files}/share/icons/hicolor/24x24/apps/com.system76.CosmicFiles.svg + ${cosmic-files}/share/icons/hicolor/24x24/apps/com.system76.CosmicFiles.svg ln -st $out/usr/bin \ ${concatMapStringsSep " " (p: "${p}/bin/*") packages} \ - ${pkgsMusl.xdg-desktop-portal}/libexec/xdg-document-portal \ - ${pkgsMusl.xdg-desktop-portal-gtk}/libexec/xdg-desktop-portal-gtk + ${xdg-desktop-portal}/libexec/xdg-document-portal \ + ${xdg-desktop-portal-gtk}/libexec/xdg-desktop-portal-gtk ln -st $out/usr/share/dbus-1 \ ${dbus}/share/dbus-1/session.conf ln -st $out/usr/share/dbus-1/services \ - ${pkgsMusl.xdg-desktop-portal-gtk}/share/dbus-1/services/org.freedesktop.impl.portal.desktop.gtk.service + ${xdg-desktop-portal-gtk}/share/dbus-1/services/org.freedesktop.impl.portal.desktop.gtk.service ${concatStrings (mapAttrsToList (name: path: '' ln -s ${path} $out/usr/lib/spectrum/vm/${name} -- 2.51.0
This patch has been committed as d1621f414315657499a472d74236719a8ce98b9b, which can be viewed online at https://spectrum-os.org/git/spectrum/commit/?id=d1621f414315657499a472d74236.... This is an automated message. Send comments/questions/requests to: Alyssa Ross <hi@alyssa.is>
This patch has been committed as 009a56e76ca08c6e4189f428dd4c520d027ad064, which can be viewed online at https://spectrum-os.org/git/spectrum/commit/?id=009a56e76ca08c6e4189f428dd4c.... This is an automated message. Send comments/questions/requests to: Alyssa Ross <hi@alyssa.is>
participants (2)
-
Alyssa Ross -
Alyssa Ross