Skip to content

Commit

Permalink
nexusmods-app: fix passthru tests
Browse files Browse the repository at this point in the history
- ensure fontconfig file exists
- ensure XDG dirs are writable
  • Loading branch information
MattSturgeon committed Dec 4, 2024
1 parent e3ac562 commit 0462ffb
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions pkgs/by-name/ne/nexusmods-app/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
fetchFromGitHub,
imagemagick,
lib,
makeFontsConf,
runCommand,
xdg-utils,
pname ? "nexusmods-app",
Expand Down Expand Up @@ -140,10 +141,22 @@ buildDotnetModule (finalAttrs: {
let
runTest =
name: script:
runCommand "${pname}-test-${name}" { nativeBuildInputs = [ finalAttrs.finalPackage ]; } ''
${script}
touch $out
'';
runCommand "${pname}-test-${name}"
{
nativeBuildInputs = [ finalAttrs.finalPackage ];
FONTCONFIG_FILE = makeFontsConf {
fontDirectories = [ ];
};
}
''
export XDG_DATA_HOME="$PWD/data"
export XDG_STATE_HOME="$PWD/state"
export XDG_CACHE_HOME="$PWD/cache"
mkdir -p "$XDG_DATA_HOME" "$XDG_STATE_HOME" "$XDG_CACHE_HOME"
# TODO: on error, print $XDG_STATE_HOME/NexusMods.App/Logs/nexusmods.app.main.current.log
${script}
touch $out
'';
in
{
serve = runTest "serve" ''
Expand Down

0 comments on commit 0462ffb

Please sign in to comment.