summary refs log tree commit diff
path: root/pkgs/tools/virtualization/cloud-init/default.nix
blob: 48eb68242e1e26497f3e3da466fb0d8c2a14152f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{ lib, pythonPackages, fetchurl }:

let version = "0.7.6";

in pythonPackages.buildPythonPackage rec {
  name = "cloud-init-0.7.6";
  namePrefix = "";

  src = fetchurl {
    url = "https://launchpad.net/cloud-init/trunk/${version}/+download/cloud-init-${version}.tar.gz";
    sha256 = "1mry5zdkfaq952kn1i06wiggc66cqgfp6qgnlpk0mr7nnwpd53wy";
  };

  preBuild = ''
    patchShebangs ./tools

    substituteInPlace setup.py \
      --replace /usr $out \
      --replace /etc $out/etc \
      --replace /lib/systemd $out/lib/systemd \
    '';

  pythonPath = with pythonPackages; [ cheetah jinja2 prettytable
    oauth pyserial configobj pyyaml argparse requests jsonpatch ];

  setupPyInstallFlags = ["--init-system systemd"];

  meta = {
    homepage = http://cloudinit.readthedocs.org;
    description = "provides configuration and customization of cloud instance";
    maintainers = [ lib.maintainers.madjar ];
    platforms = lib.platforms.all;
  };
}