nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildDotnetModule,
4 fetchFromGitHub,
5 dotnetCorePackages,
6 makeDesktopItem,
7 copyDesktopItems,
8 libX11,
9 glew,
10 libGL,
11 libICE,
12 libSM,
13 libXcursor,
14 libXext,
15 libXi,
16 libXrandr,
17}:
18buildDotnetModule (finalAttrs: {
19 pname = "Tkmm";
20 version = "2.0.0-beta3";
21
22 src = fetchFromGitHub {
23 owner = "TKMM-Team";
24 repo = "Tkmm";
25 tag = "v${finalAttrs.version}";
26 hash = "sha256-XdnNKnusvWhNy/0rQCULft6ztsB/nhTeQiN4F9LmxJE=";
27 fetchSubmodules = true;
28 };
29
30 patches = [ ./patchTk.diff ];
31
32 selfContainedBuild = true;
33
34 dotnet-sdk = dotnetCorePackages.sdk_9_0;
35 dotnet-runtime = dotnetCorePackages.runtime_9_0;
36 projectFile = [
37 "src/Tkmm/Tkmm.csproj"
38 "src/Tkmm.CLI/Tkmm.CLI.csproj"
39 ];
40 nugetDeps = ./deps.json;
41 executables = [
42 "Tkmm"
43 "Tkmm.CLI"
44 ];
45
46 nativeBuildInputs = [ copyDesktopItems ];
47
48 runtimeDeps = [
49 # Avalonia UI
50 libX11
51 libGL
52 glew
53 libICE
54 libSM
55 libXcursor
56 libXext
57 libXi
58 libXrandr
59 ];
60
61 enableParallelBuilding = false;
62 dotnetFlags = [
63 ''-p:DefineConstants="READONLY_FS"''
64 ];
65
66 postInstall = ''
67 install -D distribution/appimage/tkmm.svg $out/share/icons/hicolor/scalable/apps/tkmm.svg
68 '';
69
70 desktopItems = [
71 (makeDesktopItem {
72 name = "Tears of the Kingdom Mod Manager";
73 exec = "Tkmm";
74 icon = "tkmm";
75 desktopName = "TKMM";
76 categories = [
77 "Game"
78 ];
79 comment = "Tears of the Kingdom Mod Manager";
80 })
81 ];
82
83 meta = {
84 description = "Tears of the Kingdom Mod Manager, a mod merger and manager for TotK";
85 homepage = "https://tkmm.org/";
86 license = lib.licenses.mit;
87 mainProgram = "Tkmm";
88 maintainers = with lib.maintainers; [
89 rucadi
90 ];
91 platforms = lib.platforms.unix;
92 };
93})