diff options
Diffstat (limited to 'pkgs/by-name/lu/lunar-client/package.nix')
-rw-r--r-- | pkgs/by-name/lu/lunar-client/package.nix | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/pkgs/by-name/lu/lunar-client/package.nix b/pkgs/by-name/lu/lunar-client/package.nix new file mode 100644 index 00000000000..1506e5c0cb6 --- /dev/null +++ b/pkgs/by-name/lu/lunar-client/package.nix @@ -0,0 +1,42 @@ +{ appimageTools +, fetchurl +, lib +, makeWrapper +}: + +let + pname = "lunar-client"; + version = "3.1.0"; + + src = fetchurl { + url = "https://launcherupdates.lunarclientcdn.com/Lunar%20Client-${version}.AppImage"; + hash = "sha512-YUddAvsPbuuOvhJZsWDvgF/7yghABU6Av7DcKNX1bKZqE3BzMAAQADJuNuNL4+UydoTaHetXvRO8oJCbrqgtAQ=="; + }; + + appimageContents = appimageTools.extract { inherit pname version src; }; +in +appimageTools.wrapType2 rec { + inherit pname version src; + + extraInstallCommands = '' + mv $out/bin/{${pname}-${version},${pname}} + source "${makeWrapper}/nix-support/setup-hook" + wrapProgram $out/bin/${pname} \ + --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" + install -Dm444 ${appimageContents}/launcher.desktop $out/share/applications/lunar-client.desktop + install -Dm444 ${appimageContents}/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 ]; + maintainers = with maintainers; [ zyansheep Technical27 surfaceflinger ]; + platforms = [ "x86_64-linux" ]; + }; +} |