13 pname ? "nexusmods-app",
16 # From https://nexus-mods.github.io/NexusMods.App/developers/Contributing/#for-package-maintainers
18 # Tell the app it is a distro package; affects wording in update prompts
19 "INSTALLATION_METHOD_PACKAGE_MANAGER"
21 # Don't include upstream's 7zz binary; we use the nixpkgs version
22 "NEXUSMODS_APP_USE_SYSTEM_EXTRACTOR"
25 buildDotnetModule (finalAttrs: {
29 src = fetchFromGitHub {
31 repo = "NexusMods.App";
32 rev = "v${finalAttrs.version}";
33 fetchSubmodules = true;
34 hash = "sha256-OmWDJVsXtUOYBeUXLx6EkQ1/RuH/3wIe40R5KgpmEC4=";
37 enableParallelBuilding = false;
39 # If the whole solution is published, there seems to be a race condition where
40 # it will sometimes publish the wrong version of a dependent assembly, for
41 # example: Microsoft.Extensions.Hosting.dll 6.0.0 instead of 8.0.0.
42 # https://learn.microsoft.com/en-us/dotnet/core/compatibility/sdk/7.0/solution-level-output-no-longer-valid
43 # TODO: do something about this in buildDotnetModule
44 projectFile = "src/NexusMods.App/NexusMods.App.csproj";
45 testProjectFile = "NexusMods.App.sln";
48 # TODO: bump avalonia to 11.1.3
52 nativeCheckInputs = [ _7zz ];
56 imagemagick # For resizing SVG icon in postInstall
59 nugetDeps = ./deps.nix;
60 mapNuGetDependencies = true;
62 dotnet-sdk = dotnetCorePackages.sdk_8_0;
63 dotnet-runtime = dotnetCorePackages.runtime_8_0;
66 # for some reason these tests fail (intermittently?) with a zero timestamp
67 touch tests/NexusMods.UI.Tests/WorkspaceSystem/*.verified.png
71 "--prefix PATH : ${lib.makeBinPath finalAttrs.runtimeInputs}"
76 # As per #308324, use mainProgram from PATH, instead of $out/bin/NexusMods.App
77 install -D -m 444 -t $out/share/applications src/NexusMods.App/com.nexusmods.app.desktop
78 substituteInPlace $out/share/applications/com.nexusmods.app.desktop \
79 --replace-fail '${"$"}{INSTALL_EXEC}' "${finalAttrs.meta.mainProgram}"
82 install -D -m 444 -t $out/share/metainfo src/NexusMods.App/com.nexusmods.app.metainfo.xml
85 icon=src/NexusMods.App/icon.svg
86 install -D -m 444 -T $icon $out/share/icons/hicolor/scalable/apps/com.nexusmods.app.svg
89 for i in 16 24 48 64 96 128 256 512; do
91 dir=$out/share/icons/hicolor/$size/apps
93 convert -background none -resize $size $icon $dir/com.nexusmods.app.png
103 executables = [ "NexusMods.App" ];
106 # From https://github.com/Nexus-Mods/NexusMods.App/blob/v0.6.1/src/NexusMods.App/app.pupnet.conf#L38
107 "--property:Version=${finalAttrs.version}"
108 "--property:TieredCompilation=true"
109 "--property:PublishReadyToRun=true"
110 "--property:DefineConstants=${lib.strings.concatStringsSep "%3B" constants}"
116 "--environment=USER=nobody"
117 "--property:DefineConstants=${lib.strings.concatStringsSep "%3B" constants}"
123 "RequiresNetworking!=True"
128 "NexusMods.UI.Tests.ImageCacheTests.Test_LoadAndCache_RemoteImage"
129 "NexusMods.UI.Tests.ImageCacheTests.Test_LoadAndCache_ImageStoredFile"
131 ++ lib.optionals (!_7zz.meta.unfree) [
132 "NexusMods.Games.FOMOD.Tests.FomodXmlInstallerTests.InstallsFilesSimple_UsingRar"
140 runCommand "${pname}-test-${name}" { nativeBuildInputs = [ finalAttrs.finalPackage ]; } ''
146 serve = runTest "serve" ''
149 help = runTest "help" ''
152 associate-nxm = runTest "associate-nxm" ''
153 NexusMods.App associate-nxm
155 list-tools = runTest "list-tools" ''
156 NexusMods.App list-tools
159 updateScript = ./update.bash;
163 mainProgram = "NexusMods.App";
164 homepage = "https://github.com/Nexus-Mods/NexusMods.App";
165 changelog = "https://github.com/Nexus-Mods/NexusMods.App/releases/tag/${finalAttrs.src.rev}";
166 license = [ lib.licenses.gpl3Plus ];
167 maintainers = with lib.maintainers; [
171 platforms = lib.platforms.linux;
172 description = "Game mod installer, creator and manager";
174 A mod installer, creator and manager for all your popular games.
176 Currently experimental and undergoing active development,
177 new releases may include breaking changes!
180 if _7zz.meta.unfree then
182 This "unfree" variant includes support for mods packaged as RAR archives.
186 It is strongly recommended that you use the "unfree" variant of this package,
187 which provides support for mods packaged as RAR archives.
189 You can also enable unrar support manually, by overriding the `_7zz` used:
192 pkgs.nexusmods-app.override {
193 _7zz = pkgs._7zz-rar;