mochi/nixos/packages/modrinth/default.nix

124 lines
2.5 KiB
Nix
Raw Normal View History

2025-02-28 16:57:17 -06:00
{
atk,
bzip2,
2025-02-28 22:45:12 -06:00
cacert,
2025-02-28 16:57:17 -06:00
cairo,
2025-02-28 22:45:12 -06:00
cargo-tauri,
darwin,
2025-02-28 16:57:17 -06:00
dbus,
2025-02-28 22:45:12 -06:00
desktop-file-utils,
fetchFromGitHub,
2025-02-28 16:57:17 -06:00
gdk-pixbuf,
glib,
gtk3,
2025-02-28 22:45:12 -06:00
lib,
2025-02-28 16:57:17 -06:00
libsoup_3,
2025-02-28 22:45:12 -06:00
nodejs,
2025-02-28 16:57:17 -06:00
openssl,
pango,
2025-02-28 22:45:12 -06:00
pkg-config,
pnpm_9,
2025-02-28 16:57:17 -06:00
rust-jemalloc-sys,
2025-02-28 22:45:12 -06:00
rustPlatform,
2025-02-28 16:57:17 -06:00
sqlite,
stdenv,
2025-02-28 22:45:12 -06:00
turbo,
2025-02-28 16:57:17 -06:00
wayland,
webkitgtk_4_1,
2025-02-28 22:45:12 -06:00
wrapGAppsHook,
xz,
zstd,
2025-02-28 16:57:17 -06:00
}: let
pnpm = pnpm_9;
2025-02-28 22:45:12 -06:00
webkitgtk = webkitgtk_4_1;
2025-02-28 16:57:17 -06:00
in
rustPlatform.buildRustPackage rec {
pname = "modrinth-app";
version = "0.9.3";
src = fetchFromGitHub {
owner = "modrinth";
repo = "code";
rev = "v${version}";
hash = "sha256-h+zj4Hm7v8SU6Zy0rIWbOknXVdSDf8b1d4q6M12J5Lc=";
};
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"wry-0.47.2" = "sha256-zb/BX2UU3Hw87H0m+l3wl6YnCroC+93xMMr+SGl532w=";
};
};
pnpmDeps = pnpm.fetchDeps {
inherit pname version src;
hash = "sha256-nFuPFgwJw38XVxhW0QXmU31o+hqJKGJysnPg2YSg2D0=";
};
nativeBuildInputs = [
pkg-config
wrapGAppsHook
cacert # Required for turbo
cargo-tauri.hook
desktop-file-utils
nodejs
pnpm.configHook
];
buildInputs =
[
atk
bzip2
cairo
dbus
gdk-pixbuf
glib
gtk3
libsoup_3
openssl
pango
rust-jemalloc-sys
sqlite
webkitgtk
xz
zstd
]
++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.AppKit
darwin.apple_sdk.frameworks.CoreFoundation
darwin.apple_sdk.frameworks.CoreGraphics
darwin.apple_sdk.frameworks.CoreServices
darwin.apple_sdk.frameworks.Foundation
darwin.apple_sdk.frameworks.IOKit
darwin.apple_sdk.frameworks.Security
darwin.apple_sdk.frameworks.SystemConfiguration
]
++ lib.optionals stdenv.isLinux [
wayland
webkitgtk_4_1
];
# Tests fail on other, unrelated packages in the monorepo
cargoTestFlags = [
"--package"
"theseus_gui"
];
env = {
2025-02-28 22:45:12 -06:00
# OPENSSL_NO_VENDOR = true;
# ZSTD_SYS_USE_PKG_CONFIG = true;
TURBO_BINARY_PATH = lib.getExe turbo;
2025-02-28 16:57:17 -06:00
};
meta = {
description = "The Modrinth monorepo containing all code which powers Modrinth";
homepage = "https://github.com/modrinth/code";
2025-02-28 22:45:12 -06:00
license = with lib.licenses; [
gpl3Plus
unfreeRedistributable
];
2025-02-28 16:57:17 -06:00
maintainers = with lib.maintainers; [];
mainProgram = "modrinth-app";
};
}