lol
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 dbus,
6 cmake,
7 pkg-config,
8 bash-completion,
9 gsl,
10 popt,
11 clightd,
12 systemd,
13 libconfig,
14 libmodule,
15 withGeoclue ? true,
16 geoclue2,
17 withUpower ? true,
18 upower,
19}:
20
21stdenv.mkDerivation rec {
22 pname = "clight";
23 version = "4.11";
24
25 src = fetchFromGitHub {
26 owner = "FedeDP";
27 repo = "Clight";
28 rev = version;
29 sha256 = "sha256-Fu38HRP83Yn2jsq9xnCWOXNlV/0hJKD1/cOOp3EV45Q=";
30 };
31
32 nativeBuildInputs = [
33 dbus
34 cmake
35 pkg-config
36 bash-completion
37 ];
38
39 buildInputs = [
40 gsl
41 popt
42 upower
43 clightd
44 systemd
45 geoclue2
46 libconfig
47 libmodule
48 ]
49 ++ lib.optional withGeoclue geoclue2
50 ++ lib.optional withUpower upower;
51
52 cmakeFlags = [
53 "-DSESSION_BUS_DIR=${placeholder "out"}/share/dbus-1/services"
54 "-DBASH_COMPLETIONS_DIR=${placeholder "out"}/share/bash-completions/completions"
55 "-DZSH_COMPLETIONS_DIR=${placeholder "out"}/share/zsh/site-functions"
56 ];
57
58 meta = with lib; {
59 description = "C daemon that turns your webcam into a light sensor";
60 homepage = "https://github.com/FedeDP/Clight";
61 platforms = platforms.linux;
62 license = licenses.gpl3;
63 maintainers = with maintainers; [
64 eadwu
65 ];
66 mainProgram = "clight";
67 };
68}