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 an unfree `_7zz` in to the package, instead of
having an `enableUnfree` package argument.

Ensure `pname` is set correctly via `overrideAttrs`.

Use `_7zz.meta.unfree` internally.
  • Loading branch information
MattSturgeon committed Jul 31, 2024
1 parent 16e8779 commit 9f2d374
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
8 changes: 2 additions & 6 deletions pkgs/by-name/ne/nexusmods-app/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@
libX11,
nexusmods-app,
runCommand,
enableUnfree ? false, # Set to true to support RAR format mods
}:
let
_7zzWithOptionalUnfreeRarSupport = _7zz.override { inherit enableUnfree; };
in
buildDotnetModule rec {
pname = "nexusmods-app";
version = "0.4.1";
Expand Down Expand Up @@ -50,7 +46,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 @@ -85,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
11 changes: 8 additions & 3 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18792,9 +18792,14 @@ 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 =
(pkgs.nexusmods-app.overrideAttrs {
pname = "nexusmods-app-unfree";
}).override (prev: {
_7zz = prev._7zz.override {
enableUnfree = true;
};
});

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

Expand Down

0 comments on commit 9f2d374

Please sign in to comment.