about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/ejson/default.nix
blob: c6ec3e3b6b25a00b2464aa8977d657ded4cf0f80 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{ lib, bundlerEnv, ruby, buildGoModule, fetchFromGitHub }:
let
  # needed for manpage generation
  gems = bundlerEnv {
    name = "ejson-gems";
    gemdir = ./.;
    inherit ruby;
  };
in
buildGoModule rec {
  pname = "ejson";
  version = "1.3.3";

  src = fetchFromGitHub {
    owner = "Shopify";
    repo = "ejson";
    rev = "v${version}";
    sha256 = "sha256-M2Gk+/l1tNlIAe1/fR1WLEOey+tjCUmMAujc76gmeZA=";
  };

  vendorHash = "sha256-9+x7HrbXRoS/7ZADWwhsbynQLr3SyCbcsp9QnSubov0=";

  nativeBuildInputs = [ gems ];

  ldflags = [ "-s" "-w" ];

  # set HOME, otherwise bundler will insert stuff in the manpages
  postBuild = ''
    HOME=$PWD make man SHELL=$SHELL
  '';

  postInstall = ''
    mkdir -p $out/share
    cp -r build/man $out/share
  '';

  meta = with lib; {
    description = "A small library to manage encrypted secrets using asymmetric encryption";
    mainProgram = "ejson";
    license = licenses.mit;
    homepage = "https://github.com/Shopify/ejson";
    maintainers = [ maintainers.manveru ];
  };
}