1{ lib, buildGoModule, fetchFromGitHub, fetchurl, makeWrapper, runCommand }:
2
3let
4 version = "1.3.6";
5
6 src = fetchFromGitHub {
7 owner = "root-gg";
8 repo = "plik";
9 rev = version;
10 sha256 = "sha256-Xfk7+60iB5/qJh/6j6AxW0aKXuzdINRfILXRzOFejW4=";
11 };
12
13 vendorSha256 = null;
14
15 meta = with lib; {
16 homepage = "https://plik.root.gg/";
17 description = "Scalable & friendly temporary file upload system";
18 maintainers = with maintainers; [ freezeboy ];
19 license = licenses.mit;
20 };
21
22 postPatch = ''
23 substituteInPlace server/common/version.go \
24 --replace '"0.0.0"' '"${version}"'
25 '';
26
27in
28{
29
30 plik = buildGoModule {
31 pname = "plik";
32 inherit version meta src vendorSha256 postPatch;
33
34 subPackages = [ "client" ];
35 postInstall = ''
36 mv $out/bin/client $out/bin/plik
37 '';
38 };
39
40 plikd-unwrapped = buildGoModule {
41 pname = "plikd-unwrapped";
42 inherit version src vendorSha256 postPatch;
43
44 subPackages = [ "server" ];
45 postFixup = ''
46 mv $out/bin/server $out/bin/plikd
47 '';
48 };
49}