about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/misc/redshift-plasma-applet/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/misc/redshift-plasma-applet/default.nix')
-rw-r--r--nixpkgs/pkgs/applications/misc/redshift-plasma-applet/default.nix44
1 files changed, 44 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/misc/redshift-plasma-applet/default.nix b/nixpkgs/pkgs/applications/misc/redshift-plasma-applet/default.nix
new file mode 100644
index 000000000000..03b8d709fce2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/redshift-plasma-applet/default.nix
@@ -0,0 +1,44 @@
+{ stdenv, cmake, extra-cmake-modules, plasma-framework, kwindowsystem, redshift, fetchFromGitHub, }:
+
+let version = "1.0.18"; in
+
+stdenv.mkDerivation {
+  name = "redshift-plasma-applet-${version}";
+
+  src = fetchFromGitHub {
+    owner = "kotelnik";
+    repo = "plasma-applet-redshift-control";
+    rev = "v${version}";
+    sha256 = "122nnbafa596rxdxlfshxk45lzch8c9342bzj7kzrsjkjg0xr9pq";
+  };
+
+  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'"
+  '';
+
+  nativeBuildInputs = [
+    cmake
+    extra-cmake-modules
+  ];
+
+  buildInputs = [
+    plasma-framework
+    kwindowsystem
+  ];
+
+  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 zraexy ];
+  };
+}