Skip to content

hytale-launcher: init#514526

Closed
dtomvan wants to merge 3 commits into
NixOS:masterfrom
dtomvan:hytale-launcher-impure
Closed

hytale-launcher: init#514526
dtomvan wants to merge 3 commits into
NixOS:masterfrom
dtomvan:hytale-launcher-impure

Conversation

@dtomvan

@dtomvan dtomvan commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

This is an alternative to #479368, which is based upon suggestions by @ItsLiyua @jjsuperpower.

It's the least reproducible solution of them all, as it's basically just an automation for wget && flatpak install && flatpak run. But there's been a demand for some package for hytale-launcher, similar to the way most of steam is downloaded at runtime, due to how upstream distributes its software.

To my understanding this (read: directly installing the official flatpak) is the only way to "package" this for nixpkgs without breaking their license / distribution model.

Built, ran, loaded into a save.

See: #479368 (comment)

I added myself as maintainer, since that seems fair as I've now come up with code that I would otherwise not have to maintain.

cc @gepbird @karol-broda @liquidnya for wanting to be maintainers (let me know if you don't want to be a maintainer for this anymore, since it's a really boring derivation now...)

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

@dtomvan dtomvan force-pushed the hytale-launcher-impure branch from 94a40c0 to 810be8a Compare April 28, 2026 19:56
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 9.needs: reviewer This PR currently has no reviewers requested and needs attention. 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` labels Apr 28, 2026
@dtomvan dtomvan force-pushed the hytale-launcher-impure branch from 810be8a to 284774c Compare April 28, 2026 20:11

@Ben9986 Ben9986 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm hesitant to believe that the runtime install method will be merged as it goes against the general nixpkgs ethos, especially as it immediately cedes control of the package to flatpak.
Personally, I'm not massively against this as a stop-gap solution, but we may find that the committers are not as open to this being merged. I'm more in favour of this PR over #479368 as it will actually build correctly every time at least.

Not trying to be negative, just hopefully somewhat realistic.

Nonetheless I've suggested some changes in the event that this is merged, I hope they help.


nativeBuildInputs = [ copyDesktopItems ];
desktopItems = lib.singleton (makeDesktopItem {
name = "hytale-launcher";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name = "hytale-launcher";
name = "com.hypixel.HytaleLauncher";

This will prevent duplicate .desktop entries showing in launchers once the flatpak is installed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks!

mainProgram = "hytale-launcher";
platforms = [
"x86_64-linux"
"aarch64-darwin"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"aarch64-darwin"

You only download the 64 bit linux flatpak so this would either need to be removed or the script be edited to download the darwin version too

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah, sorry! Oversight

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So obviously I get a .dmg from upstream: https://launcher.hytale.com/builds/release/darwin/arm64/hytale-launcher-latest.dmg but I don't really know if we can install those in an automated fashion... We'd need someone with actual macos experience/knowledge to help us with that. I hope we could just do cd $(mktemp -d); undmg $hytaleDmg; cp -r *.app /Applications...


meta = {
description = "Official launcher for Hytale";
longDescription = "Official launcher for Hytale, an upcoming block-based game from Hypixel Studios";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
longDescription = "Official launcher for Hytale, an upcoming block-based game from Hypixel Studios";
longDescription = ''
Official launcher for Hytale, an upcoming block-based game from Hypixel Studios.
NOTE: This package is a simply a script which downloads and installs the Hytale launcher flatpak at *runtime*. From the first install, the launcher version is managed entirely by the Hytale launcher itself, meaning this package is **not reproducible**.
See discussions on [this pull request](https://github.com/NixOS/nixpkgs/pull/479368) for more context on why this method was chosen.
'';

Feel free to change the wording but I think it's important that we make clear that this package directly installs the flatpak and is not a native nix package

// extraEnvironment;
toFlatpakEnvArg = (var: lib.escapeShellArg "--env=${var.name}=${var.value}");
in
writeShellApplication {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't find any other packages directly using writeShellApplication at the top-level of a package so I'm not sure how this will interact with things like https://search.nixos.org/ as there is no package version. It might be worth switching to mkDerivation if possible, but it installs fine on my system just fine as is.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Under the hood writeShellApplication is just mkDerivation with a custom buildPhase... hence I can override derivationArgs. This feels more elegant to me since otherwise I'd be writing two derivations, one for writeShellApplication and then one toplevel mkDerivation...

@nixpkgs-ci nixpkgs-ci Bot removed the 9.needs: reviewer This PR currently has no reviewers requested and needs attention. label Apr 28, 2026
# wget https://hytale.com/images/logo-h.webp
# convert -fuzz 10% logo-h.webp -trim -background transparent -gravity center -extent 1154x1154 -resize 512x512 logo.png
postInstall = ''
install -Dm444 ${./logo.png} $out/share/icons/hicolor/512x512/apps/hytale-launcher.png

@Ben9986 Ben9986 Apr 28, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is really necessary. This would only be for the initial script install as after that the flatpak .desktop file will override this anyway.

It's also probably not the best idea to commit non-text files to nixpkgs, its large enough as is without lots of images in it too lol.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed it

@dtomvan

dtomvan commented Apr 29, 2026

Copy link
Copy Markdown
Contributor Author

Personally, I'm not massively against this as a stop-gap solution, but we may find that the committers are not as open to this being merged. I'm more in favour of this PR over #479368 as it will actually build correctly every time at least.

That's exactly how I'm feeling about this. I don't like this solution, but at least it will work...

@dtomvan dtomvan force-pushed the hytale-launcher-impure branch from 284774c to 68aad60 Compare April 29, 2026 07:25

@Ben9986 Ben9986 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I'd say the only thing left now is to get this reviewed by a committer.

I'm not familiar with darwin either but someone who is could add support later if they wanted.

curl -o "$tmp" https://launcher.hytale.com/builds/release/linux/amd64/hytale-launcher-latest.flatpak &&
flatpak install --user --noninteractive --bundle "$tmp"
) 2>&1 | tee "$logs"; then
notify-send "Hytale Launcher" "[Nix] Installing Hytale Launcher for failed! Logs in $logs"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
notify-send "Hytale Launcher" "[Nix] Installing Hytale Launcher for failed! Logs in $logs"
notify-send "Hytale Launcher" "[Nix] Installing Hytale Launcher failed! Logs in $logs"

Oops... I missed this on my first read through

@nixpkgs-ci nixpkgs-ci Bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label May 19, 2026
@liquidnya

Copy link
Copy Markdown
Contributor

I will take a look at this PR when I will have time.
I do have a MacBook, so maybe I could look into the darwin support.
What I find interesting is, that there is a hytale cask for homebrew: https://formulae.brew.sh/cask/hytale.
If I understand the JSON of that cask correctly, it is downloading the .dmg installer and then putting the app into the applications folder.
I wonder if nix could just do the same and I wonder how the previous darwin implementation works - I did not have time to take a look yet.

I am okay with staying a maintainer for this package, hoping that in the future there's going to be a different solution than the flatpak, but maybe that is just wishful thinking ^^'

@dtomvan

dtomvan commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

For now I'm just closing this. I don't want to give anyone the idea that this is something I'm still looking at. I didn't even think packaging hytale for nixpkgs is a sensible thing to do, so I'm just dropping this branch until there's some consensus on if and how hard we are willing to try to have a package for this...

@dtomvan dtomvan closed this Jun 11, 2026
@dtomvan dtomvan deleted the hytale-launcher-impure branch June 11, 2026 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants