1 { lib, stdenv, fetchurl, unzip, ruby, openssl, makeWrapper }:
3 stdenv.mkDerivation rec {
4 pname = "ec2-ami-tools";
8 nativeBuildInputs = [ makeWrapper unzip ];
11 url = "https://s3.amazonaws.com/ec2-downloads/${pname}-${version}.zip";
12 sha256 = "17xj7xmdbcwdbzalhfs6yyiwa64978mk3li39l949qfjjgrxjias";
15 # Amazon EC2 requires that disk images are writable. If they're
16 # not, the VM immediately terminates with a mysterious
17 # "Server.InternalError" message. Since disk images generated in
18 # the Nix store are read-only, they must be made writable in the
19 # tarball uploaded to Amazon S3. So add a `--mode=0755' flag to the
21 patches = [ ./writable.patch ];
29 for i in $out/bin/*; do
32 --prefix PATH : ${lib.makeBinPath [ ruby openssl ]}
35 sed -i 's|/bin/bash|${stdenv.shell}|' $out/lib/ec2/platform/base/pipeline.rb
39 homepage = "https://aws.amazon.com/developertools/Amazon-EC2/368";
40 description = "Command-line tools to create and manage Amazon EC2 virtual machine images";
41 license = lib.licenses.amazonsl;