summary refs log tree commit diff
path: root/pkgs/applications/networking/cluster/waagent/default.nix
blob: a1a72a69885a73f18ba86044b5537bdd70177b1c (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{ fetchFromGitHub,
  findutils,
  gnugrep,
  gnused,
  iproute2,
  iptables,
  lib,
  nettools, # for hostname
  openssh,
  openssl,
  parted,
  procps, # for pidof,
  python3,
  shadow, # for useradd, usermod
  util-linux, # for (u)mount, fdisk, sfdisk, mkswap
}:

let
  inherit (lib) makeBinPath;

in
python3.pkgs.buildPythonPackage rec {
  pname = "waagent";
  version = "2.8.0.11";
  src = fetchFromGitHub {
    owner = "Azure";
    repo = "WALinuxAgent";
    rev = "04ded9f0b708cfaf4f9b68eead1aef4cc4f32eeb";
    sha256 = "0fvjanvsz1zyzhbjr2alq5fnld43mdd776r2qid5jy5glzv0xbhf";
  };
  doCheck = false;

  buildInputs = with python3.pkgs; [ distro ];
  runtimeDeps = [
    findutils
    gnugrep
    gnused
    iproute2
    iptables
    nettools # for hostname
    openssh
    openssl
    parted
    procps # for pidof
    shadow # for useradd, usermod
    util-linux # for (u)mount, fdisk, sfdisk, mkswap
  ];

  fixupPhase = ''
     mkdir -p $out/bin/
     WAAGENT=$(find $out -name waagent | grep sbin)
     cp $WAAGENT $out/bin/waagent
     wrapProgram "$out/bin/waagent" \
         --prefix PYTHONPATH : $PYTHONPATH \
         --prefix PATH : "${makeBinPath runtimeDeps}"
     patchShebangs --build "$out/bin/"
  '';

  meta = {
    description = "The Microsoft Azure Linux Agent (waagent)
                   manages Linux provisioning and VM interaction with the Azure
                   Fabric Controller";
    homepage = "https://github.com/Azure/WALinuxAgent";
    license = with lib.licenses; [ asl20 ];
  };

}