depot/third_party/nixpkgs/pkgs/by-name/lu/lunar-client/package.nix
Default email 657f08b14c Project import generated by Copybara.
GitOrigin-RevId: 807e9154dcb16384b1b765ebe9cd2bba2ac287fd
2024-10-29 11:11:06 +00:00

39 lines
1.3 KiB
Nix

{ appimageTools
, fetchurl
, lib
, makeWrapper
}:
appimageTools.wrapType2 rec {
pname = "lunarclient";
version = "3.2.24";
src = fetchurl {
url = "https://launcherupdates.lunarclientcdn.com/Lunar%20Client-${version}.AppImage";
hash = "sha512-0rTADFgOOBDuv4nk2lgP4YUFxfsasZDQkp/r26iVwSa5f1swQXALGFwLl1VdJTRQ5AlZvRm6WBbt/ML2jODTZw==";
};
nativeBuildInputs = [ makeWrapper ];
extraInstallCommands =
let contents = appimageTools.extract { inherit pname version src; };
in ''
wrapProgram $out/bin/lunarclient \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}"
install -Dm444 ${contents}/lunarclient.desktop -t $out/share/applications/
install -Dm444 ${contents}/lunarclient.png -t $out/share/pixmaps/
substituteInPlace $out/share/applications/lunarclient.desktop \
--replace-fail 'Exec=AppRun --no-sandbox %U' 'Exec=lunarclient' \
'';
passthru.updateScript = ./update.sh;
meta = with lib; {
description = "Free Minecraft client with mods, cosmetics, and performance boost";
homepage = "https://www.lunarclient.com/";
license = with licenses; [ unfree ];
mainProgram = "lunarclient";
maintainers = with maintainers; [ Technical27 surfaceflinger ];
platforms = [ "x86_64-linux" ];
};
}