-
Notifications
You must be signed in to change notification settings - Fork 37
/
fw-fanctrl.nix
73 lines (61 loc) · 1.25 KB
/
fw-fanctrl.nix
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
68
69
70
71
72
73
{
lib,
python3Packages,
python3,
bash,
callPackage,
getopt,
fw-ectool
}:
let
pversion = "20-04-2024";
description = "A simple systemd service to better control Framework Laptop's fan(s)";
url = "https://github.com/TamtamHero/fw-fanctrl";
in
python3Packages.buildPythonPackage rec{
pname = "fw-fanctrl";
version = pversion;
src = ../../.;
outputs = [ "out" ];
preBuild = ''
cat > setup.py << EOF
from setuptools import setup
setup(
name="fw-fanctrl",
description="${description}",
url="${url}",
platforms=["linux"],
py_modules=[],
scripts=[
"fanctrl.py",
],
)
EOF
'';
nativeBuildInputs = [
python3
getopt
bash
];
propagatedBuildInputs = [
fw-ectool
];
doCheck = false;
postPatch = ''
patchShebangs --build fanctrl.py
patchShebangs --build install.sh
'';
installPhase = ''
./install.sh --dest-dir $out --prefix-dir "" --no-ectool --no-post-install --no-sudo
rm -rf $out/etc
rm -rf $out/lib
'';
meta = with lib; {
mainProgram = "fw-fanctrl";
homepage = url;
description = description;
platforms = with platforms; linux;
license = licenses.bsd3;
maintainers = with maintainers; [ "Svenum" ];
};
}