1{
2 lib,
3 buildGoModule,
4 fetchFromGitHub,
5 makeWrapper,
6 runCommand,
7 nixosTests,
8}:
9
10let
11 version = "1.3.8";
12
13 src = fetchFromGitHub {
14 owner = "root-gg";
15 repo = "plik";
16 rev = version;
17 hash = "sha256-WCtfkzlZnyzZDwNDBrW06bUbLYTL2C704Y7aXbiVi5c=";
18 };
19
20 vendorHash = null;
21
22 meta = with lib; {
23 homepage = "https://plik.root.gg/";
24 description = "Scalable & friendly temporary file upload system";
25 maintainers = with maintainers; [ freezeboy ];
26 license = licenses.mit;
27 mainProgram = "plik";
28 };
29
30 postPatch = ''
31 substituteInPlace server/common/version.go \
32 --replace '"0.0.0"' '"${version}"'
33 '';
34
35 passthru.tests = {
36 inherit (nixosTests) plikd;
37 };
38
39in
40{
41
42 plik = buildGoModule {
43 pname = "plik";
44 inherit
45 version
46 meta
47 src
48 vendorHash
49 postPatch
50 passthru
51 ;
52
53 subPackages = [ "client" ];
54 postInstall = ''
55 mv $out/bin/client $out/bin/plik
56 '';
57 };
58
59 plikd-unwrapped = buildGoModule {
60 pname = "plikd-unwrapped";
61 inherit
62 version
63 src
64 vendorHash
65 postPatch
66 passthru
67 ;
68
69 subPackages = [ "server" ];
70 postFixup = ''
71 mv $out/bin/server $out/bin/plikd
72 '';
73 };
74}