summaryrefslogtreecommitdiff
path: root/pkgs/openrc/default.nix
blob: 3cb6d8eb8fd554dadddb379dc6e2761c80a46f27 (plain)
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
{ stdenv, lib, fetchgit
, meson, ninja, pkg-config
, pam, ncurses
}:

stdenv.mkDerivation rec {
  pname = "openrc";
  version = "0.44.10";
  meta = with lib; {
    homepage = "https://github.com/OpenRC/openrc";
    description = "OpenRC manages the services, startup and shutdown of a host";
    platforms = with platforms; linux;
    license = licenses.bsd2;
  };

  src = fetchgit {
    url = "https://github.com/OpenRC/openrc.git";
    rev = version;
    sha256 = "0azb3ywclzx6cz9bmfpc4aqysz1pq4akr882bvnqh2x78xixcydv";
  };

  nativeBuildInputs = [ meson ninja pkg-config ];
  buildInputs = [ pam ncurses ];

  outputs = [ "out" "dev" "man" "support" ];

  preConfigure = "export DESTDIR=/";
  mesonFlags = [
    "-Dbranding=\"NIXOS\""
    "-Dos=Linux"
    "-Dselinux=disabled"
    "-Daudit=disabled"
    "-Dsysvinit=false"
    "-Dtermcap=ncurses"
    "-Dnewnet=true"
    "-Drootprefix=${placeholder "out"}"
    "--sysconfdir=${placeholder "out"}/etc"
  ];
  postInstall = ''
    mkdir -p "$support/share/openrc/"
    mv "$out/share/openrc/support" "$support/share/openrc/"

    #mkdir -p "$etc"
    #mv "$out/etc" "$etc/"
  '';
}