-
-
Notifications
You must be signed in to change notification settings - Fork 19.4k
hytale-launcher: init at 2026.03.03-a4f6003 #479368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
karol-broda
wants to merge
7
commits into
NixOS:master
Choose a base branch
from
karol-broda:hytale-launcher-init
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
eaf0dbb
maintainers: add karol-broda
karol-broda 5b2b13e
maintainers: add liquidnya
gepbird 451a423
hytale-launcher: init at 2026.03.03-a4f6003
karol-broda 2226085
hytale-launcher: 2026.03.03-a4f6003 -> 2026.03.05-dea483c
gepbird 60a420b
hytale-launcher: 2026.03.05-dea483c -> 2026.03.09-9a5ec66
gepbird c2232b1
hytale-launcher: add launcher run script, remove temurin-bin-25
karol-broda 295d057
hytale-launcher: 2026.03.09-9a5ec66 -> 2026.03.24-a65f18c
gepbird File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,170 @@ | ||
| { | ||
| lib, | ||
| stdenv, | ||
| fetchzip, | ||
| buildFHSEnv, | ||
| makeWrapper, | ||
| makeDesktopItem, | ||
| writeScript, | ||
| gtk3, | ||
| nss, | ||
| libsecret, | ||
| libsoup_3, | ||
| gdk-pixbuf, | ||
| glib, | ||
| webkitgtk_4_1, | ||
| xdg-utils, | ||
| libGL, | ||
| alsa-lib, | ||
| udev, | ||
| libx11, | ||
| libxcursor, | ||
| libxrandr, | ||
| libxi, | ||
| icu, | ||
| openssl, | ||
| version ? null, | ||
| hytaleHashes ? null, | ||
| }: | ||
|
|
||
| let | ||
| sources = lib.importJSON ./pin.json; | ||
|
|
||
| finalVersion = if version != null then version else sources.version; | ||
| finalHytaleHashes = if hytaleHashes != null then hytaleHashes else sources.hashes; | ||
|
|
||
| # TODO: add icon once a stable versioned source is available | ||
| desktopItem = makeDesktopItem { | ||
| name = "hytale-launcher"; | ||
| desktopName = "Hytale Launcher"; | ||
| exec = "hytale-launcher"; | ||
| comment = "Official launcher for Hytale"; | ||
| categories = [ "Game" ]; | ||
| terminal = false; | ||
| startupWMClass = "com.hypixel.HytaleLauncher"; | ||
| }; | ||
|
|
||
| os = if stdenv.hostPlatform.system == "x86_64-linux" then "linux" else "darwin"; | ||
| arch = if stdenv.hostPlatform.system == "x86_64-linux" then "amd64" else "arm64"; | ||
|
|
||
| src = fetchzip { | ||
| url = "https://launcher.hytale.com/builds/release/${os}/${arch}/hytale-launcher-${finalVersion}.zip"; | ||
| hash = | ||
| finalHytaleHashes.${stdenv.hostPlatform.system} | ||
| or (throw "unsupported system: ${stdenv.hostPlatform.system}"); | ||
| stripRoot = false; | ||
| }; | ||
|
|
||
| launcherRunScript = writeScript "hytale-launcher-run" '' | ||
| #!/bin/bash | ||
| LAUNCHER_DIR="$HOME/.local/share/Hytale/bin" | ||
| LAUNCHER_BIN="$LAUNCHER_DIR/hytale-launcher" | ||
| NIX_BIN="${src}/hytale-launcher" | ||
| NIX_STORE_PATH_FILE="$LAUNCHER_DIR/.nix-store-path" | ||
|
|
||
| if [[ ! -f "$LAUNCHER_BIN" ]] || [[ "$(cat "$NIX_STORE_PATH_FILE" 2>/dev/null)" != "$NIX_BIN" ]]; then | ||
| mkdir -p "$LAUNCHER_DIR" | ||
| cp "$NIX_BIN" "$LAUNCHER_BIN" | ||
| echo "$NIX_BIN" > "$NIX_STORE_PATH_FILE" | ||
| fi | ||
|
|
||
| exec "$LAUNCHER_BIN" "$@" | ||
| ''; | ||
|
|
||
| fhsEnv = buildFHSEnv { | ||
| pname = "hytale-launcher"; | ||
| version = finalVersion; | ||
|
|
||
| targetPkgs = pkgs: [ | ||
| # launcher dependencies (webkit/tauri) | ||
| gtk3 | ||
| nss | ||
| libsecret | ||
| libsoup_3 | ||
| gdk-pixbuf | ||
| glib | ||
| webkitgtk_4_1 | ||
| xdg-utils | ||
| # graphics | ||
| libGL | ||
| # audio | ||
| alsa-lib | ||
| # input/display | ||
| udev | ||
| libx11 | ||
| libxcursor | ||
| libxrandr | ||
| libxi | ||
| # .NET runtime dependencies :( | ||
| icu | ||
| openssl | ||
| # misc | ||
| stdenv.cc.cc.lib | ||
| ]; | ||
|
|
||
| runScript = "${launcherRunScript}"; | ||
|
|
||
| extraBwrapArgs = [ | ||
| "--setenv __NV_DISABLE_EXPLICIT_SYNC 1" | ||
| "--setenv WEBKIT_DISABLE_DMABUF_RENDERER 1" | ||
| # taken from the flatpak at https://launcher.hytale.com/builds/release/linux/amd64/hytale-launcher-latest.flatpak | ||
| "--setenv WEBKIT_DISABLE_COMPOSITING_MODE 1" | ||
| "--setenv DESKTOP_STARTUP_ID com.hypixel.HytaleLauncher" | ||
| ]; | ||
|
|
||
| extraInstallCommands = '' | ||
| mkdir -p $out/share/applications | ||
| cp ${desktopItem}/share/applications/*.desktop $out/share/applications/ | ||
| ''; | ||
|
|
||
| passthru = { | ||
| inherit src; | ||
| updateScript = ./update.sh; | ||
| }; | ||
|
|
||
| meta = { | ||
| description = "Official launcher for Hytale"; | ||
| longDescription = '' | ||
| Official launcher for Hytale, an upcoming block-based game from Hypixel Studios. | ||
|
|
||
| Note: The launcher's built-in auto-update mechanism will not work on NixOS | ||
| due to the immutable nature of the Nix store. You may see an error message | ||
| about "failed to remove existing executable: read-only file system", this | ||
| is expected and the launcher will continue to work. Updates must be applied | ||
| by updating the nixpkgs package. | ||
| ''; | ||
| homepage = "https://hytale.com"; | ||
| license = lib.licenses.unfree; | ||
| maintainers = with lib.maintainers; [ | ||
| gepbird | ||
| karol-broda | ||
| liquidnya | ||
| ]; | ||
| mainProgram = "hytale-launcher"; | ||
| platforms = [ | ||
| "x86_64-linux" | ||
| "aarch64-darwin" | ||
| ]; | ||
| sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; | ||
| }; | ||
| }; | ||
|
|
||
| darwinPackage = stdenv.mkDerivation { | ||
| pname = "hytale-launcher"; | ||
| version = finalVersion; | ||
| inherit src; | ||
|
|
||
| nativeBuildInputs = [ makeWrapper ]; | ||
|
|
||
| installPhase = '' | ||
| runHook preInstall | ||
| mkdir -p "$out/Applications" "$out/bin" | ||
| cp -r hytale-launcher.app "$out/Applications/" | ||
| makeWrapper "$out/Applications/hytale-launcher.app/Contents/MacOS/hytale-launcher" "$out/bin/hytale-launcher" | ||
| runHook postInstall | ||
| ''; | ||
|
|
||
| inherit (fhsEnv) passthru meta; | ||
| }; | ||
| in | ||
| if stdenv.hostPlatform.isDarwin then darwinPackage else fhsEnv | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "version": "2026.03.24-a65f18c", | ||
| "hashes": { | ||
| "x86_64-linux": "sha256-pABTyxhUZe0pvrAnyYw5GCVBfr1xgJYc3uplZb3k8hk=", | ||
| "aarch64-darwin": "sha256-XacE+msmzwI3k7VLHnSk+2sujw1GKNFjdUx6eLzGJFU=" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| #!/usr/bin/env nix-shell | ||
| #!nix-shell --pure -I nixpkgs=./. -i bash -p bash curl cacert jq nix nix-prefetch | ||
|
|
||
| launcherJson=$(curl -s https://launcher.hytale.com/version/release/launcher.json) | ||
|
|
||
| function launcherJq() { | ||
| echo "$launcherJson" | jq --raw-output "$@" | ||
| } | ||
|
|
||
| latestVersion=$(launcherJq '.version') | ||
| if [[ $latestVersion == "$UPDATE_NIX_OLD_VERSION" ]]; then | ||
| echo "package is up-to-date" | ||
| exit 0 | ||
| fi | ||
|
|
||
| function selectUrlAndHash() { | ||
| local os="$1" | ||
| local arch="$2" | ||
| # shellcheck disable=SC2016 | ||
| launcherJq --arg os "$os" --arg arch "$arch" '[.download_url[$os][$arch].url, .download_url[$os][$arch].sha256] | join(" ")' | ||
| } | ||
|
|
||
| function prefetch() { | ||
| nix store prefetch-file --json --hash-type sha256 "$@" | jq --raw-output '[.hash, .storePath] | join(" ")' | ||
| } | ||
|
|
||
| function fetchzipFile() { | ||
| local file="$1" | ||
| shift | ||
| # keep a reference to the store path to keep it in the sandbox | ||
| derivationArgs="{ src = builtins.storePath $(echo -n "$file" | jq -Rsa '.'); }" | ||
| nix-prefetch -I nixpkgs=./. --quiet fetchzip --url "file://$file" --derivationArgs --expr "$derivationArgs" "$@" | ||
| } | ||
|
|
||
| function update() { | ||
| local system="$1" | ||
| shift | ||
| read -r url expectedHash < <(selectUrlAndHash "$@") | ||
| read -r _zipHash zipPath < <(prefetch --expected-hash "$expectedHash" "$url") | ||
| hash=$(fetchzipFile "$zipPath" --no-stripRoot) | ||
|
|
||
| currentPin="$(dirname "${BASH_SOURCE[0]}")/pin.json" | ||
| newPin=$(mktemp) | ||
| jq --arg ver "$latestVersion" --arg sys "$system" --arg hash "$hash" \ | ||
| '.version = $ver | .hashes[$sys] = $hash' \ | ||
| "$currentPin" > "$newPin" | ||
| mv "$newPin" "$currentPin" | ||
| } | ||
|
|
||
| update "x86_64-linux" "linux" "amd64" | ||
| update "aarch64-darwin" "darwin" "arm64" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice workaround for the auto updating problem :)
I think adding a comment about the launcher version being managed by Hytale instead of Nix would be great, or maybe even putting it in the long description.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any specific reason for not using
writeShellScripthere?