diff --git a/overlays/cross.nix b/overlays/cross.nix index a021186d4..39ca6ea20 100644 --- a/overlays/cross.nix +++ b/overlays/cross.nix @@ -630,7 +630,38 @@ in { # }); # needs binfmt: "error[E0463]: can't find crate for `gettextrs`" - fractal-nixified = needsBinfmt prev.fractal-nixified; + fractal-nixified = needsBinfmt (prev.fractal-nixified.override { + # TODO: lift this to the toplevel? + defaultCrateOverrides = let + crateNeedsBinfmt = cname: { + "${cname}" = attrs: let + baseAttrs = (final.defaultCrateOverrides."${cname}" or (a: a)) attrs; + in baseAttrs // { + requiredSystemFeatures = (baseAttrs.requiredSystemFeatures or []) ++ [ "kvm" ]; + }; + }; + in final.defaultCrateOverrides + // (crateNeedsBinfmt "gdk4") + // (crateNeedsBinfmt "gsk4") + // (crateNeedsBinfmt "gst-plugin-gtk4") + // (crateNeedsBinfmt "gstreamer") + // (crateNeedsBinfmt "gstreamer-audio") + // (crateNeedsBinfmt "gstreamer-audio-sys") + // (crateNeedsBinfmt "gstreamer-base") + // (crateNeedsBinfmt "gstreamer-base-sys") + // (crateNeedsBinfmt "gstreamer-pbutils") + // (crateNeedsBinfmt "gstreamer-pbutils-sys") + // (crateNeedsBinfmt "gstreamer-play") + // (crateNeedsBinfmt "gstreamer-play-sys") + // (crateNeedsBinfmt "gstreamer-sys") + // (crateNeedsBinfmt "gstreamer-video") + // (crateNeedsBinfmt "gstreamer-video-sys") + // (crateNeedsBinfmt "gtk4") + // (crateNeedsBinfmt "libadwaita") + // (crateNeedsBinfmt "libshumate") + // (crateNeedsBinfmt "sourceview5") + ; + }); # 2023/07/31: upstreaming is unblocked -- if i can rework to not use emulation # fwupd-efi = prev.fwupd-efi.override { diff --git a/pkgs/additional/fractal-nixified/default.nix b/pkgs/additional/fractal-nixified/default.nix index 89e835784..05c2fc6f6 100644 --- a/pkgs/additional/fractal-nixified/default.nix +++ b/pkgs/additional/fractal-nixified/default.nix @@ -24,6 +24,7 @@ , appstream-glib , buildPackages , cargo +, defaultCrateOverrides , desktop-file-utils , fetchFromGitHub , gdk-pixbuf @@ -328,7 +329,10 @@ let }; }; - defaultCrateOverrides = pkgs.defaultCrateOverrides // extraCrateOverrides; + defaultCrateOverrides' = defaultCrateOverrides // (lib.mapAttrs (crate: fn: + # map each `extraCrateOverrides` to first pass their attrs through `defaultCrateOverrides` + attrs: fn ((defaultCrateOverrides."${crate}" or (a: a)) attrs) + ) extraCrateOverrides); crate2NixOverrides = crates: crates // { # crate2nix sometimes "misses" dependencies, or gets them wrong in a way that crateOverrides can't patch. @@ -355,7 +359,7 @@ let inherit pkgs; release = false; rootFeatures = [ ]; #< avoids --cfg feature="default", simplifying the rustc CLI so that i can pass it around easier - inherit defaultCrateOverrides; + defaultCrateOverrides = defaultCrateOverrides'; }; # fractalDefault = cargoNix.workspaceMembers.fractal.build; @@ -363,7 +367,7 @@ let packageId = "fractal"; features = []; buildRustCrateForPkgsFunc = pkgs: crateArgs: (pkgs.buildRustCrate.override { - inherit defaultCrateOverrides; + defaultCrateOverrides = defaultCrateOverrides'; }) (crateArgs // { # this can be used to force a rebuild of every crate # mostly useful to deal with impurities (i.e. binfmt when cross-compiling)