From 8d000d29fa951b3672057541d9944991ac7fe5d0 Mon Sep 17 00:00:00 2001 From: cidkidnix Date: Sat, 8 Jan 2022 09:12:44 -0600 Subject: [PATCH] Fix desktop file and move directories around --- flake.nix | 4 ++-- overlay.nix => packages/nix/overlay.nix | 0 .../nix}/polymc/0001-pick-latest-java-first.patch | 0 {nix => packages/nix}/polymc/default.nix | 11 +++-------- 4 files changed, 5 insertions(+), 10 deletions(-) rename overlay.nix => packages/nix/overlay.nix (100%) rename {nix => packages/nix}/polymc/0001-pick-latest-java-first.patch (100%) rename {nix => packages/nix}/polymc/default.nix (81%) diff --git a/flake.nix b/flake.nix index f61da9f2..8f8325c0 100644 --- a/flake.nix +++ b/flake.nix @@ -2,6 +2,6 @@ description = "PolyMC"; outputs = inputs: { - overlay = import ./overlay.nix; + overlay = import ./packages/nix/overlay.nix; }; -} \ No newline at end of file +} diff --git a/overlay.nix b/packages/nix/overlay.nix similarity index 100% rename from overlay.nix rename to packages/nix/overlay.nix diff --git a/nix/polymc/0001-pick-latest-java-first.patch b/packages/nix/polymc/0001-pick-latest-java-first.patch similarity index 100% rename from nix/polymc/0001-pick-latest-java-first.patch rename to packages/nix/polymc/0001-pick-latest-java-first.patch diff --git a/nix/polymc/default.nix b/packages/nix/polymc/default.nix similarity index 81% rename from nix/polymc/default.nix rename to packages/nix/polymc/default.nix index f49c593a..5f1a0f27 100644 --- a/nix/polymc/default.nix +++ b/packages/nix/polymc/default.nix @@ -1,12 +1,7 @@ -{ lib, mkDerivation, makeDesktopItem, fetchFromGitHub, cmake, jdk8, jdk, zlib, file, makeWrapper, xorg, libpulseaudio, qtbase, libGL, msaClientID ? "" }: +{ lib, mkDerivation, fetchFromGitHub, cmake, jdk8, jdk, zlib, file, makeWrapper, xorg, libpulseaudio, qtbase, libGL, msaClientID ? "" }: let libpath = with xorg; lib.makeLibraryPath [ libX11 libXext libXcursor libXrandr libXxf86vm libpulseaudio libGL ]; - desktopFile = makeDesktopItem { - name = "PolyMC"; - desktopName = "PolyMC"; - exec = "polymc"; - }; in mkDerivation rec { pname = "polymc"; @@ -34,11 +29,11 @@ mkDerivation rec { postInstall = '' # xorg.xrandr needed for LWJGL [2.9.2, 3) https://github.com/LWJGL/lwjgl/issues/128 - rm $out/share/applications/* - cp ${desktopFile}/share/applications/* $out/share/applications/ wrapProgram $out/bin/polymc \ --set GAME_LIBRARY_PATH /run/opengl-driver/lib:${libpath} \ --prefix PATH : ${lib.makeBinPath [ xorg.xrandr ]} + + substituteInPlace $out/share/applications/org.polymc.PolyMC.desktop --replace 'Exec=' 'Exec=${placeholder "out"}/bin/polymc' ''; meta = with lib; {