Files
nixpkgs/pkgs/servers/plik/programs.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

75 lines
1.2 KiB
Nix

{
lib,
buildGoModule,
fetchFromGitHub,
makeWrapper,
runCommand,
nixosTests,
}:
let
version = "1.3.8";
src = fetchFromGitHub {
owner = "root-gg";
repo = "plik";
rev = version;
hash = "sha256-WCtfkzlZnyzZDwNDBrW06bUbLYTL2C704Y7aXbiVi5c=";
};
vendorHash = null;
meta = {
homepage = "https://plik.root.gg/";
description = "Scalable & friendly temporary file upload system";
maintainers = [ ];
license = lib.licenses.mit;
mainProgram = "plik";
};
postPatch = ''
substituteInPlace server/common/version.go \
--replace '"0.0.0"' '"${version}"'
'';
passthru.tests = {
inherit (nixosTests) plikd;
};
in
{
plik = buildGoModule {
pname = "plik";
inherit
version
meta
src
vendorHash
postPatch
passthru
;
subPackages = [ "client" ];
postInstall = ''
mv $out/bin/client $out/bin/plik
'';
};
plikd-unwrapped = buildGoModule {
pname = "plikd-unwrapped";
inherit
version
src
vendorHash
postPatch
passthru
;
subPackages = [ "server" ];
postFixup = ''
mv $out/bin/server $out/bin/plikd
'';
};
}