about summary refs log tree commit diff
path: root/pkgs/applications/misc/redshift-plasma-applet/default.nix
blob: 3cf6f7d754be051ca5d7503393249f8ad84f366a (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
{ stdenv, cmake, kde5, redshift, fetchFromGitHub, ... }:

let version = "1.0.17"; in

stdenv.mkDerivation {
  name = "redshift-plasma-applet-${version}";

  src = fetchFromGitHub {
    owner = "kotelnik";
    repo = "plasma-applet-redshift-control";
    rev = "v${version}";
    sha256 = "1lp1rb7i6c18lrgqxsglbvyvzh71qbm591abrbhw675ii0ca9hgj";
  };

  patchPhase = ''
    substituteInPlace package/contents/ui/main.qml \
      --replace "redshiftCommand: 'redshift'" \
                "redshiftCommand: '${redshift}/bin/redshift'" \
      --replace "redshiftOneTimeCommand: 'redshift -O " \
                "redshiftOneTimeCommand: '${redshift}/bin/redshift -O "

    substituteInPlace package/contents/ui/config/ConfigAdvanced.qml \
      --replace "'redshift -V'" \
                "'${redshift}/bin/redshift -V'"
  '';

  buildInputs = [
    cmake
    kde5.plasma-framework
  ];


  meta = with stdenv.lib; {
    description = "KDE Plasma 5 widget for controlling Redshift";
    homepage = https://github.com/kotelnik/plasma-applet-redshift-control;
    license = licenses.gpl2Plus;
    platforms = platforms.linux;
    maintainers = with maintainers; [ benley ];
  };
}