commit 090be72af8e66b0857bb7f67487197d136d00bf1 Author: lelgenio Date: Fri May 19 10:45:20 2023 -0300 Initial commit diff --git a/TL_mcl.jar b/TL_mcl.jar new file mode 100644 index 0000000..a9af050 Binary files /dev/null and b/TL_mcl.jar differ diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..ab285c4 --- /dev/null +++ b/default.nix @@ -0,0 +1,33 @@ +{ lib +, stdenv +, makeWrapper +, jre +, gnome +, writeShellScript +}: +let + warnScript = writeShellScript "warn-tlauncher-jre-version" '' + if ! test -d "$HOME/.tlauncher"; then + ${gnome.zenity}/bin/zenity --warning \ + --text="On Tlauncher settings, set Java/JRE to 'Current only', otherwise minecraft will fail to launch." + fi + ''; +in +stdenv.mkDerivation rec { + name = "tlauncher"; + + src = ./TL_mcl.jar; + dontUnpack = true; + + nativeBuildInputs = [ makeWrapper ]; + runtimeDeps = [ jre ]; + + installPhase = '' + install -Dm555 $src $out/share/tlauncher/tlauncher.jar + makeWrapper "${jre}/bin/java" "$out/bin/tlauncher" \ + --run ${warnScript} \ + --add-flags "-jar $out/share/tlauncher/tlauncher.jar" \ + --prefix PATH : ${lib.makeBinPath runtimeDeps} \ + --set _JAVA_AWT_WM_NONREPARENTING 1 + ''; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..0dbf7eb --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1681202837, + "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1684498716, + "narHash": "sha256-PSdaOLRJc5I0SrkYAduNmPaOIex7tvhyJUGkUJl98hM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5d84cfdf23eb4de685dd6475bad8b60ba0560065", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "release-22.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..c8856dc --- /dev/null +++ b/flake.nix @@ -0,0 +1,23 @@ +{ + description = "A very basic flake"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/release-22.11"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { + inherit system; + }; + inherit (pkgs) lib stdenv makeWrapper jre; + in + { + packages = rec { + default = tlauncher; + tlauncher = pkgs.callPackage ./. { }; + }; + }); +}