Skip to content

Commit

Permalink
nexusmods-app: refactor "unfree" variant
Browse files Browse the repository at this point in the history
Use `override` to pass a `_7zz` with RAR support to the package, instead
of having an `enableUnfree` package argument.

Use a different `pname` on the unfree package.

Use `_7zz.meta.unfree` internally.
  • Loading branch information
MattSturgeon committed Aug 2, 2024
1 parent e54e9fa commit 1148136
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
11 changes: 4 additions & 7 deletions pkgs/by-name/ne/nexusmods-app/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@
libX11,
nexusmods-app,
runCommand,
enableUnfree ? false, # Set to true to support RAR format mods
pname ? "nexusmods-app",
}:
let
_7zzWithOptionalUnfreeRarSupport = _7zz.override { inherit enableUnfree; };
in
buildDotnetModule rec {
pname = "nexusmods-app";
inherit pname;
version = "0.4.1";

src = fetchFromGitHub {
Expand Down Expand Up @@ -50,7 +47,7 @@ buildDotnetModule rec {
'';

postPatch = ''
ln --force --symbolic "${lib.getExe _7zzWithOptionalUnfreeRarSupport}" src/ArchiveManagement/NexusMods.FileExtractor/runtimes/linux-x64/native/7zz
ln --force --symbolic "${lib.getExe _7zz}" src/ArchiveManagement/NexusMods.FileExtractor/runtimes/linux-x64/native/7zz
# for some reason these tests fail (intermittently?) with a zero timestamp
touch tests/NexusMods.UI.Tests/WorkspaceSystem/*.verified.png
Expand Down Expand Up @@ -84,7 +81,7 @@ buildDotnetModule rec {
"FullyQualifiedName!=NexusMods.UI.Tests.ImageCacheTests.Test_LoadAndCache_RemoteImage"
"FullyQualifiedName!=NexusMods.UI.Tests.ImageCacheTests.Test_LoadAndCache_ImageStoredFile"
]
++ lib.optionals (!enableUnfree) [
++ lib.optionals (!_7zz.meta.unfree) [
"FullyQualifiedName!=NexusMods.Games.FOMOD.Tests.FomodXmlInstallerTests.InstallsFilesSimple_UsingRar"
]
)
Expand Down
5 changes: 3 additions & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18792,8 +18792,9 @@ with pkgs;

nix-build-uncached = callPackage ../development/tools/misc/nix-build-uncached { };

nexusmods-app-unfree = callPackage ../by-name/ne/nexusmods-app/package.nix {
enableUnfree = true;
nexusmods-app-unfree = nexusmods-app.override {
pname = "nexusmods-app-unfree";
_7zz = _7zz-rar;
};

nmrpflash = callPackage ../development/embedded/nmrpflash { };
Expand Down

0 comments on commit 1148136

Please sign in to comment.