From 6cbeccf51f563f3f7047d38178868619856ab1ac Mon Sep 17 00:00:00 2001 From: Colin Date: Mon, 6 Feb 2023 22:41:32 +0000 Subject: [PATCH] WIP: moby: partially working cross compilation for phosh w/o apps (webkitgtk build OOMs) --- hosts/by-name/moby/default.nix | 4 +- hosts/common/cross.nix | 182 ++++++++++++++++++++++++--------- 2 files changed, 138 insertions(+), 48 deletions(-) diff --git a/hosts/by-name/moby/default.nix b/hosts/by-name/moby/default.nix index 293fb627..7baf4a65 100644 --- a/hosts/by-name/moby/default.nix +++ b/hosts/by-name/moby/default.nix @@ -11,7 +11,7 @@ sane.services.wg-home.ip = config.sane.hosts.by-name."moby".wg-home.ip; # TODO: re-enable once base is cross-compiled - sane.programs.phoshApps.enableSuggested = false; + sane.programs.guiApps.enableSuggested = false; # cross-compiled documentation is *slow*. # no obvious way to natively compile docs (2022/09/29). @@ -46,7 +46,7 @@ sane.nixcache.enable = true; sane.persist.enable = true; - # sane.gui.phosh.enable = true; + sane.gui.phosh.enable = true; boot.loader.efi.canTouchEfiVariables = false; # /boot space is at a premium. default was 20. diff --git a/hosts/common/cross.nix b/hosts/common/cross.nix index 66cf47ea..e21e746b 100644 --- a/hosts/common/cross.nix +++ b/hosts/common/cross.nix @@ -1,4 +1,4 @@ -{ config, ... }: +{ config, lib, pkgs, ... }: let # these are the overlays which we *also* pass through to the cross and emulated package sets. @@ -22,50 +22,140 @@ let }; in { - # the configuration of which specific package set `pkgs.cross` refers to happens elsewhere; - # here we just define them all. - nixpkgs.overlays = [ - (next: prev: rec { - # non-emulated packages build *from* local *for* target. - # for large packages like the linux kernel which are expensive to build under emulation, - # the config can explicitly pull such packages from `pkgs.cross` to do more efficient cross-compilation. - crossFrom."x86_64-linux" = mkCrossFrom "x86_64-linux" prev; - crossFrom."aarch64-linux" = mkCrossFrom "aarch64-linux" prev; + # options = { + # perlPackageOverrides = lib.mkOption { + # }; + # }; - emulated = mkEmulated prev; - }) - (next: prev: { - # packages which don't cross compile - inherit (prev.emulated) - duplicity # python3.10-s3transfer - fuzzel - fwupd-efi - fwupd - # gnustep-base # (used by unar) - gocryptfs # gocryptfs-2.3-go-modules - # grpc - hdf5 - http2 - kitty - iio-sensor-proxy - libHX - pam_mount - pipewire - ncftp - rmlint - sequoia - # splatmoji - twitter-color-emoji # python3.10-defcon - unar # python3.10-psycopg2 - visidata # python3.10-psycopg2 - xdg-utils # perl5.36.0-File-BaseDir - ; - # pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [ - # (py-next: py-prev: { - # defcon = py-prev.defcon.override { inherit prev.emulated.stdenv; }; - # # psycopg2 = py-prev.psycopg2.override { inherit prev.emulated.stdenv; }; - # }) - # ]; - }) - ]; + config = { + # the configuration of which specific package set `pkgs.cross` refers to happens elsewhere; + # here we just define them all. + nixpkgs.overlays = [ + (next: prev: rec { + # non-emulated packages build *from* local *for* target. + # for large packages like the linux kernel which are expensive to build under emulation, + # the config can explicitly pull such packages from `pkgs.cross` to do more efficient cross-compilation. + crossFrom."x86_64-linux" = mkCrossFrom "x86_64-linux" prev; + crossFrom."aarch64-linux" = mkCrossFrom "aarch64-linux" prev; + + emulated = mkEmulated prev; + }) + (next: prev: + let + emulated = prev.emulated; + in { + # packages which don't cross compile + inherit (emulated) + # adwaita-qt # psqlodbc + apacheHttpd # TODO: not properly patched + appstream + blueman + brltty + cantarell-fonts # python3.10-skia-pathops + colord + duplicity # python3.10-s3transfer + evince + flakpak + fuzzel + fwupd-efi + fwupd + gcr + gmime + # gnome-keyring + # gnome-remote-desktop + gnome-tour + # gnustep-base # (used by unar) + gocryptfs # gocryptfs-2.3-go-modules + # grpc + gst_all_1 # gst_all_1.gst-editing-services + gupnp + gupnp_1_6 + gvfs + flatpak + hdf5 + http2 + ibus + kitty + iio-sensor-proxy + libHX + libgweather + librest + librest_1_0 + libsForQt5 # qtbase + mod_dnssd + ncftp + obex_data_server + openfortivpn + ostree + pam_mount + perl # perl5.36.0-Test-utf8 + pipewire + psqlodbc + pulseaudio # python3.10-defcon + # qgnomeplatform + # qtbase + qt6 # psqlodbc + rmlint + sequoia + # splatmoji + squeekboard + sysprof + tracker-miners # it just can't run tests + twitter-color-emoji # python3.10-defcon + unar # python3.10-psycopg2 + visidata # python3.10-psycopg2 + vpnc + webp-pixbuf-loader + xdg-utils # perl5.36.0-File-BaseDir + ; + # pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [ + # (py-next: py-prev: { + # defcon = py-prev.defcon.override { inherit prev.emulated.stdenv; }; + # # psycopg2 = py-prev.psycopg2.override { inherit prev.emulated.stdenv; }; + # }) + # ]; + + gnome = prev.gnome.overrideScope' (self: super: { + inherit (emulated.gnome) + gnome-color-manager + gnome-keyring + gnome-remote-desktop # TODO: figure out what's asking for this and remove it + gnome-user-share + mutter + ; + }); + + # gst_all_1.gst-editing-services = emulated.gst_all_1.gst-editing-services; + + # gst_all_1 = prev.gst_all_1.overrideScope' (self: super: { + # inherit (emulated.gst_all_1) + # gst-editing-services + # ; + # }); + + # libsForQt5 = prev.libsForQt5.overrideScope' (self: super: { + # inherit (emulated.libsForQt5) + # qtbase + # ; + # }); + + # apacheHttpdPackagesFor = apacheHttpd: self: + # let + # prevHttpdPkgs = lib.fix (emulated.apacheHttpdPackagesFor apacheHttpd); + # in + # (prev.apacheHttpdPackagesFor apacheHttpd self) // { + # # inherit (prevHttpdPkgs) mod_dnssd; + # mod_dnssd = prevHttpdPkgs.mod_dnssd.override { + # inherit (self) apacheHttpd; + # }; + # }; + }) + ]; + + # perlPackageOverrides = _perl: { + # inherit (pkgs.emulated.perl.pkgs) + # Testutf8 + # ; + # }; + }; }