2024-02-15 21:36:55 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
2024-11-14 23:41:19 +00:00
|
|
|
apple-sdk_11,
|
2024-08-22 07:49:37 +00:00
|
|
|
cacert,
|
2024-11-15 01:15:49 +00:00
|
|
|
cargo-tauri,
|
2024-02-15 21:36:55 +00:00
|
|
|
desktop-file-utils,
|
2024-11-14 23:41:19 +00:00
|
|
|
fetchFromGitHub,
|
2024-11-15 01:15:49 +00:00
|
|
|
makeBinaryWrapper,
|
2024-06-26 08:08:39 +00:00
|
|
|
nodejs,
|
2024-02-15 21:36:55 +00:00
|
|
|
openssl,
|
|
|
|
pkg-config,
|
2024-08-22 07:49:37 +00:00
|
|
|
pnpm_9,
|
2024-11-14 23:41:19 +00:00
|
|
|
rustPlatform,
|
2024-08-22 07:49:37 +00:00
|
|
|
turbo,
|
2024-11-15 01:15:49 +00:00
|
|
|
webkitgtk_4_1,
|
2024-08-22 07:49:37 +00:00
|
|
|
}:
|
2024-06-07 22:36:58 +00:00
|
|
|
|
|
|
|
let
|
2024-08-22 07:49:37 +00:00
|
|
|
pnpm = pnpm_9;
|
2024-06-07 22:36:58 +00:00
|
|
|
in
|
2024-06-07 21:46:07 +00:00
|
|
|
rustPlatform.buildRustPackage rec {
|
2024-02-15 21:36:55 +00:00
|
|
|
pname = "modrinth-app-unwrapped";
|
2024-11-15 01:15:49 +00:00
|
|
|
version = "0.8.9";
|
2024-02-15 21:36:55 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "modrinth";
|
2024-06-07 22:36:58 +00:00
|
|
|
repo = "code";
|
2024-11-15 01:15:49 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-DR1aPbSqAVhL/m/Maa3mPzNWwK4A1WvDd/PwEMVYn5g=";
|
2024-02-15 21:36:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
outputHashes = {
|
2024-11-15 01:15:49 +00:00
|
|
|
"wry-0.44.1" = "sha256-I1qkUVTu+Yqk1Imo1w5rG/lRSPLITF5BdcjBsPe+jXU=";
|
2024-02-15 21:36:55 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-06-07 22:36:58 +00:00
|
|
|
pnpmDeps = pnpm.fetchDeps {
|
2024-06-07 21:46:07 +00:00
|
|
|
inherit pname version src;
|
2024-11-15 01:15:49 +00:00
|
|
|
hash = "sha256-murZ82LV2pGng/Cg08NoWr/mDIVECrf00utVrs6PKRg=";
|
2024-06-07 21:46:07 +00:00
|
|
|
};
|
2024-02-15 21:36:55 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2024-11-15 01:15:49 +00:00
|
|
|
cacert # Required for turbo
|
|
|
|
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-11-15 01:15:49 +00:00
|
|
|
] ++ lib.optional stdenv.hostPlatform.isDarwin makeBinaryWrapper;
|
2024-02-15 21:36:55 +00:00
|
|
|
|
|
|
|
buildInputs =
|
|
|
|
[ openssl ]
|
2024-11-14 23:41:19 +00:00
|
|
|
++ lib.optional stdenv.hostPlatform.isDarwin apple-sdk_11
|
2024-11-15 01:15:49 +00:00
|
|
|
++ lib.optional stdenv.hostPlatform.isLinux webkitgtk_4_1;
|
2024-02-15 21:36:55 +00:00
|
|
|
|
|
|
|
env = {
|
2024-08-22 07:49:37 +00:00
|
|
|
TURBO_BINARY_PATH = lib.getExe turbo;
|
2024-02-15 21:36:55 +00:00
|
|
|
};
|
|
|
|
|
2024-08-18 09:48:10 +00:00
|
|
|
postInstall =
|
|
|
|
lib.optionalString stdenv.hostPlatform.isDarwin ''
|
2024-11-15 01:15:49 +00:00
|
|
|
makeBinaryWrapper "$out"/Applications/Modrinth\ App.app/Contents/MacOS/Modrinth\ App "$out"/bin/ModrinthApp
|
2024-02-15 21:36:55 +00:00
|
|
|
''
|
|
|
|
+ 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" \
|
2024-11-15 01:15:49 +00:00
|
|
|
$out/share/applications/Modrinth\ App.desktop
|
2024-02-15 21:36:55 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
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";
|
|
|
|
license = with lib.licenses; [
|
|
|
|
gpl3Plus
|
|
|
|
unfreeRedistributable
|
|
|
|
];
|
|
|
|
maintainers = with lib.maintainers; [ getchoo ];
|
2024-11-15 01:15:49 +00:00
|
|
|
mainProgram = "ModrinthApp";
|
2024-06-07 22:36:58 +00:00
|
|
|
platforms = with lib; platforms.linux ++ platforms.darwin;
|
2024-10-02 10:30:39 +00:00
|
|
|
# This builds on architectures like aarch64, but the launcher itself does not support them yet.
|
|
|
|
# Darwin is the only exception
|
|
|
|
# See https://github.com/modrinth/code/issues/776#issuecomment-1742495678
|
|
|
|
broken = !stdenv.hostPlatform.isx86_64 && !stdenv.hostPlatform.isDarwin;
|
2024-02-15 21:36:55 +00:00
|
|
|
};
|
|
|
|
}
|