Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / applications / misc / ArchiSteamFarm / default.nix
blob049f4e90b29bb6b17ae5d931997b65179cd8bf78
1 { lib
2 , buildDotnetModule
3 , fetchFromGitHub
4 , dotnetCorePackages
5 , libkrb5
6 , zlib
7 , openssl
8 , callPackage
9 }:
11 buildDotnetModule rec {
12   pname = "ArchiSteamFarm";
13   # nixpkgs-update: no auto update
14   version = "5.4.12.5";
16   src = fetchFromGitHub {
17     owner = "JustArchiNET";
18     repo = "ArchiSteamFarm";
19     rev = version;
20     hash = "sha256-iIYA9BnHUfsB4J7VbSLKaRdJHMW/xULJxKfv8atfAd8=";
21   };
23   dotnet-runtime = dotnetCorePackages.aspnetcore_7_0;
24   dotnet-sdk = dotnetCorePackages.sdk_7_0;
26   nugetDeps = ./deps.nix;
28   projectFile = "ArchiSteamFarm.sln";
29   executables = [ "ArchiSteamFarm" ];
30   dotnetFlags = [
31     "-p:PublishSingleFile=true"
32     "-p:PublishTrimmed=true"
33   ];
34   dotnetInstallFlags = [
35     "--framework=net7.0"
36   ];
37   selfContainedBuild = true;
39   runtimeDeps = [ libkrb5 zlib openssl ];
41   doCheck = true;
43   preBuild = ''
44     export projectFile=(ArchiSteamFarm)
45   '';
47   preInstall = ''
48     # A mutable path, with this directory tree must be set. By default, this would point at the nix store causing errors.
49     makeWrapperArgs+=(
50       --run 'mkdir -p ~/.config/archisteamfarm/{config,logs,plugins}'
51       --set "ASF_PATH" "~/.config/archisteamfarm"
52     )
53   '';
55   postInstall = ''
56     buildPlugin() {
57       echo "Publishing plugin $1"
58       dotnet publish $1 -p:ContinuousIntegrationBuild=true -p:Deterministic=true \
59         --output $out/lib/archisteamfarm/plugins/$1 --configuration Release \
60         -p:TargetLatestRuntimePatch=false -p:UseAppHost=false --no-restore \
61         --framework=net7.0
62      }
64      buildPlugin ArchiSteamFarm.OfficialPlugins.ItemsMatcher
65      buildPlugin ArchiSteamFarm.OfficialPlugins.MobileAuthenticator
66      buildPlugin ArchiSteamFarm.OfficialPlugins.SteamTokenDumper
67   '';
69   passthru = {
70     # nix-shell maintainers/scripts/update.nix --argstr package ArchiSteamFarm
71     updateScript = ./update.sh;
72     ui = callPackage ./web-ui { };
73   };
75   meta = with lib; {
76     description = "Application with primary purpose of idling Steam cards from multiple accounts simultaneously";
77     homepage = "https://github.com/JustArchiNET/ArchiSteamFarm";
78     license = licenses.asl20;
79     mainProgram = "ArchiSteamFarm";
80     maintainers = with maintainers; [ SuperSandro2000 lom ];
81   };