[Nix-dev] How to package Heroku Toolbelt?

Alex Berg chexxor at gmail.com
Thu Nov 14 10:44:41 CET 2013


How do I package the Heroku Toolbelt? -
https://toolbelt.heroku.com<https://toolbelt.heroku.com/install.sh>

It looks like the Ubuntu installer includes Ruby and some other stuff, so I
think I should just package the "Standalone" option. This option tells me
to download and run a shell script - https://toolbelt.heroku.com/install.sh

Question 1: Should I copy-paste this shell script into the
"heroku-toolbelt" package, then use the "builder" attribute to call this?
Or should I use the the standard builder by using the "src" attribute to
download the tarball?

Question 2: If the latter,  where should I get the tarball?
>From the URL in that shell script? -
https://s3.amazonaws.com/assets.heroku.com/heroku-client/heroku-client.tgz
Or from their GitHub repo? https://github.com/heroku/heroku

My progress:
I am assuming I should not use that shell script, because Nix was designed
to do the same thing, but better.

The Heroku Toolbelt is a Ruby script, I believe, so there's no compilation,
I just need to ensure my PATH has this Nix Store derivation.

So, I believe I only need the unpack phase, but I don't know how to make it
do only the unpack.

My problem:
I've read the docs, but I still have problems. I don't know what is in
context in various places, what each phase should be doing, etc.

Question 3:
I get an error, but I don't know what it means. Can someone translate this
for me?


Here is the package I've got so far, and the error.


stdenv.mkDerivation rec {
  name = "heroku-toolbelt";

  src = fetchurl {
    url = "
https://s3.amazonaws.com/assets.heroku.com/heroku-client/heroku-client.tgz";
    sha256 = "00zqj9jwcklfyq5k3v81dwlzrrjm8axkgx7mixcb1kghjjlsdzv2";
    #url = "https://toolbelt.heroku.com/install.sh";
    #sha256 = "10i5wgqfka6yifh6p4hmvzvfkm0k1w4s59fwz3vip3knpyi6abcz";
  };

  nativeBuildInputs = [  ];

  #builder = ${src}/install.sh;

  #configurePhase = "";
  #buildPhase = "";
  #installPhase = "mv heroku-client/* .; rmdir heroku-client; ";
  #installPhase = "";

  phases = [ "unpackPhase" ];
}


[chexxor at nixos:~]$ nix-build /my-sources/pkgs/top-level/all-packages.nix -A
heroku-toolbelt
these derivations will be built:
  /nix/store/226khb1zh9kb94wwc27as2kxiyrqmqkj-heroku-toolbelt.drv
building path(s)
`/nix/store/ibh9r574dd14wd01xpmldy90c69z8lfh-heroku-toolbelt'
building /nix/store/ibh9r574dd14wd01xpmldy90c69z8lfh-heroku-toolbelt
unpacking sources
punpacking source archive
/nix/store/dfryky194z2bv179pd4jf3ny2gn9di02-heroku-client.tgz
source root is heroku-client
builder for
`/nix/store/226khb1zh9kb94wwc27as2kxiyrqmqkj-heroku-toolbelt.drv' failed to
produce output path
`/nix/store/ibh9r574dd14wd01xpmldy90c69z8lfh-heroku-toolbelt'
error: build of
`/nix/store/226khb1zh9kb94wwc27as2kxiyrqmqkj-heroku-toolbelt.drv' failed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20131114/430a99c8/attachment.html 


More information about the nix-dev mailing list