2024-02-15 21:36:55 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
rustPlatform,
|
|
|
|
buildGoModule,
|
|
|
|
cargo-tauri,
|
2024-06-07 22:36:58 +00:00
|
|
|
darwin,
|
2024-02-15 21:36:55 +00:00
|
|
|
desktop-file-utils,
|
|
|
|
esbuild,
|
|
|
|
libsoup,
|
2024-06-07 22:36:58 +00:00
|
|
|
nix-update-script,
|
2024-06-26 08:08:39 +00:00
|
|
|
nodejs,
|
2024-02-15 21:36:55 +00:00
|
|
|
openssl,
|
|
|
|
pkg-config,
|
2024-06-07 22:36:58 +00:00
|
|
|
pnpm_8,
|
|
|
|
webkitgtk_4_0, }:
|
|
|
|
|
|
|
|
let
|
|
|
|
pnpm = pnpm_8;
|
|
|
|
in
|
2024-06-07 21:46:07 +00:00
|
|
|
rustPlatform.buildRustPackage rec {
|
2024-02-15 21:36:55 +00:00
|
|
|
pname = "modrinth-app-unwrapped";
|
|
|
|
version = "0.7.1";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "modrinth";
|
2024-06-07 22:36:58 +00:00
|
|
|
repo = "code";
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-09-14 21:47:11 +00:00
|
|
|
hash = "sha256-JWR0e2vOBvOLosr22Oo2mAlR0KAhL+261RRybhNctlM=";
|
2024-02-15 21:36:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
outputHashes = {
|
|
|
|
"tauri-plugin-single-instance-0.0.0" = "sha256-Mf2/cnKotd751ZcSHfiSLNe2nxBfo4dMBdoCwQhe7yI=";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-06-07 22:36:58 +00:00
|
|
|
pnpmDeps = pnpm.fetchDeps {
|
2024-06-07 21:46:07 +00:00
|
|
|
inherit pname version src;
|
|
|
|
sourceRoot = "${src.name}/theseus_gui";
|
|
|
|
hash = "sha256-g/uUGfC9TQh0LE8ed51oFY17FySoeTvfaeEpzpNeMao=";
|
|
|
|
};
|
|
|
|
pnpmRoot = "theseus_gui";
|
2024-02-15 21:36:55 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2024-08-18 09:48:10 +00:00
|
|
|
cargo-tauri.hook
|
2024-02-15 21:36:55 +00:00
|
|
|
desktop-file-utils
|
2024-06-26 08:08:39 +00:00
|
|
|
nodejs
|
2024-02-15 21:36:55 +00:00
|
|
|
pkg-config
|
2024-06-07 22:36:58 +00:00
|
|
|
pnpm.configHook
|
2024-02-15 21:36:55 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs =
|
|
|
|
[ openssl ]
|
|
|
|
++ lib.optionals stdenv.hostPlatform.isLinux [
|
|
|
|
libsoup
|
2024-10-05 01:00:54 +00:00
|
|
|
webkitgtk_4_0
|
2024-02-15 21:36:55 +00:00
|
|
|
]
|
|
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin (
|
|
|
|
with darwin.apple_sdk.frameworks;
|
|
|
|
[
|
|
|
|
AppKit
|
|
|
|
CoreServices
|
|
|
|
Security
|
|
|
|
WebKit
|
|
|
|
]
|
|
|
|
);
|
|
|
|
|
|
|
|
env = {
|
|
|
|
ESBUILD_BINARY_PATH = lib.getExe (
|
|
|
|
esbuild.override {
|
2024-06-07 22:36:58 +00:00
|
|
|
buildGoModule =
|
|
|
|
args:
|
|
|
|
buildGoModule (
|
|
|
|
args
|
|
|
|
// rec {
|
|
|
|
version = "0.20.2";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "evanw";
|
|
|
|
repo = "esbuild";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-h/Vqwax4B4nehRP9TaYbdixAZdb1hx373dNxNHvDrtY=";
|
|
|
|
};
|
|
|
|
vendorHash = "sha256-+BfxCyg0KkDQpHt/wycy/8CTG6YBA/VJvJFhhzUnSiQ=";
|
|
|
|
}
|
|
|
|
);
|
2024-02-15 21:36:55 +00:00
|
|
|
}
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2024-08-18 09:48:10 +00:00
|
|
|
postInstall =
|
|
|
|
lib.optionalString stdenv.hostPlatform.isDarwin ''
|
2024-02-15 21:36:55 +00:00
|
|
|
mv "$out"/Applications/Modrinth\ App.app/Contents/MacOS/Modrinth\ App "$out"/bin/modrinth-app
|
|
|
|
ln -s "$out"/bin/modrinth-app "$out"/Applications/Modrinth\ App.app/Contents/MacOS/Modrinth\ App
|
|
|
|
''
|
|
|
|
+ lib.optionalString stdenv.hostPlatform.isLinux ''
|
|
|
|
desktop-file-edit \
|
|
|
|
--set-comment "Modrinth's game launcher" \
|
|
|
|
--set-key="StartupNotify" --set-value="true" \
|
|
|
|
--set-key="Categories" --set-value="Game;ActionGame;AdventureGame;Simulation;" \
|
|
|
|
--set-key="Keywords" --set-value="game;minecraft;mc;" \
|
|
|
|
--set-key="StartupWMClass" --set-value="ModrinthApp" \
|
|
|
|
$out/share/applications/modrinth-app.desktop
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
updateScript = nix-update-script { };
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Modrinth's game launcher";
|
|
|
|
longDescription = ''
|
|
|
|
A unique, open source launcher that allows you to play your favorite mods,
|
|
|
|
and keep them up to date, all in one neat little package
|
|
|
|
'';
|
|
|
|
homepage = "https://modrinth.com";
|
2024-06-07 22:36:58 +00:00
|
|
|
changelog = "https://github.com/modrinth/theseus/releases/tag/v${version}";
|
2024-02-15 21:36:55 +00:00
|
|
|
license = with lib.licenses; [
|
|
|
|
gpl3Plus
|
|
|
|
unfreeRedistributable
|
|
|
|
];
|
|
|
|
maintainers = with lib.maintainers; [ getchoo ];
|
2024-06-07 22:36:58 +00:00
|
|
|
platforms = with lib; platforms.linux ++ platforms.darwin;
|
2024-02-15 21:36:55 +00:00
|
|
|
# this builds on architectures like aarch64, but the launcher itself does not support them yet
|
|
|
|
broken = !stdenv.hostPlatform.isx86_64;
|
|
|
|
};
|
|
|
|
}
|