hytale-launcher: init#514526
Conversation
94a40c0 to
810be8a
Compare
810be8a to
284774c
Compare
Ben9986
left a comment
There was a problem hiding this comment.
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"; |
There was a problem hiding this comment.
| name = "hytale-launcher"; | |
| name = "com.hypixel.HytaleLauncher"; |
This will prevent duplicate .desktop entries showing in launchers once the flatpak is installed.
There was a problem hiding this comment.
Good catch, thanks!
| mainProgram = "hytale-launcher"; | ||
| platforms = [ | ||
| "x86_64-linux" | ||
| "aarch64-darwin" |
There was a problem hiding this comment.
| "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
There was a problem hiding this comment.
Oh yeah, sorry! Oversight
There was a problem hiding this comment.
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"; |
There was a problem hiding this comment.
| 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 { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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...
| # 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 |
There was a problem hiding this comment.
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.
That's exactly how I'm feeling about this. I don't like this solution, but at least it will work... |
284774c to
68aad60
Compare
Ben9986
left a comment
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
| 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
|
I will take a look at this PR when I will have time. 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 ^^' |
|
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... |
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 forhytale-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
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.