summary refs log tree commit diff
path: root/pkgs/os-specific/linux/cgmanager/default.nix
blob: 79be500a13d7273afd12add5b6f3da14b159e4f2 (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
{ stdenv, fetchurl, pkgconfig, libnih, dbus }:

stdenv.mkDerivation rec {
  name = "cgmanager-0.36";

  src = fetchurl {
    url = "https://linuxcontainers.org/downloads/cgmanager/${name}.tar.gz";
    sha256 = "039azd4ghpmiccd95ki8fna321kccapff00rib6hrdgg600pyw7l";
  };

  buildInputs = [ pkgconfig libnih dbus ];

  configureFlags = [
    "--with-init-script=systemd"
    "--sysconfdir=/etc/"
    "--localstatedir=/var"
  ];

  installFlags = [ "DESTDIR=\${out}" ];

  postInstall = ''
    mv $out/$out/* $out
    DIR=$out/$out
    while rmdir $DIR 2>/dev/null; do
      DIR="$(dirname "$DIR")"
    done
  '';

  meta = with stdenv.lib; {
    homepage = https://linuxcontainers.org/cgmanager/introduction/;
    description = "a central privileged daemon that manages all your cgroups";
    license = licenses.lgpl21;
    platforms = platforms.linux;
    maintainers = with maintainers; [ wkennington ];
  };
}