Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nexusmods-app: use finalAttrs #336221

Merged
merged 2 commits into from
Aug 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 14 additions & 17 deletions pkgs/by-name/ne/nexusmods-app/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,17 @@
libICE,
libSM,
libX11,
nexusmods-app,
runCommand,
pname ? "nexusmods-app",
}:
buildDotnetModule rec {
buildDotnetModule (finalAttrs: {
inherit pname;
version = "0.4.1";

src = fetchFromGitHub {
owner = "Nexus-Mods";
repo = "NexusMods.App";
rev = "v${version}";
rev = "v${finalAttrs.version}";
fetchSubmodules = true;
hash = "sha256-FzQphMhiC1g+6qmk/R1v4rq2ldy35NcaWm0RR1UlwLA=";
};
Expand Down Expand Up @@ -54,18 +53,21 @@ buildDotnetModule rec {
'';

makeWrapperArgs = [
"--prefix PATH : ${lib.makeBinPath [ desktop-file-utils ]}"
"--set APPIMAGE ${placeholder "out"}/bin/${meta.mainProgram}" # Make associating with nxm links work on Linux
"--prefix PATH : ${lib.makeBinPath finalAttrs.runtimeInputs}"
# Make associating with nxm links work on Linux
"--set APPIMAGE ${placeholder "out"}/bin/NexusMods.App"
];

runtimeInputs = [ desktop-file-utils ];

runtimeDeps = [
fontconfig
libICE
libSM
libX11
];

executables = [ meta.mainProgram ];
executables = [ "NexusMods.App" ];

doCheck = true;

Expand Down Expand Up @@ -93,15 +95,10 @@ buildDotnetModule rec {
let
runTest =
name: script:
runCommand "${pname}-test-${name}"
{
# TODO: use finalAttrs when buildDotnetModule has support
nativeBuildInputs = [ nexusmods-app ];
}
''
${script}
touch $out
'';
runCommand "${pname}-test-${name}" { nativeBuildInputs = [ finalAttrs.finalPackage ]; } ''
${script}
touch $out
'';
in
{
serve = runTest "serve" ''
Expand All @@ -123,7 +120,7 @@ buildDotnetModule rec {
meta = {
mainProgram = "NexusMods.App";
homepage = "https://github.com/Nexus-Mods/NexusMods.App";
changelog = "https://github.com/Nexus-Mods/NexusMods.App/releases/tag/${src.rev}";
changelog = "https://github.com/Nexus-Mods/NexusMods.App/releases/tag/${finalAttrs.src.rev}";
license = [ lib.licenses.gpl3Plus ];
maintainers = with lib.maintainers; [
l0b0
Expand Down Expand Up @@ -158,4 +155,4 @@ buildDotnetModule rec {
}
'';
};
}
})