biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / servers / sftpgo / default.nix
blobee6d8c8d15b5081912449b2bcb2e8f5c3d68069e
1 { lib
2 , buildGoModule
3 , fetchFromGitHub
4 , installShellFiles
5 , nixosTests
6 }:
8 buildGoModule rec {
9   pname = "sftpgo";
10   version = "2.5.6";
12   src = fetchFromGitHub {
13     owner = "drakkan";
14     repo = "sftpgo";
15     rev = "refs/tags/v${version}";
16     hash = "sha256-ea4DbPwi2tcRgmbNsZKKUOVkp6vjRbr679yAP7znNUc=";
17   };
19   vendorHash = "sha256-8TBDaDBLy+82BwsaLncDknVIrauF0eop9e2ZhwcLmIs=";
21   ldflags = [
22     "-s"
23     "-w"
24     "-X github.com/drakkan/sftpgo/v2/internal/version.commit=${src.rev}"
25     "-X github.com/drakkan/sftpgo/v2/internal/version.date=1970-01-01T00:00:00Z"
26   ];
28   nativeBuildInputs = [ installShellFiles ];
30   doCheck = false;
32   subPackages = [ "." ];
34   postInstall = ''
35     $out/bin/sftpgo gen man
36     installManPage man/*.1
38     installShellCompletion --cmd sftpgo \
39       --bash <($out/bin/sftpgo gen completion bash) \
40       --zsh <($out/bin/sftpgo gen completion zsh) \
41       --fish <($out/bin/sftpgo gen completion fish)
43     shareDirectory="$out/share/sftpgo"
44     mkdir -p "$shareDirectory"
45     cp -r ./{openapi,static,templates} "$shareDirectory"
46   '';
48   passthru.tests = nixosTests.sftpgo;
50   meta = with lib; {
51     homepage = "https://github.com/drakkan/sftpgo";
52     changelog = "https://github.com/drakkan/sftpgo/releases/tag/v${version}";
53     description = "Fully featured and highly configurable SFTP server";
54     longDescription = ''
55       Fully featured and highly configurable SFTP server
56       with optional HTTP/S, FTP/S and WebDAV support.
57       Several storage backends are supported:
58       local filesystem, encrypted local filesystem, S3 (compatible) Object Storage,
59       Google Cloud Storage, Azure Blob Storage, SFTP.
60     '';
61     license = licenses.agpl3Only;
62     maintainers = with maintainers; [ thenonameguy yayayayaka ];
63     mainProgram = "sftpgo";
64   };