3
0
Fork 0
forked from mirrors/nixpkgs

redshift: install desktop files, and use absolute paths in them to avoid confusing geoclue agent

This commit is contained in:
Michael Peyton Jones 2018-08-09 15:17:43 +01:00
parent 2428f5dda1
commit a1762065c3
No known key found for this signature in database
GPG key ID: 86A43C24A728F66D
2 changed files with 12 additions and 0 deletions

View file

@ -116,6 +116,9 @@ in {
} }
]; ];
# needed so that .desktop files are installed, which geoclue cares about
environment.systemPackages = [ cfg.package ];
services.geoclue2.enable = mkIf (cfg.provider == "geoclue2") true; services.geoclue2.enable = mkIf (cfg.provider == "geoclue2") true;
systemd.user.services.redshift = systemd.user.services.redshift =

View file

@ -61,6 +61,15 @@ stdenv.mkDerivation rec {
postFixup = "wrapPythonPrograms"; postFixup = "wrapPythonPrograms";
# the geoclue agent may inspect these paths and expect them to be
# valid without having the correct $PATH set
postInstall = ''
substituteInPlace $out/share/applications/redshift.desktop \
--replace 'Exec=redshift' "Exec=$out/bin/redshift"
substituteInPlace $out/share/applications/redshift.desktop \
--replace 'Exec=redshift-gtk' "Exec=$out/bin/redshift-gtk"
'';
enableParallelBuilding = true; enableParallelBuilding = true;
meta = with stdenv.lib; { meta = with stdenv.lib; {