about summary refs log tree commit diff
path: root/pkgs/by-name/to/torrentstream/package.nix
blob: 34b7e4866d5a0eda90dfd9faecd67abe03bb944a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{ lib
, buildDotnetModule
, fetchFromGitHub
, dotnetCorePackages
}:

buildDotnetModule rec {
  pname = "torrentstream";
  version = "1.0.1.11";

  src = fetchFromGitHub {
    owner = "trueromanus";
    repo = "TorrentStream";
    rev = version;
    hash = "sha256-3lmQWx00Ulp0ZyQBEhFT+djHBi84foMlWGJEp/UOGek=";
  };

  sourceRoot = "${src.name}/src";

  dotnet-runtime = dotnetCorePackages.aspnetcore_8_0;
  dotnet-sdk = dotnetCorePackages.sdk_8_0;
  executables = [ "TorrentStream" ];
  nugetDeps = ./deps.nix;
  projectFile = "TorrentStream.csproj";
  selfContainedBuild = true;

  dotnetFlags = [
    "-p:PublishAot=false" # untill https://github.com/NixOS/nixpkgs/issues/280923 is fixed
    "-p:PublishSingleFile=true"
  ];

  patches = [
    ./0001-display-the-message-of-caught-exceptions.patch
  ];

  postInstall = "rm $out/lib/torrentstream/NuGet.config"; # reduce closure size

  meta = {
    homepage = "https://github.com/trueromanus/TorrentStream";
    description = "Simple web server for streaming torrent files in video players";
    license = lib.licenses.bsd2;
    platforms = lib.platforms.all;
    mainProgram = "TorrentStream";
    maintainers = with lib.maintainers; [ _3JlOy-PYCCKUi ];
  };
}