1{ lib, pythonPackages, fetchurl }:
2
3let version = "0.7.6";
4
5in pythonPackages.buildPythonApplication rec {
6 name = "cloud-init-${version}";
7 namePrefix = "";
8
9 src = fetchurl {
10 url = "https://launchpad.net/cloud-init/trunk/${version}/+download/cloud-init-${version}.tar.gz";
11 sha256 = "1mry5zdkfaq952kn1i06wiggc66cqgfp6qgnlpk0mr7nnwpd53wy";
12 };
13
14 patchPhase = ''
15 patchShebangs ./tools
16
17 substituteInPlace setup.py \
18 --replace /usr $out \
19 --replace /etc $out/etc \
20 --replace /lib/systemd $out/lib/systemd \
21 --replace 'self.init_system = ""' 'self.init_system = "systemd"'
22 '';
23
24 propagatedBuildInputs = with pythonPackages; [ cheetah jinja2 prettytable
25 oauth pyserial configobj pyyaml argparse requests jsonpatch ];
26
27 meta = {
28 homepage = http://cloudinit.readthedocs.org;
29 description = "provides configuration and customization of cloud instance";
30 maintainers = [ lib.maintainers.madjar ];
31 platforms = lib.platforms.all;
32 };
33}