Merge pull request #330634 from r-ryantm/auto-update/circumflex
[NixPkgs.git] / pkgs / servers / sftpgo / default.nix
blob3a3b687459c8a2102988d66bad1bb394794cf30c
1 { lib
2 , buildGoModule
3 , fetchFromGitHub
4 , installShellFiles
5 , nixosTests
6 }:
8 buildGoModule rec {
9   pname = "sftpgo";
10   version = "2.6.2";
12   src = fetchFromGitHub {
13     owner = "drakkan";
14     repo = "sftpgo";
15     rev = "refs/tags/v${version}";
16     hash = "sha256-76P4njY/Wb9l4LG+sZwiwQVrvfXCtAELju30GLi7kBE=";
17   };
19   vendorHash = "sha256-gBb+qpNFSFhCOYLxXkz3xmyx+3PvyOwLNqjT9zZQuc8=";
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 = with licenses; [ agpl3Only unfreeRedistributable ]; # Software is AGPLv3, web UI is unfree
62     maintainers = with maintainers; [ thenonameguy ];
63     mainProgram = "sftpgo";
64   };