Skip to content

Commit

Permalink
fix(nix): include inputs from wrapped package in dev shell
Browse files Browse the repository at this point in the history
this allows for things like icons to work when compiled in the dev shell
using `cmake` as normal

Signed-off-by: seth <getchoo@tuta.io>
  • Loading branch information
getchoo committed Jan 23, 2024
1 parent 12583c8 commit 70cea38
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 25 deletions.
7 changes: 6 additions & 1 deletion nix/dev.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@
'';

inputsFrom = [config.packages.prismlauncher-unwrapped];
buildInputs = with pkgs; [ccache ninja];
buildInputs = with pkgs;
[ccache ninja]
++ (let
runtime = callPackage ./pkg/runtime.nix {};
in
runtime.libs ++ runtime.programs);
};

formatter = pkgs.alejandra;
Expand Down
35 changes: 35 additions & 0 deletions nix/pkg/runtime.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
stdenv,
glfw,
libGL,
libpulseaudio,
mesa-demos,
openal,
pciutils,
udev,
xorg,
}: {
libs = [
xorg.libX11
xorg.libXext
xorg.libXcursor
xorg.libXrandr
xorg.libXxf86vm

# lwjgl
libpulseaudio
libGL
glfw
openal
stdenv.cc.cc.lib

# oshi
udev
];

programs = [
xorg.xrandr
mesa-demos # need glxinfo
pciutils # need lspci
];
}
29 changes: 5 additions & 24 deletions nix/pkg/wrapper.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
lib,
stdenv,
symlinkJoin,
callPackage,
prismlauncher-unwrapped,
wrapQtAppsHook,
makeWrapper,
Expand Down Expand Up @@ -43,6 +44,8 @@ assert lib.assertMsg (withWaylandGLFW -> stdenv.isLinux) "withWaylandGLFW is onl
unwrapped = prismlauncher-unwrapped.override {
inherit msaClientID gamemodeSupport;
};

runtime = callPackage ./runtime.nix {};
in
symlinkJoin {
name = "prismlauncher-${unwrapped.version}";
Expand Down Expand Up @@ -79,35 +82,13 @@ in

qtWrapperArgs = let
runtimeLibs =
[
xorg.libX11
xorg.libXext
xorg.libXcursor
xorg.libXrandr
xorg.libXxf86vm

# lwjgl
libpulseaudio
libGL
glfw
openal
stdenv.cc.cc.lib

# oshi
udev
]
runtime.libs
++ lib.optional gamemodeSupport gamemode.lib
++ lib.optional textToSpeechSupport flite
++ lib.optional controllerSupport libusb1
++ additionalLibs;

runtimePrograms =
[
xorg.xrandr
mesa-demos # need glxinfo
pciutils # need lspci
]
++ additionalPrograms;
runtimePrograms = runtime.programs ++ additionalPrograms;
in
["--prefix PRISMLAUNCHER_JAVA_PATHS : ${lib.makeSearchPath "bin/java" jdks}"]
++ lib.optionals stdenv.isLinux [
Expand Down

0 comments on commit 70cea38

Please sign in to comment.