about summary refs log tree commit diff
path: root/pkgs/applications/system/coolercontrol/coolercontrol-liqctld.nix
blob: 054b7a8fafff7518f9f5aed63377e0c2aee8cc80 (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
{ python3
}:

{ version
, src
, meta
}:

python3.pkgs.buildPythonApplication {
  pname = "coolercontrol-liqctld";
  inherit version src;
  sourceRoot = "${src.name}/coolercontrol-liqctld";
  format = "pyproject";

  nativeBuildInputs = with python3.pkgs; [
    setuptools
  ];

  propagatedBuildInputs = with python3.pkgs; [
    liquidctl
    setproctitle
    fastapi
    uvicorn
  ];

  postInstall = ''
    install -Dm444 "${src}/packaging/systemd/coolercontrol-liqctld.service" -t "$out/lib/systemd/system"
    substituteInPlace "$out/lib/systemd/system/coolercontrol-liqctld.service" \
      --replace '/usr/bin' "$out/bin"
  '';

  meta = meta // {
    description = "${meta.description} (Liquidctl Daemon)";
    mainProgram = "coolercontrol-liqctld";
  };
}