mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-23 06:03:40 +00:00
40 lines
1.4 KiB
Nix
40 lines
1.4 KiB
Nix
{ appimageTools
|
|
, fetchurl
|
|
, lib
|
|
, makeWrapper
|
|
}:
|
|
|
|
appimageTools.wrapType2 rec {
|
|
pname = "lunar-client";
|
|
version = "3.2.6";
|
|
|
|
src = fetchurl {
|
|
url = "https://launcherupdates.lunarclientcdn.com/Lunar%20Client-${version}.AppImage";
|
|
hash = "sha512-JZ6fXUDurLxe6acRRXTHot2GTUqMaSwy7N5K4cmFmOn4s8W2aXek+o8med3ytaxoTd6FmibXmCxrjnOVMHBRGA==";
|
|
};
|
|
|
|
extraInstallCommands =
|
|
let contents = appimageTools.extract { inherit pname version src; };
|
|
in ''
|
|
source "${makeWrapper}/nix-support/setup-hook"
|
|
wrapProgram $out/bin/lunar-client \
|
|
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}"
|
|
install -Dm444 ${contents}/launcher.desktop $out/share/applications/lunar-client.desktop
|
|
install -Dm444 ${contents}/launcher.png $out/share/pixmaps/lunar-client.png
|
|
substituteInPlace $out/share/applications/lunar-client.desktop \
|
|
--replace 'Exec=AppRun --no-sandbox %U' 'Exec=lunar-client' \
|
|
--replace 'Icon=launcher' 'Icon=lunar-client'
|
|
'';
|
|
|
|
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 = "lunar-client";
|
|
maintainers = with maintainers; [ zyansheep Technical27 surfaceflinger ];
|
|
platforms = [ "x86_64-linux" ];
|
|
};
|
|
}
|