about summary refs log tree commit diff
path: root/pkgs/games/atlauncher
diff options
context:
space:
mode:
authorGetPsyched <priyanshutr@proton.me>2023-06-12 00:44:18 +0400
committerGetPsyched <priyanshutr@proton.me>2023-06-17 23:23:00 +0400
commit4908631f89d29ba0d741d4d119f6a76a46c0adb3 (patch)
tree676c1c4173c2477e5033df7118db5d67b33fec3d /pkgs/games/atlauncher
parent74d437f37a7172e47f40688a5dbd622d9f251a2a (diff)
atlauncher: init at 3.4.28.1
Diffstat (limited to 'pkgs/games/atlauncher')
-rw-r--r--pkgs/games/atlauncher/default.nix57
1 files changed, 57 insertions, 0 deletions
diff --git a/pkgs/games/atlauncher/default.nix b/pkgs/games/atlauncher/default.nix
new file mode 100644
index 0000000000000..913b4faffb8fc
--- /dev/null
+++ b/pkgs/games/atlauncher/default.nix
@@ -0,0 +1,57 @@
+{ copyDesktopItems, fetchurl, jre, lib, makeDesktopItem, makeWrapper, stdenv, steam-run, withSteamRun ? true, writeShellScript }:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "atlauncher";
+  version = "3.4.28.1";
+
+  src = fetchurl {
+    url = "https://github.com/ATLauncher/ATLauncher/releases/download/v${finalAttrs.version}/ATLauncher-${finalAttrs.version}.jar";
+    hash = "sha256-IIwDMazxUMQ7nGQk/4VEZicgCmCR4oR8UYtO36pCEq4=";
+  };
+
+  dontUnpack = true;
+
+  buildInputs = [ ];
+  nativeBuildInputs = [ copyDesktopItems makeWrapper ];
+
+  installPhase =
+    let
+      # hack to use steam-run along with the exec
+      steamrun = writeShellScript "steamrun" ''
+        shift
+        exec ${steam-run}/bin/steam-run "''$@"
+      '';
+    in
+    ''
+      runHook preInstall
+      mkdir -p $out/bin
+      makeWrapper ${jre}/bin/java $out/bin/atlauncher \
+        --add-flags "-jar $src --working-dir=\$HOME/.atlauncher" \
+        --suffix LD_LIBRARY_PATH : "${lib.makeLibraryPath finalAttrs.buildInputs}" ${
+            lib.strings.optionalString withSteamRun ''--run "${steamrun} \\"''
+          }
+      runHook postInstall
+    '';
+
+  desktopItems = [
+    (makeDesktopItem {
+      name = finalAttrs.pname;
+      exec = finalAttrs.pname;
+      icon = fetchurl {
+        url = "https://avatars.githubusercontent.com/u/7068667";
+        hash = "sha256-YmEkxf4rZxN3jhiib0UtdUDDcn9lw7IMbiEucBL7b9o=";
+      };
+      desktopName = "ATLauncher";
+      categories = [ "Game" ];
+    })
+  ];
+
+  meta = with lib; {
+    description = "A simple and easy to use Minecraft launcher which contains many different modpacks for you to choose from and play";
+    downloadPage = "https://atlauncher.com/downloads";
+    homepage = "https://atlauncher.com/";
+    license = licenses.gpl3;
+    maintainers = [ maintainers.getpsyched ];
+    platforms = platforms.all;
+  };
+})