nixpkgs/pkgs/tools/misc/cloud-utils/default.nix

56 lines
1.8 KiB
Nix
Raw Normal View History

2017-10-01 22:48:20 +01:00
{ stdenv, fetchurl, makeWrapper
, gawk, gnused, utillinux, file
2019-03-28 03:20:33 +00:00
, wget, python3, qemu-utils, euca2ools
, e2fsprogs, cdrkit
, gptfdisk }:
let
# according to https://packages.debian.org/sid/cloud-image-utils + https://packages.debian.org/sid/admin/cloud-guest-utils
guestDeps = [
e2fsprogs gptfdisk gawk gnused utillinux
];
binDeps = guestDeps ++ [
wget file qemu-utils cdrkit
];
in stdenv.mkDerivation rec {
# NOTICE: if you bump this, make sure to run
# $ nix-build nixos/release-combined.nix -A nixos.tests.ec2-nixops
# growpart is needed in initrd in nixos/system/boot/grow-partition.nix
pname = "cloud-utils";
2020-06-29 13:50:15 +01:00
version = "0.31";
src = fetchurl {
2020-06-29 13:50:15 +01:00
url = "https://launchpad.net/cloud-utils/trunk/${version}/+download/cloud-utils-${version}.tar.gz";
sha256 = "07fl3dlqwdzw4xx7mcxhpkks6dnmaxha80zgs9f6wmibgzni8z0r";
};
2017-10-01 22:48:20 +01:00
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ python3 ];
installFlags = [ "LIBDIR=$(out)/lib" "BINDIR=$(out)/bin" "MANDIR=$(out)/man/man1" "DOCDIR=$(out)/doc" ];
# $guest output contains all executables needed for cloud-init and $out the rest + $guest
# This is similar to debian's package split into cloud-image-utils and cloud-guest-utils
# The reason is to reduce the closure size
outputs = [ "out" "guest"];
2017-10-01 22:48:20 +01:00
postFixup = ''
moveToOutput bin/ec2metadata $guest
moveToOutput bin/growpart $guest
moveToOutput bin/vcs-run $guest
2017-10-01 22:48:20 +01:00
for i in $out/bin/*; do
wrapProgram $i --prefix PATH : "${stdenv.lib.makeBinPath binDeps}:$out/bin"
done
for i in $guest/bin/*; do
wrapProgram $i --prefix PATH : "${stdenv.lib.makeBinPath guestDeps}:$guest/bin"
ln -s $i $out/bin
done
'';
2017-10-01 22:48:20 +01:00
dontBuild = true;
2018-09-11 22:31:27 +01:00
meta = with stdenv.lib; {
platforms = platforms.unix;
license = licenses.gpl3;
};
}