1 { lib, stdenv, fetchurl, makeWrapper
2 , gawk, gnused, util-linux, file
3 , wget, python3, qemu-utils
8 # according to https://packages.debian.org/sid/cloud-image-utils + https://packages.debian.org/sid/admin/cloud-guest-utils
10 e2fsprogs gptfdisk gawk gnused util-linux
12 binDeps = guestDeps ++ [
13 wget file qemu-utils cdrkit
15 in stdenv.mkDerivation rec {
16 # NOTICE: if you bump this, make sure to run
17 # $ nix-build nixos/release-combined.nix -A nixos.tests.ec2-nixops
18 # growpart is needed in initrd in nixos/system/boot/grow-partition.nix
19 pname = "cloud-utils";
22 url = "https://launchpad.net/cloud-utils/trunk/${version}/+download/cloud-utils-${version}.tar.gz";
23 sha256 = "0xxdi55lzw7j91zfajw7jhd2ilsqj2dy04i9brlk8j3pvb5ma8hk";
25 nativeBuildInputs = [ makeWrapper ];
26 buildInputs = [ python3 ];
27 installFlags = [ "LIBDIR=$(out)/lib" "BINDIR=$(out)/bin" "MANDIR=$(out)/man/man1" "DOCDIR=$(out)/doc" ];
29 # $guest output contains all executables needed for cloud-init and $out the rest + $guest
30 # This is similar to debian's package split into cloud-image-utils and cloud-guest-utils
31 # The reason is to reduce the closure size
32 outputs = [ "out" "guest"];
35 moveToOutput bin/ec2metadata $guest
36 moveToOutput bin/growpart $guest
37 moveToOutput bin/vcs-run $guest
39 for i in $out/bin/*; do
40 wrapProgram $i --prefix PATH : "${lib.makeBinPath binDeps}:$out/bin"
43 for i in $guest/bin/*; do
44 wrapProgram $i --prefix PATH : "${lib.makeBinPath guestDeps}:$guest/bin"
52 platforms = platforms.unix;
53 license = licenses.gpl3;