Skip to content

Commit

Permalink
Add release.nix file
Browse files Browse the repository at this point in the history
  • Loading branch information
rafikk committed May 4, 2015
1 parent f91002e commit 786c4b3
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .gitignore
@@ -1,3 +1,3 @@
.env
bin
*.py[co]
*.py[co]
1 change: 1 addition & 0 deletions Makefile
Expand Up @@ -7,6 +7,7 @@ build:

clean:
@rm -rf bin/
@rm -rf result/

deps:
@echo "$(OK_COLOR)==> Installing dependencies$(NO_COLOR)"
Expand Down
66 changes: 43 additions & 23 deletions default.nix
@@ -1,33 +1,53 @@
with import <nixpkgs> {};
{ nixpkgs ? <nixpkgs>
, name ? "halfshell"
, src ? ./. }:

with import nixpkgs {};

with goPackages; let

go-s3 = buildGoPackage rec {
name = "go-s3";
goPackagePath = "github.com/oysterbooks/s3";
src = fetchFromGitHub {
rev = "master";
owner = "oysterbooks";
repo = "s3";
sha256 = "0ql1i7b8qjrvh6bbh43vka9va7q15s98s1x2h7b1c5q3nsgn77sy";
buildSrc = src;

go-s3 = buildGoPackage rec {
name = "go-s3";
goPackagePath = "github.com/oysterbooks/s3";
src = fetchFromGitHub {
rev = "master";
owner = "oysterbooks";
repo = "s3";
sha256 = "0ql1i7b8qjrvh6bbh43vka9va7q15s98s1x2h7b1c5q3nsgn77sy";
};
};
};

go-imagick = buildGoPackage rec {
name = "go-s3";
goPackagePath = "github.com/rafikk/imagick";
buildInputs = [ pkgconfig imagemagick ];
src = fetchFromGitHub {
rev = "master";
owner = "rafikk";
repo = "imagick";
sha256 = "1paarlszxn63cwawgb5m0b1p8k35n6r34raps3383w5wnrqf6w2a";
go-imagick = buildGoPackage rec {
name = "go-imagick";
goPackagePath = "github.com/rafikk/imagick";
propagatedBuildInputs = [ pkgconfig imagemagick ];
src = fetchFromGitHub {
rev = "master";
owner = "rafikk";
repo = "imagick";
sha256 = "1paarlszxn63cwawgb5m0b1p8k35n6r34raps3383w5wnrqf6w2a";
};
};

go-halfshell = buildGoPackage rec {
name = "go-halfshell";
goPackagePath = "github.com/oysterbooks/halfshell/halfshell";
propagatedBuildInputs = [ go-s3 go-imagick ];
src = builtins.toPath "${buildSrc}/halfshell";
};
};

in buildGoPackage {
name = name;
goPackagePath = "github.com/oysterbooks/halfshell";
name = "halfshell";
src = ./.;
buildInputs = [ go-s3 go-imagick ];
src = buildSrc;
propagatedBuildInputs = [ go-halfshell ];
} // {
meta = {
homepage = "https://github.com/oysterbooks/halfshell";
maintainers = [
"Rafik Salama <rafik@oysterbooks.com>"
];
};
}
26 changes: 26 additions & 0 deletions release.nix
@@ -0,0 +1,26 @@
{ nixpkgs ? <nixpkgs>
, src ? { outPath = ./.; gitTag = "dirty"; }
, system ? builtins.currentSystem }:

let
pkgs = import nixpkgs { inherit system; };

in with pkgs; rec {
tarball = releaseTools.sourceTarball {
src = src;
name = "halfshell";
version = src.gitTag;
versionSuffix = "";
doBuild = true;
distPhase = ''
mkdir -p $out/tarballs/
tar czf $out/tarballs/halfshell-${src.gitTag}.tar.gz .
'';
};

build = import ./default.nix {
inherit nixpkgs;
name = "halfshell-${src.gitTag}";
src = src;
};
}

0 comments on commit 786c4b3

Please sign in to comment.