summary refs log tree commit diff
path: root/pkgs/tools/admin/cdist/default.nix
blob: 8467605727c933030348a9d2bdc9f9a2f00519e0 (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
{ lib
, buildPythonApplication
, fetchFromGitea
, pythonImportsCheckHook
, six
, sphinxHook
, sphinx-rtd-theme
}:

buildPythonApplication rec {
  pname = "cdist";
  version = "7.0.0";
  outputs = [ "out" "man" "doc" ];

  src = fetchFromGitea {
    domain = "code.ungleich.ch";
    owner = "ungleich-public";
    repo = "cdist";
    rev = version;
    hash = "sha256-lIx0RtGQJdY2e00azI9yS6TV+5pCegpKOOD0dQmgMqA=";
  };

  nativeBuildInputs = [
    pythonImportsCheckHook
    six
    sphinxHook
    sphinx-rtd-theme
  ];

  sphinxRoot = "docs/src";

  # "make man" creates symlinks in docs/src needed by sphinxHook.
  postPatch = ''
    echo "VERSION = '$version'" > cdist/version.py

    make man
  '';

  preConfigure = ''
    export HOME=/tmp
  '';

  # Test suite requires either non-chrooted environment or root.
  #
  # When "machine_type" explorer figures out that it is running inside
  # chroot, it assumes that it has enough privileges to escape it.
  doCheck = false;

  pythonImportsCheck = [ "cdist" ];

  postInstall = ''
    mkdir -p $out/share
    mv docs/dist/man $out/share
  '';

  meta = with lib; {
    description = "Minimalistic configuration management system";
    homepage = "https://www.sdi.st";
    changelog = "https://code.ungleich.ch/ungleich-public/cdist/src/tag/${version}/docs/changelog";

    # Mostly. There are still couple types that are gpl3-only.
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ kaction ];
    platforms = platforms.unix;
  };
}