From a5f696d8e0b691cc20a36dac0385626acb0d1c87 Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Tue, 28 Jan 2025 21:11:56 +0100 Subject: [PATCH] Add fjordlauncher --- overlay.nix | 5 ++++- .../01-authlib-enforcement.patch | 19 +++++++++++++++++++ pkgs/fjordlauncher/unwrapped.nix | 15 +++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 pkgs/fjordlauncher/01-authlib-enforcement.patch create mode 100644 pkgs/fjordlauncher/unwrapped.nix diff --git a/overlay.nix b/overlay.nix index fdf564d..b037e96 100644 --- a/overlay.nix +++ b/overlay.nix @@ -1,8 +1,11 @@ final: prev: let table = final.callPackage ./table.nix { }; -in { +in rec { requireFile = { ... }@args: let hash = args.hash or args.sha256 or args.sha1; in table.${hash} or (prev.requireFile args); + + fjordlauncher-unwrapped = import ./pkgs/fjordlauncher/unwrapped.nix final prev; + fjordlauncher = final.prismlauncher.override { prismlauncher-unwrapped = fjordlauncher-unwrapped; }; } diff --git a/pkgs/fjordlauncher/01-authlib-enforcement.patch b/pkgs/fjordlauncher/01-authlib-enforcement.patch new file mode 100644 index 0000000..1843094 --- /dev/null +++ b/pkgs/fjordlauncher/01-authlib-enforcement.patch @@ -0,0 +1,19 @@ +diff --git a/launcher/ui/pages/global/AccountListPage.cpp b/launcher/ui/pages/global/AccountListPage.cpp +index 384af07fe..c3f3601df 100644 +--- a/launcher/ui/pages/global/AccountListPage.cpp ++++ b/launcher/ui/pages/global/AccountListPage.cpp +@@ -135,12 +135,11 @@ void AccountListPage::listChanged() + void AccountListPage::on_actionAddAuthlibInjector_triggered() + { + if (!m_accounts->anyAccountIsValid()) { +- QMessageBox::warning(this, tr("Error"), +- tr("You must add a Microsoft account that owns Minecraft before you can add an account on a custom " ++ QMessageBox::warning(this, tr("Warning"), ++ tr("You should have a license for minecraft before adding an account on a custom " + "authentication server." + "

" + "If you have lost your account you can contact Microsoft for support.")); +- return; + } + + MinecraftAccountPtr account = AuthlibInjectorLoginDialog::newAccount( diff --git a/pkgs/fjordlauncher/unwrapped.nix b/pkgs/fjordlauncher/unwrapped.nix new file mode 100644 index 0000000..e1196e5 --- /dev/null +++ b/pkgs/fjordlauncher/unwrapped.nix @@ -0,0 +1,15 @@ +final: prev: + +final.prismlauncher-unwrapped.overrideAttrs (oldAttrs: rec { + pname = "fjordlauncher-unwrapped"; + version = "9.2.1"; + + src = final.fetchFromGitHub { + owner = "unmojang"; + repo = "FjordLauncher"; + tag = version; + hash = "sha256-4imIXuVrrihoJVVAmEt7ZBhgqdDzzXsSo6zaMy0xV9o="; + }; + + patches = [ ./01-authlib-enforcement.patch ]; +})