nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildGoModule,
4 fetchFromGitHub,
5 installShellFiles,
6}:
7
8buildGoModule rec {
9 pname = "brig";
10 version = "0.4.1";
11
12 src = fetchFromGitHub {
13 owner = "sahib";
14 repo = "brig";
15 rev = "v${version}";
16 sha256 = "0gi39jmnzqrgj146yw8lcmgmvzx7ii1dgw4iqig7kx8c0jiqi600";
17 };
18
19 vendorHash = null;
20
21 nativeBuildInputs = [ installShellFiles ];
22
23 subPackages = [ "." ];
24
25 ldflags = [
26 "-s"
27 "-w"
28 ]
29 ++ lib.mapAttrsToList (n: v: "-X github.com/sahib/brig/version.${n}=${v}") {
30 Major = lib.versions.major version;
31 Minor = lib.versions.minor version;
32 Patch = lib.versions.patch version;
33 ReleaseType = "";
34 BuildTime = "1970-01-01T00:00:00+0000";
35 GitRev = src.rev;
36 };
37
38 postInstall = ''
39 installShellCompletion --cmd brig \
40 --bash $src/autocomplete/bash_autocomplete \
41 --zsh $src/autocomplete/zsh_autocomplete
42 '';
43
44 # There are no tests for the brig executable.
45 doCheck = false;
46
47 meta = with lib; {
48 description = "File synchronization on top of IPFS with a git-like interface and a FUSE filesystem";
49 longDescription = ''
50 brig is a distributed and secure file synchronization tool with a version
51 control system. It is based on IPFS, written in Go and will feel familiar
52 to git users. Think of it as a swiss army knife for file synchronization
53 or as a peer to peer alternative to Dropbox.
54 '';
55 homepage = "https://brig.readthedocs.io";
56 changelog = "https://github.com/sahib/brig/releases/tag/${src.rev}";
57 license = licenses.agpl3Only;
58 maintainers = with maintainers; [ offline ];
59 mainProgram = "brig";
60 };
61}