diff options
Diffstat (limited to 'pkgs/applications/misc/ArchiSteamFarm/default.nix')
-rw-r--r-- | pkgs/applications/misc/ArchiSteamFarm/default.nix | 66 |
1 files changed, 38 insertions, 28 deletions
diff --git a/pkgs/applications/misc/ArchiSteamFarm/default.nix b/pkgs/applications/misc/ArchiSteamFarm/default.nix index cc6b1eab5de4..bae763972d12 100644 --- a/pkgs/applications/misc/ArchiSteamFarm/default.nix +++ b/pkgs/applications/misc/ArchiSteamFarm/default.nix @@ -1,42 +1,52 @@ -{ lib, stdenv, fetchurl, unzip, makeWrapper, dotnetCorePackages, jq }: - -stdenv.mkDerivation rec { - pname = "ArchiSteamFarm"; - version = "4.3.1.0"; - - src = fetchurl { - url = "https://github.com/JustArchiNET/ArchiSteamFarm/releases/download/${version}/ASF-generic.zip"; - sha256 = "1q28byshh4wkfsfdb0sfdqq9a5da9k7i4nagsfpk0fzyajvzd4lx"; +{ lib +, buildDotnetModule +, fetchFromGitHub +, dotnetCorePackages +, libkrb5 +, zlib +, openssl +}: + +buildDotnetModule rec { + pname = "archisteamfarm"; + version = "5.1.5.3"; + + src = fetchFromGitHub { + owner = "justarchinet"; + repo = pname; + rev = version; + sha256 = "sha256-H038maKHZujmbKhbi8fxsKR/tcSPrcl9L5xnr77yyXg="; }; - nativeBuildInputs = [ unzip makeWrapper jq ]; + dotnet-runtime = dotnetCorePackages.aspnetcore_5_0; + nugetDeps = ./deps.nix; - sourceRoot = "."; + projectFile = "ArchiSteamFarm.sln"; + executables = [ "ArchiSteamFarm" ]; - installPhase = '' - dist=$out/opt/asf - mkdir -p $dist - cp -r * $dist + runtimeDeps = [ libkrb5 zlib openssl ]; - jq "del(.runtimeOptions.framework.version)" ArchiSteamFarm.runtimeconfig.json > $dist/ArchiSteamFarm.runtimeconfig.json + # Without this, it attempts to write to the store even though the `--path` flag is supplied. + patches = [ ./mutable-customdir.patch ]; - makeWrapper ${dotnetCorePackages.aspnetcore_3_1}/bin/dotnet $out/bin/ArchiSteamFarm \ - --add-flags $dist/ArchiSteamFarm.dll \ - --add-flags "--path ~/.config/asf" \ - --run "mkdir -p ~/.config/asf" \ - --run "cd ~/.config/asf" \ - --run "[ -d config ] || cp --no-preserve=mode -r $dist/config ." \ - --run "[ -d logs ] || cp --no-preserve=mode -r $dist/logs ." \ - --run "[ -d plugins ] || cp --no-preserve=mode -r $dist/plugins ." \ - --run "ln -sf $dist/www ." + doCheck = true; + + preInstall = '' + # A mutable path, with this directory tree must be set. By default, this would point at the nix store causing errors. + makeWrapperArgs+=( + --add-flags "--path ~/.config/archisteamfarm" + --run "mkdir -p ~/.config/archisteamfarm/{config,logs,plugins}" + --run "cd ~/.config/archisteamfarm" + ) ''; + passthru.updateScript = ./updater.sh; + meta = with lib; { description = "Application with primary purpose of idling Steam cards from multiple accounts simultaneously"; homepage = "https://github.com/JustArchiNET/ArchiSteamFarm"; license = licenses.asl20; - platforms = dotnetCorePackages.aspnetcore_3_1.meta.platforms; - maintainers = with maintainers; [ ]; - hydraPlatforms = []; + platforms = dotnetCorePackages.aspnetcore_5_0.meta.platforms; + maintainers = with maintainers; [ SuperSandro2000 legendofmiracles ]; }; } |