summary refs log blame commit diff
path: root/pkgs/servers/minio/default.nix
blob: c9dfe9136df57670f06c0da66b4b16f5eca821fc (plain) (tree)
1
2
3
4
5
6
7
8
9
10


                              
                            
 
                                   

                  

                                                                             














                                         
                                                                  






                                                           
                                                        
                                     


                                 
{ lib, stdenv, fetchurl, go }:

stdenv.mkDerivation rec {
  name = "minio-${version}";

  version = "2017-09-29T19-16-56Z";

  src = fetchurl {
    url = "https://github.com/minio/minio/archive/RELEASE.${version}.tar.gz";
    sha256 = "1h028gyfvyh5x6k4fsj4s64sgzqy7jgln6kvs27bnxzigj6dp2wx";
  };

  buildInputs = [ go ];

  unpackPhase = ''
    d=$TMPDIR/src/github.com/minio/minio
    mkdir -p $d
    tar xf $src -C $d --strip-component 1
    export GOPATH=$TMPDIR
    cd $d
  '';

  buildPhase = ''
    mkdir -p $out/bin
    go build -o $out/bin/minio \
      --ldflags "-X github.com/minio/minio/cmd.Version=${version}"
  '';

  installPhase = "true";

  meta = {
    homepage = https://www.minio.io/;
    description = "An S3-compatible object storage server";
    maintainers = with lib.maintainers; [ eelco bachp ];
    platforms = lib.platforms.x86_64;
    license = lib.licenses.asl20;
  };
}