Initial commit

This commit is contained in:
lelgenio 2023-05-19 10:45:20 -03:00
commit 090be72af8
4 changed files with 117 additions and 0 deletions

BIN
TL_mcl.jar Normal file

Binary file not shown.

33
default.nix Normal file
View file

@ -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
'';
}

61
flake.lock Normal file
View file

@ -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
}

23
flake.nix Normal file
View file

@ -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 ./. { };
};
});
}