about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/misc/redshift/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/misc/redshift/default.nix')
-rw-r--r--nixpkgs/pkgs/applications/misc/redshift/default.nix34
1 files changed, 30 insertions, 4 deletions
diff --git a/nixpkgs/pkgs/applications/misc/redshift/default.nix b/nixpkgs/pkgs/applications/misc/redshift/default.nix
index 05dc4c429b61..86c787df62aa 100644
--- a/nixpkgs/pkgs/applications/misc/redshift/default.nix
+++ b/nixpkgs/pkgs/applications/misc/redshift/default.nix
@@ -1,4 +1,5 @@
-{ stdenv, fetchFromGitHub, autoconf, automake, gettext, intltool
+{ stdenv, fetchFromGitHub, fetchFromGitLab
+, autoconf, automake, gettext, intltool
 , libtool, pkgconfig, wrapGAppsHook, wrapPython, gobject-introspection
 , gtk3, python, pygobject3, pyxdg
 
@@ -18,7 +19,7 @@ let
     stdenv.mkDerivation rec {
       inherit pname version src meta;
 
-      patches = [
+      patches = stdenv.lib.optionals (pname != "gammastep") [
         # https://github.com/jonls/redshift/pull/575
         ./575.patch
       ];
@@ -62,10 +63,15 @@ let
 
       # the geoclue agent may inspect these paths and expect them to be
       # valid without having the correct $PATH set
-      postInstall = ''
+      postInstall = if (pname == "gammastep") then ''
+        substituteInPlace $out/share/applications/gammastep.desktop \
+          --replace 'Exec=gammastep' "Exec=$out/bin/gammastep"
+        substituteInPlace $out/share/applications/gammastep-indicator.desktop \
+          --replace 'Exec=gammastep-indicator' "Exec=$out/bin/gammastep-indicator"
+      '' else ''
         substituteInPlace $out/share/applications/redshift.desktop \
           --replace 'Exec=redshift' "Exec=$out/bin/redshift"
-        substituteInPlace $out/share/applications/redshift.desktop \
+        substituteInPlace $out/share/applications/redshift-gtk.desktop \
           --replace 'Exec=redshift-gtk' "Exec=$out/bin/redshift-gtk"
       '';
 
@@ -118,4 +124,24 @@ rec {
       homepage = "https://github.com/minus7/redshift";
     };
   };
+
+  gammastep = mkRedshift rec {
+    pname = "gammastep";
+    version = "2.0.2";
+
+    src = fetchFromGitLab {
+      owner = "chinstrap";
+      repo = pname;
+      rev = "v${version}";
+      sha256 = "09wqlz3yya955galhs20014qfwm2yk0lxhyqdsw8gwddvcpyprzg";
+    };
+
+    meta = redshift.meta // {
+      name = "${pname}-${version}";
+      longDescription = "Gammastep"
+        + stdenv.lib.removePrefix "Redshift" redshift.meta.longDescription;
+      homepage = "https://gitlab.com/chinstrap/gammastep";
+      maintainers = [ stdenv.lib.maintainers.primeos ] ++ redshift.meta.maintainers;
+    };
+  };
 }