From 1464ef774b40be0d60e44c8e9ec295d9305c600b Mon Sep 17 00:00:00 2001 From: Ophestra Date: Mon, 30 Dec 2024 02:02:20 +0900 Subject: cmd/fpkg: expose nixGL wrappers Signed-off-by: Ophestra --- bundle.nix | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'bundle.nix') diff --git a/bundle.nix b/bundle.nix index ba2ffa70..aa798908 100644 --- a/bundle.nix +++ b/bundle.nix @@ -10,6 +10,7 @@ writeScript, runtimeShell, writeText, + symlinkJoin, vmTools, runCommand, fetchFromGitHub, @@ -117,6 +118,23 @@ let hash = "sha256-lnzZQYG0+EXl/6NkGpyIz+FEOc/DSEG57AP1VsdeNrM="; }; + mesaWrappers = + let + isIntelX86Platform = system == "x86_64-linux"; + nixGLPackages = import (nixGL + "/default.nix") { + pkgs = nixpkgs.legacyPackages.${system}; + enable32bits = isIntelX86Platform; + enableIntelX86Extensions = isIntelX86Platform; + }; + in + symlinkJoin { + name = "nixGL-mesa"; + paths = with nixGLPackages; [ + nixGLIntel + nixVulkanIntel + ]; + }; + info = builtins.toJSON { inherit name @@ -152,6 +170,7 @@ let + (if allow_dbus then 4 else 0) + (if allow_pulse then 8 else 0); + mesa = if gpu then mesaWrappers else null; nix_gl = if gpu then nixGL else null; current_system = nixos.config.system.build.toplevel; activation_package = homeManagerConfiguration.activationPackage; @@ -169,7 +188,7 @@ writeScript "fortify-${pname}-bundle-prelude" '' chmod -R +r "$OUT/nix/var" nix copy --no-check-sigs --to "file://$OUT/res?compression=zstd&compression-level=19¶llel-compression=true" \ "${homeManagerConfiguration.activationPackage}" \ - "${launcher}" ${if gpu then nixGL else ""} + "${launcher}" ${if gpu then "${mesaWrappers} ${nixGL}" else ""} mkdir -p "$OUT/etc" tar -C "$OUT/etc" -xf "${etc}/etc.tar" cp "${writeText "bundle.json" info}" "$OUT/bundle.json" -- cgit v1.3.1