fork
Configure Feed
Select the types of activity you want to include in your feed.
nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
fork
Configure Feed
Select the types of activity you want to include in your feed.
1{ lib, stdenv, fetchFromGitHub, fetchFromGitLab
2, autoconf, automake, gettext, intltool
3, libtool, pkg-config, wrapGAppsHook, wrapPython, gobject-introspection
4, gtk3, python, pygobject3, pyxdg
5
6, withQuartz ? stdenv.isDarwin, ApplicationServices
7, withRandr ? stdenv.isLinux, libxcb
8, withDrm ? stdenv.isLinux, libdrm
9
10, withGeolocation ? true
11, withCoreLocation ? withGeolocation && stdenv.isDarwin, CoreLocation, Foundation, Cocoa
12, withGeoclue ? withGeolocation && stdenv.isLinux, geoclue
13, withAppIndicator ? stdenv.isLinux, libappindicator, libayatana-appindicator
14}:
15
16let
17 mkRedshift =
18 { pname, version, src, meta }:
19 stdenv.mkDerivation rec {
20 inherit pname version src meta;
21
22 patches = lib.optionals (pname != "gammastep") [
23 # https://github.com/jonls/redshift/pull/575
24 ./575.patch
25 ];
26
27 nativeBuildInputs = [
28 autoconf
29 automake
30 gettext
31 intltool
32 libtool
33 pkg-config
34 wrapGAppsHook
35 wrapPython
36 ];
37
38 configureFlags = [
39 "--enable-randr=${if withRandr then "yes" else "no"}"
40 "--enable-geoclue2=${if withGeoclue then "yes" else "no"}"
41 "--enable-drm=${if withDrm then "yes" else "no"}"
42 "--enable-quartz=${if withQuartz then "yes" else "no"}"
43 "--enable-corelocation=${if withCoreLocation then "yes" else "no"}"
44 ] ++ lib.optionals (pname == "gammastep") [
45 "--with-systemduserunitdir=${placeholder "out"}/share/systemd/user/"
46 "--enable-apparmor"
47 ];
48
49 buildInputs = [
50 gobject-introspection
51 gtk3
52 python
53 ] ++ lib.optional withRandr libxcb
54 ++ lib.optional withGeoclue geoclue
55 ++ lib.optional withDrm libdrm
56 ++ lib.optional withQuartz ApplicationServices
57 ++ lib.optionals withCoreLocation [ CoreLocation Foundation Cocoa ]
58 ++ lib.optional withAppIndicator (if (pname != "gammastep")
59 then libappindicator
60 else libayatana-appindicator)
61 ;
62
63 pythonPath = [ pygobject3 pyxdg ];
64
65 preConfigure = "./bootstrap";
66
67 dontWrapGApps = true;
68
69 preFixup = ''
70 makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
71 '';
72
73 postFixup = ''
74 wrapPythonPrograms
75 wrapGApp $out/bin/${pname}
76 '';
77
78 # the geoclue agent may inspect these paths and expect them to be
79 # valid without having the correct $PATH set
80 postInstall = if (pname == "gammastep") then ''
81 substituteInPlace $out/share/applications/gammastep.desktop \
82 --replace 'Exec=gammastep' "Exec=$out/bin/gammastep"
83 substituteInPlace $out/share/applications/gammastep-indicator.desktop \
84 --replace 'Exec=gammastep-indicator' "Exec=$out/bin/gammastep-indicator"
85 '' else ''
86 substituteInPlace $out/share/applications/redshift.desktop \
87 --replace 'Exec=redshift' "Exec=$out/bin/redshift"
88 substituteInPlace $out/share/applications/redshift-gtk.desktop \
89 --replace 'Exec=redshift-gtk' "Exec=$out/bin/redshift-gtk"
90 '';
91
92 enableParallelBuilding = true;
93 };
94in
95rec {
96 redshift = mkRedshift rec {
97 pname = "redshift";
98 version = "1.12";
99
100 src = fetchFromGitHub {
101 owner = "jonls";
102 repo = "redshift";
103 rev = "v${version}";
104 sha256 = "12cb4gaqkybp4bkkns8pam378izr2mwhr2iy04wkprs2v92j7bz6";
105 };
106
107 meta = with lib; {
108 description = "Screen color temperature manager";
109 longDescription = ''
110 Redshift adjusts the color temperature according to the position
111 of the sun. A different color temperature is set during night and
112 daytime. During twilight and early morning, the color temperature
113 transitions smoothly from night to daytime temperature to allow
114 your eyes to slowly adapt. At night the color temperature should
115 be set to match the lamps in your room.
116 '';
117 license = licenses.gpl3Plus;
118 homepage = "http://jonls.dk/redshift";
119 platforms = platforms.unix;
120 maintainers = with maintainers; [ globin yana ];
121 };
122 };
123
124 gammastep = mkRedshift rec {
125 pname = "gammastep";
126 version = "2.0.9";
127
128 src = fetchFromGitLab {
129 owner = "chinstrap";
130 repo = pname;
131 rev = "v${version}";
132 sha256 = "sha256-EdVLBBIEjMu+yy9rmcxQf4zdW47spUz5SbBDbhmLjOU=";
133 };
134
135 meta = redshift.meta // {
136 name = "${pname}-${version}";
137 longDescription = "Gammastep"
138 + lib.removePrefix "Redshift" redshift.meta.longDescription;
139 homepage = "https://gitlab.com/chinstrap/gammastep";
140 maintainers = [ lib.maintainers.primeos ] ++ redshift.meta.maintainers;
141 };
142 };
143}