From f32d7d364391e67b9c26623cc5da255a85e01820 Mon Sep 17 00:00:00 2001 From: servius Date: Sun, 25 Jan 2026 15:30:45 +0530 Subject: [PATCH] feat: Added hytale --- flake.lock | 261 ++++++++++++------- flake.nix | 3 + home/programs/cargo.nix | 8 +- nixos/ryu/games/hytale.nix | 522 ++++++++++++++++++++++++++++++++++--- nixos/tsuba/default.nix | 3 + overlays.nix | 4 + 6 files changed, 675 insertions(+), 126 deletions(-) diff --git a/flake.lock b/flake.lock index 79d3552d..b5226921 100644 --- a/flake.lock +++ b/flake.lock @@ -510,7 +510,7 @@ "crane_5": { "inputs": { "flake-compat": "flake-compat_6", - "flake-utils": "flake-utils_11", + "flake-utils": "flake-utils_12", "nixpkgs": [ "music-player", "nixpkgs" @@ -1300,11 +1300,11 @@ "systems": "systems_15" }, "locked": { - "lastModified": 1685518550, - "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -1335,6 +1335,24 @@ "inputs": { "systems": "systems_17" }, + "locked": { + "lastModified": 1685518550, + "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_14": { + "inputs": { + "systems": "systems_18" + }, "locked": { "lastModified": 1731533236, "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", @@ -1349,7 +1367,7 @@ "type": "github" } }, - "flake-utils_14": { + "flake-utils_15": { "inputs": { "systems": [ "nixpkgs-xr", @@ -1370,9 +1388,9 @@ "type": "github" } }, - "flake-utils_15": { + "flake-utils_16": { "inputs": { - "systems": "systems_20" + "systems": "systems_21" }, "locked": { "lastModified": 1731533236, @@ -1388,21 +1406,6 @@ "type": "github" } }, - "flake-utils_16": { - "locked": { - "lastModified": 1644229661, - "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "flake-utils_17": { "locked": { "lastModified": 1644229661, @@ -1419,15 +1422,12 @@ } }, "flake-utils_18": { - "inputs": { - "systems": "systems_24" - }, "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "lastModified": 1644229661, + "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", "owner": "numtide", "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", "type": "github" }, "original": { @@ -1438,14 +1438,14 @@ }, "flake-utils_19": { "inputs": { - "systems": "systems_26" + "systems": "systems_25" }, "locked": { - "lastModified": 1726560853, - "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -1476,6 +1476,24 @@ "inputs": { "systems": "systems_27" }, + "locked": { + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_21": { + "inputs": { + "systems": "systems_28" + }, "locked": { "lastModified": 1731533236, "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", @@ -2387,6 +2405,25 @@ "type": "github" } }, + "hytale-launcher": { + "inputs": { + "flake-utils": "flake-utils_11", + "nixpkgs": "nixpkgs_4" + }, + "locked": { + "lastModified": 1769270593, + "narHash": "sha256-xk/p25XChk2XB6NRdayRuP17mfQh9JEroLmGVFbE1ow=", + "owner": "JPyke3", + "repo": "hytale-launcher-nix", + "rev": "da53ec38c153a385d13d7adc2fa7af23e8e642df", + "type": "github" + }, + "original": { + "owner": "JPyke3", + "repo": "hytale-launcher-nix", + "type": "github" + } + }, "ik_llama": { "inputs": { "flake-parts": "flake-parts_4", @@ -2481,7 +2518,7 @@ "advisory-db": "advisory-db_4", "crane": "crane_5", "fenix": "fenix_2", - "flake-utils": "flake-utils_12", + "flake-utils": "flake-utils_13", "nixpkgs": [ "nixpkgs" ] @@ -2756,7 +2793,7 @@ }, "nix-index-database": { "inputs": { - "nixpkgs": "nixpkgs_5" + "nixpkgs": "nixpkgs_6" }, "locked": { "lastModified": 1765267181, @@ -2775,8 +2812,8 @@ "nix-minecraft": { "inputs": { "flake-compat": "flake-compat_7", - "flake-utils": "flake-utils_13", - "nixpkgs": "nixpkgs_6" + "flake-utils": "flake-utils_14", + "nixpkgs": "nixpkgs_7" }, "locked": { "lastModified": 1768357481, @@ -2838,7 +2875,7 @@ "argononed": "argononed", "flake-compat": "flake-compat_8", "nixos-images": "nixos-images", - "nixpkgs": "nixpkgs_7" + "nixpkgs": "nixpkgs_8" }, "locked": { "lastModified": 1768599442, @@ -2975,12 +3012,12 @@ "nixpkgs-xr": { "inputs": { "flake-compat": "flake-compat_9", - "flake-utils": "flake-utils_14", + "flake-utils": "flake-utils_15", "nixpkgs": [ "nixpkgs" ], "nvfetcher": "nvfetcher", - "systems": "systems_18", + "systems": "systems_19", "treefmt-nix": "treefmt-nix_2" }, "locked": { @@ -2999,11 +3036,11 @@ }, "nixpkgs_10": { "locked": { - "lastModified": 1644486793, - "narHash": "sha256-EeijR4guVHgVv+JpOX3cQO+1XdrkJfGmiJ9XVsVU530=", + "lastModified": 1767026758, + "narHash": "sha256-7fsac/f7nh/VaKJ/qm3I338+wAJa/3J57cOGpXi0Sbg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1882c6b7368fd284ad01b0a5b5601ef136321292", + "rev": "346dd96ad74dc4457a9db9de4f4f57dab2e5731d", "type": "github" }, "original": { @@ -3030,6 +3067,22 @@ } }, "nixpkgs_12": { + "locked": { + "lastModified": 1644486793, + "narHash": "sha256-EeijR4guVHgVv+JpOX3cQO+1XdrkJfGmiJ9XVsVU530=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1882c6b7368fd284ad01b0a5b5601ef136321292", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_13": { "locked": { "lastModified": 1768564909, "narHash": "sha256-Kell/SpJYVkHWMvnhqJz/8DqQg2b6PguxVWOuadbHCc=", @@ -3045,7 +3098,7 @@ "type": "github" } }, - "nixpkgs_13": { + "nixpkgs_14": { "locked": { "lastModified": 1762111121, "narHash": "sha256-4vhDuZ7OZaZmKKrnDpxLZZpGIJvAeMtK6FKLJYUtAdw=", @@ -3091,6 +3144,22 @@ } }, "nixpkgs_4": { + "locked": { + "lastModified": 1769018530, + "narHash": "sha256-MJ27Cy2NtBEV5tsK+YraYr2g851f3Fl1LpNHDzDX15c=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "88d3861acdd3d2f0e361767018218e51810df8a1", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_5": { "locked": { "lastModified": 1767364772, "narHash": "sha256-fFUnEYMla8b7UKjijLnMe+oVFOz6HjijGGNS1l7dYaQ=", @@ -3106,7 +3175,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_6": { "locked": { "lastModified": 1764950072, "narHash": "sha256-BmPWzogsG2GsXZtlT+MTcAWeDK5hkbGRZTeZNW42fwA=", @@ -3122,7 +3191,7 @@ "type": "github" } }, - "nixpkgs_6": { + "nixpkgs_7": { "locked": { "lastModified": 1748929857, "narHash": "sha256-lcZQ8RhsmhsK8u7LIFsJhsLh/pzR9yZ8yqpTzyGdj+Q=", @@ -3138,7 +3207,7 @@ "type": "github" } }, - "nixpkgs_7": { + "nixpkgs_8": { "locked": { "lastModified": 1768599367, "narHash": "sha256-Wi4Wv7ltAAj7Ik8PGJkpUmpjO+K4eRZsWAEYrDd37YA=", @@ -3154,7 +3223,7 @@ "type": "github" } }, - "nixpkgs_8": { + "nixpkgs_9": { "locked": { "lastModified": 1768564909, "narHash": "sha256-Kell/SpJYVkHWMvnhqJz/8DqQg2b6PguxVWOuadbHCc=", @@ -3170,27 +3239,11 @@ "type": "github" } }, - "nixpkgs_9": { - "locked": { - "lastModified": 1767026758, - "narHash": "sha256-7fsac/f7nh/VaKJ/qm3I338+wAJa/3J57cOGpXi0Sbg=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "346dd96ad74dc4457a9db9de4f4f57dab2e5731d", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "nixvim": { "inputs": { "flake-parts": "flake-parts_7", - "nixpkgs": "nixpkgs_9", - "systems": "systems_19" + "nixpkgs": "nixpkgs_10", + "systems": "systems_20" }, "locked": { "lastModified": 1768910181, @@ -3208,7 +3261,7 @@ }, "nno": { "inputs": { - "flake-utils": "flake-utils_15", + "flake-utils": "flake-utils_16", "neorg": "neorg", "neorg-telescope": "neorg-telescope", "nixpkgs": [ @@ -3234,8 +3287,8 @@ "norg": { "inputs": { "flake-compat": "flake-compat_10", - "flake-utils": "flake-utils_16", - "nixpkgs": "nixpkgs_10" + "flake-utils": "flake-utils_17", + "nixpkgs": "nixpkgs_11" }, "locked": { "lastModified": 1672582520, @@ -3255,8 +3308,8 @@ "norg-meta": { "inputs": { "flake-compat": "flake-compat_11", - "flake-utils": "flake-utils_17", - "nixpkgs": "nixpkgs_11" + "flake-utils": "flake-utils_18", + "nixpkgs": "nixpkgs_12" }, "locked": { "lastModified": 1713028366, @@ -3275,7 +3328,7 @@ "nur": { "inputs": { "flake-parts": "flake-parts_8", - "nixpkgs": "nixpkgs_12" + "nixpkgs": "nixpkgs_13" }, "locked": { "lastModified": 1768940629, @@ -3376,7 +3429,7 @@ "nixpkgs": [ "nixpkgs" ], - "systems": "systems_21" + "systems": "systems_22" }, "locked": { "lastModified": 1756860511, @@ -3512,6 +3565,7 @@ "hyprland": "hyprland", "hyprlock": "hyprlock", "hyprmonitors": "hyprmonitors", + "hytale-launcher": "hytale-launcher", "ik_llama": "ik_llama", "ironbar": "ironbar", "lanzaboote": "lanzaboote", @@ -3525,7 +3579,7 @@ "nix-index-database": "nix-index-database", "nix-minecraft": "nix-minecraft", "nixos-raspberrypi": "nixos-raspberrypi", - "nixpkgs": "nixpkgs_8", + "nixpkgs": "nixpkgs_9", "nixpkgs-master": "nixpkgs-master", "nixpkgs-stable": "nixpkgs-stable", "nixpkgs-xr": "nixpkgs-xr", @@ -3837,7 +3891,7 @@ "nixpkgs" ], "nur": "nur_2", - "systems": "systems_22", + "systems": "systems_23", "tinted-foot": "tinted-foot", "tinted-kitty": "tinted-kitty", "tinted-schemes": "tinted-schemes", @@ -3871,7 +3925,7 @@ "nixpkgs-stable" ], "nur": "nur_3", - "systems": "systems_23", + "systems": "systems_24", "tinted-foot": "tinted-foot_2", "tinted-kitty": "tinted-kitty_2", "tinted-schemes": "tinted-schemes_2", @@ -4029,21 +4083,6 @@ } }, "systems_18": { - "locked": { - "lastModified": 1689347949, - "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", - "owner": "nix-systems", - "repo": "default-linux", - "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default-linux", - "type": "github" - } - }, - "systems_19": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -4058,6 +4097,21 @@ "type": "github" } }, + "systems_19": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, "systems_2": { "locked": { "lastModified": 1681028828, @@ -4193,6 +4247,21 @@ "type": "github" } }, + "systems_28": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "systems_3": { "locked": { "lastModified": 1681028828, @@ -4464,7 +4533,7 @@ "inputs": { "advisory-db": "advisory-db_5", "crane": "crane_6", - "flake-utils": "flake-utils_18", + "flake-utils": "flake-utils_19", "nix-github-actions": "nix-github-actions_4", "nixpkgs": [ "nixpkgs" @@ -4567,7 +4636,7 @@ }, "treefmt-nix": { "inputs": { - "nixpkgs": "nixpkgs_4" + "nixpkgs": "nixpkgs_5" }, "locked": { "lastModified": 1768158989, @@ -4640,8 +4709,8 @@ }, "vicinae": { "inputs": { - "nixpkgs": "nixpkgs_13", - "systems": "systems_25" + "nixpkgs": "nixpkgs_14", + "systems": "systems_26" }, "locked": { "lastModified": 1768856963, @@ -4776,7 +4845,7 @@ "inputs": { "advisory-db": "advisory-db_6", "crane": "crane_7", - "flake-utils": "flake-utils_19", + "flake-utils": "flake-utils_20", "nix-github-actions": "nix-github-actions_5", "nixpkgs": [ "nixpkgs" @@ -4829,7 +4898,7 @@ "zjstatus": { "inputs": { "crane": "crane_8", - "flake-utils": "flake-utils_20", + "flake-utils": "flake-utils_21", "nixpkgs": [ "nixpkgs" ], diff --git a/flake.nix b/flake.nix index 367b73bd..8f648cfb 100644 --- a/flake.nix +++ b/flake.nix @@ -254,6 +254,9 @@ url = "github:christo-auer/eilmeldung"; inputs.nixpkgs.follows = "nixpkgs"; }; + hytale-launcher = { + url = "github:JPyke3/hytale-launcher-nix"; + }; }; outputs = { diff --git a/home/programs/cargo.nix b/home/programs/cargo.nix index a7376335..5508b0a8 100644 --- a/home/programs/cargo.nix +++ b/home/programs/cargo.nix @@ -1,4 +1,10 @@ -{cratesNix, ...}: { +{ + lib, + device, + cratesNix, + ... +}: +lib.mkIf (!device.isServer) { home.file.".cargo/config.toml".text = # toml '' diff --git a/nixos/ryu/games/hytale.nix b/nixos/ryu/games/hytale.nix index 8681f9d2..d76bfd27 100644 --- a/nixos/ryu/games/hytale.nix +++ b/nixos/ryu/games/hytale.nix @@ -1,35 +1,499 @@ +# {pkgs, ...}: let +# version = "2026.01.21-11273a4"; +# hytale-launcher = pkgs.fetchzip { +# url = "https://launcher.hytale.com/builds/release/linux/amd64/hytale-launcher-${version}.zip"; +# sha256 = "sha256-PPdYmLxAVyqSkhulZXLcaEuhofCHZ4JcDJXIQ+lBhFg="; +# }; +# in { +# environment.systemPackages = with pkgs; [ +# # (pkgs.buildFHSEnv { +# # pname = "hytale"; +# # inherit version; +# # targetPkgs = p: +# # with p; [ +# # # Launcher +# # libsoup_3 +# # gdk-pixbuf +# # glib +# # gtk3 +# # webkitgtk_4_1 +# # +# # # Game +# # alsa-lib +# # icu +# # libGL +# # openssl +# # udev +# # xorg.libX11 +# # xorg.libXcursor +# # xorg.libXrandr +# # xorg.libXi +# # ]; +# # runScript = "${hytale-launcher}/hytale-launcher"; +# # }) +# hytale-launcher +# ]; +# } +# +# { pkgs }: +# +# let +# # === AUTO-UPDATE MARKERS - DO NOT MODIFY FORMAT === +# version = "2026.01.24-997c2cb"; +# sha256 = "sha256-G+FFMOtLVPH2zaWQ87jymf6+JUAVFEKA4SMyuYE9MZ0="; +# # === END AUTO-UPDATE MARKERS === +# +# pname = "hytale-launcher"; +# downloadUrl = "https://launcher.hytale.com/builds/release/linux/amd64/hytale-launcher-${version}.zip"; +# +# # Unwrapped derivation - extracts and patches the binary +# hytale-launcher-unwrapped = pkgs.stdenv.mkDerivation { +# pname = "${pname}-unwrapped"; +# inherit version; +# +# src = pkgs.fetchurl { +# url = downloadUrl; +# inherit sha256; +# }; +# +# nativeBuildInputs = with pkgs; [ +# autoPatchelfHook +# unzip +# ]; +# +# unpackPhase = '' +# runHook preUnpack +# unzip $src -d . +# runHook postUnpack +# ''; +# +# buildInputs = with pkgs; [ +# webkitgtk_4_1 +# gtk3 +# glib +# gdk-pixbuf +# libsoup_3 +# cairo +# pango +# at-spi2-atk +# harfbuzz +# glibc +# ]; +# +# runtimeDependencies = with pkgs; [ +# libGL +# libxkbcommon +# xorg.libX11 +# xorg.libXcomposite +# xorg.libXdamage +# xorg.libXext +# xorg.libXfixes +# xorg.libXrandr +# ]; +# +# # No build phase needed - just unpack and install +# dontBuild = true; +# +# installPhase = '' +# runHook preInstall +# +# mkdir -p $out/lib/hytale-launcher +# install -m755 hytale-launcher $out/lib/hytale-launcher/ +# +# runHook postInstall +# ''; +# +# meta = with pkgs.lib; { +# description = "Official launcher for Hytale game (unwrapped)"; +# homepage = "https://hytale.com"; +# license = licenses.unfree; +# sourceProvenance = with sourceTypes; [ binaryNativeCode ]; +# maintainers = [{ +# name = "Jacob Pyke"; +# email = "github@pyk.ee"; +# github = "JPyke3"; +# githubId = 13283054; +# }]; +# platforms = [ "x86_64-linux" ]; +# }; +# }; +# +# # FHS-wrapped derivation - allows self-updates to work +# hytale-launcher = pkgs.buildFHSEnv { +# name = "hytale-launcher"; +# inherit version; +# +# targetPkgs = pkgs: with pkgs; [ +# # Core dependencies +# hytale-launcher-unwrapped +# +# # WebKit/GTK stack (for launcher UI) +# webkitgtk_4_1 +# gtk3 +# glib +# gdk-pixbuf +# libsoup_3 +# cairo +# pango +# at-spi2-atk +# harfbuzz +# +# # Graphics - OpenGL/Vulkan/EGL (for game client via SDL3) +# libGL +# libGLU +# libglvnd +# mesa +# vulkan-loader +# egl-wayland +# +# # X11 (SDL3 dlopens these) +# xorg.libX11 +# xorg.libXcomposite +# xorg.libXdamage +# xorg.libXext +# xorg.libXfixes +# xorg.libXrandr +# xorg.libXcursor +# xorg.libXi +# xorg.libxcb +# xorg.libXScrnSaver +# xorg.libXinerama +# xorg.libXxf86vm +# +# # Wayland (SDL3 can use Wayland backend) +# wayland +# libxkbcommon +# +# # Audio (for game client via bundled OpenAL) +# alsa-lib +# pipewire +# pulseaudio +# +# # System libraries +# dbus +# fontconfig +# freetype +# glibc +# nspr +# nss +# systemd +# zlib +# +# # C++ runtime (needed by libNoesis.so, libopenal.so in game client) +# stdenv.cc.cc.lib +# +# # .NET runtime dependencies (HytaleClient is a .NET application) +# icu +# openssl +# krb5 +# +# # TLS/SSL support for GLib networking (launcher) +# glib-networking +# cacert +# ]; +# +# runScript = pkgs.writeShellScript "hytale-launcher-wrapper" '' +# # Hytale data directory +# LAUNCHER_DIR="''${XDG_DATA_HOME:-$HOME/.local/share}/Hytale" +# LAUNCHER_BIN="$LAUNCHER_DIR/hytale-launcher" +# BUNDLED_HASH_FILE="$LAUNCHER_DIR/.bundled_hash" +# BUNDLED_BIN="${hytale-launcher-unwrapped}/lib/hytale-launcher/hytale-launcher" +# +# mkdir -p "$LAUNCHER_DIR" +# +# # Compute hash of bundled binary to detect Nix package updates +# BUNDLED_HASH=$(sha256sum "$BUNDLED_BIN" | cut -d" " -f1) +# +# # Copy bundled binary if needed (new install or Nix package update) +# if [ ! -x "$LAUNCHER_BIN" ] || [ ! -f "$BUNDLED_HASH_FILE" ] || [ "$(cat "$BUNDLED_HASH_FILE")" != "$BUNDLED_HASH" ]; then +# install -m755 "$BUNDLED_BIN" "$LAUNCHER_BIN" +# echo "$BUNDLED_HASH" > "$BUNDLED_HASH_FILE" +# fi +# +# # Required environment variable from Flatpak metadata +# export WEBKIT_DISABLE_COMPOSITING_MODE=1 +# +# # Enable GLib TLS backend (glib-networking) +# export GIO_MODULE_DIR=/usr/lib/gio/modules +# +# # SSL certificates +# export SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt +# +# exec "$LAUNCHER_BIN" "$@" +# ''; +# +# extraInstallCommands = '' +# # Install desktop file +# mkdir -p $out/share/applications +# cat > $out/share/applications/hytale-launcher.desktop << EOF +# [Desktop Entry] +# Name=Hytale Launcher +# Comment=Official launcher for Hytale +# Exec=$out/bin/hytale-launcher +# Icon=hytale-launcher +# Terminal=false +# Type=Application +# Categories=Game; +# Keywords=hytale;game;launcher;hypixel; +# StartupWMClass=com.hypixel.HytaleLauncher +# EOF +# +# ''; +# +# meta = with pkgs.lib; { +# description = "Official launcher for Hytale game"; +# longDescription = '' +# The official launcher for Hytale, developed by Hypixel Studios. +# This package wraps the launcher from the official distribution, +# providing FHS compatibility for self-updates. +# ''; +# homepage = "https://hytale.com"; +# license = licenses.unfree; +# sourceProvenance = with sourceTypes; [ binaryNativeCode ]; +# maintainers = [{ +# name = "Jacob Pyke"; +# email = "github@pyk.ee"; +# github = "JPyke3"; +# githubId = 13283054; +# }]; +# platforms = [ "x86_64-linux" ]; +# mainProgram = "hytale-launcher"; +# }; +# }; +# +# in { +# inherit hytale-launcher hytale-launcher-unwrapped; +# } {pkgs, ...}: let - version = "2026.01.21-11273a4"; - hytale-launcher = pkgs.fetchzip { - url = "https://launcher.hytale.com/builds/release/linux/amd64/hytale-launcher-${version}.zip"; - sha256 = "sha256-PPdYmLxAVyqSkhulZXLcaEuhofCHZ4JcDJXIQ+lBhFg="; + # === AUTO-UPDATE MARKERS - DO NOT MODIFY FORMAT === + version = "2026.01.24-997c2cb"; + sha256 = "sha256-G+FFMOtLVPH2zaWQ87jymf6+JUAVFEKA4SMyuYE9MZ0="; + # === END AUTO-UPDATE MARKERS === + + pname = "hytale-launcher"; + downloadUrl = "https://launcher.hytale.com/builds/release/linux/amd64/hytale-launcher-${version}.zip"; + + # Unwrapped derivation - extracts and patches the binary + hytale-launcher-unwrapped = pkgs.stdenv.mkDerivation { + pname = "${pname}-unwrapped"; + inherit version; + + src = pkgs.fetchurl { + url = downloadUrl; + inherit sha256; + }; + + nativeBuildInputs = with pkgs; [ + autoPatchelfHook + unzip + ]; + + unpackPhase = '' + runHook preUnpack + unzip $src -d . + runHook postUnpack + ''; + + buildInputs = with pkgs; [ + webkitgtk_4_1 + gtk3 + glib + gdk-pixbuf + libsoup_3 + cairo + pango + at-spi2-atk + harfbuzz + glibc + ]; + + runtimeDependencies = with pkgs; [ + libGL + libxkbcommon + # xorg.libX11 + # xorg.libXcomposite + # xorg.libXdamage + # xorg.libXext + # xorg.libXfixes + # xorg.libXrandr + ]; + + # No build phase needed - just unpack and install + dontBuild = true; + + installPhase = '' + runHook preInstall + + mkdir -p $out/lib/hytale-launcher + install -m755 hytale-launcher $out/lib/hytale-launcher/ + + runHook postInstall + ''; + + meta = with pkgs.lib; { + description = "Official launcher for Hytale game (unwrapped)"; + homepage = "https://hytale.com"; + license = licenses.unfree; + sourceProvenance = with sourceTypes; [binaryNativeCode]; + maintainers = [ + { + name = "Jacob Pyke"; + email = "github@pyk.ee"; + github = "JPyke3"; + githubId = 13283054; + } + ]; + platforms = ["x86_64-linux"]; + }; + }; + + # FHS-wrapped derivation - allows self-updates to work + hytale-launcher = pkgs.buildFHSEnv { + name = "hytale-launcher"; + inherit version; + + targetPkgs = pkgs: + with pkgs; [ + # Core dependencies + hytale-launcher-unwrapped + + # WebKit/GTK stack (for launcher UI) + webkitgtk_4_1 + gtk3 + glib + gdk-pixbuf + libsoup_3 + cairo + pango + at-spi2-atk + harfbuzz + + # Graphics - OpenGL/Vulkan/EGL (for game client via SDL3) + libGL + libGLU + libglvnd + mesa + vulkan-loader + egl-wayland + + # X11 (SDL3 dlopens these) + # xorg.libX11 + # xorg.libXcomposite + # xorg.libXdamage + # xorg.libXext + # xorg.libXfixes + # xorg.libXrandr + # xorg.libXcursor + # xorg.libXi + # xorg.libxcb + # xorg.libXScrnSaver + # xorg.libXinerama + # xorg.libXxf86vm + + # Wayland (SDL3 can use Wayland backend) + wayland + libxkbcommon + + # Audio (for game client via bundled OpenAL) + alsa-lib + pipewire + pulseaudio + + # System libraries + dbus + fontconfig + freetype + glibc + nspr + nss + systemd + zlib + + # C++ runtime (needed by libNoesis.so, libopenal.so in game client) + stdenv.cc.cc.lib + + # .NET runtime dependencies (HytaleClient is a .NET application) + icu + openssl + krb5 + + # TLS/SSL support for GLib networking (launcher) + glib-networking + cacert + ]; + + runScript = pkgs.writeShellScript "hytale-launcher-wrapper" '' + # Hytale data directory + LAUNCHER_DIR="''${XDG_DATA_HOME:-$HOME/.local/share}/Hytale" + LAUNCHER_BIN="$LAUNCHER_DIR/hytale-launcher" + BUNDLED_HASH_FILE="$LAUNCHER_DIR/.bundled_hash" + BUNDLED_BIN="${hytale-launcher-unwrapped}/lib/hytale-launcher/hytale-launcher" + + mkdir -p "$LAUNCHER_DIR" + + # Compute hash of bundled binary to detect Nix package updates + BUNDLED_HASH=$(sha256sum "$BUNDLED_BIN" | cut -d" " -f1) + + # Copy bundled binary if needed (new install or Nix package update) + if [ ! -x "$LAUNCHER_BIN" ] || [ ! -f "$BUNDLED_HASH_FILE" ] || [ "$(cat "$BUNDLED_HASH_FILE")" != "$BUNDLED_HASH" ]; then + install -m755 "$BUNDLED_BIN" "$LAUNCHER_BIN" + echo "$BUNDLED_HASH" > "$BUNDLED_HASH_FILE" + fi + + # Required environment variable from Flatpak metadata + export WEBKIT_DISABLE_COMPOSITING_MODE=1 + + # Enable GLib TLS backend (glib-networking) + export GIO_MODULE_DIR=/usr/lib/gio/modules + + # SSL certificates + export SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt + + exec "$LAUNCHER_BIN" "$@" + ''; + + extraInstallCommands = '' + # Install desktop file + mkdir -p $out/share/applications + cat > $out/share/applications/hytale-launcher.desktop << EOF + [Desktop Entry] + Name=Hytale Launcher + Comment=Official launcher for Hytale + Exec=$out/bin/hytale-launcher + Icon=hytale-launcher + Terminal=false + Type=Application + Categories=Game; + Keywords=hytale;game;launcher;hypixel; + StartupWMClass=com.hypixel.HytaleLauncher + EOF + + ''; + + meta = with pkgs.lib; { + description = "Official launcher for Hytale game"; + longDescription = '' + The official launcher for Hytale, developed by Hypixel Studios. + This package wraps the launcher from the official distribution, + providing FHS compatibility for self-updates. + ''; + homepage = "https://hytale.com"; + license = licenses.unfree; + sourceProvenance = with sourceTypes; [binaryNativeCode]; + maintainers = [ + { + name = "Jacob Pyke"; + email = "github@pyk.ee"; + github = "JPyke3"; + githubId = 13283054; + } + ]; + platforms = ["x86_64-linux"]; + mainProgram = "hytale-launcher"; + }; }; in { environment.systemPackages = with pkgs; [ - (pkgs.buildFHSEnv { - pname = "hytale"; - inherit version; - targetPkgs = p: - with p; [ - # Launcher - libsoup_3 - gdk-pixbuf - glib - gtk3 - webkitgtk_4_1 - - # Game - alsa-lib - icu - libGL - openssl - udev - xorg.libX11 - xorg.libXcursor - xorg.libXrandr - xorg.libXi - ]; - runScript = "${hytale-launcher}/hytale-launcher"; - }) + hytale-launcher ]; } diff --git a/nixos/tsuba/default.nix b/nixos/tsuba/default.nix index f2ff6487..d4b6a515 100644 --- a/nixos/tsuba/default.nix +++ b/nixos/tsuba/default.nix @@ -3,6 +3,7 @@ inputs, overlays, home-manager-stable, + nixpkgs, nur, nixos-raspberrypi, ... @@ -15,6 +16,7 @@ inherit device; unstablePkgs = inputs.nixpkgs.legacyPackages.${device.system}; masterPkgs = inputs.nixpkgs-master.legacyPackages.${device.system}; + cratesNix = inputs.crates-nix.mkLib {pkgs = nixpkgs.legacyPackages.${device.system};}; }; system = device.system; modules = [ @@ -40,6 +42,7 @@ inherit inputs; inherit device; stablePkgs = inputs.nixpkgs-stable.legacyPackages.${device.system}; + cratesNix = inputs.crates-nix.mkLib {pkgs = nixpkgs.legacyPackages.${device.system};}; }; users.${device.user}.imports = [ inputs.nixvim.homeModules.nixvim diff --git a/overlays.nix b/overlays.nix index 8b8094ba..48c293d7 100644 --- a/overlays.nix +++ b/overlays.nix @@ -273,8 +273,12 @@ # }); wivrn-nightly = inputs.wivrn.packages.${prev.system}.default; }; + games = final: prev: { + hytale-launcher = inputs.hytale-launcher.packages.${prev.system}.default; + }; in [ + games vr anyrun-overlay catppuccinThemes