summary refs log tree commit diff
path: root/pkgs/os-specific/linux/nvidia-x11
diff options
context:
space:
mode:
authorAmbroz Bizjak <abizjak.pro@gmail.com>2019-06-27 13:02:53 +0200
committerMatthieu Coudron <coudron@iij.ad.jp>2019-07-13 03:44:38 +0200
commitf93c5deb47ae7da3e04abb121dfb162a82f4551c (patch)
tree095c2b5189ccf62472cf2bda443e05e1a42c7f87 /pkgs/os-specific/linux/nvidia-x11
parent2d7bce29d17747ed77eb0ef98f8aef63b3cd34d6 (diff)
downloadnixpkgs-f93c5deb47ae7da3e04abb121dfb162a82f4551c.tar
nixpkgs-f93c5deb47ae7da3e04abb121dfb162a82f4551c.tar.gz
nixpkgs-f93c5deb47ae7da3e04abb121dfb162a82f4551c.tar.bz2
nixpkgs-f93c5deb47ae7da3e04abb121dfb162a82f4551c.tar.lz
nixpkgs-f93c5deb47ae7da3e04abb121dfb162a82f4551c.tar.xz
nixpkgs-f93c5deb47ae7da3e04abb121dfb162a82f4551c.tar.zst
nixpkgs-f93c5deb47ae7da3e04abb121dfb162a82f4551c.zip
nvidia-settings: Install desktop file and icon.
The template has substitution variables intended to be replaced resulting
in absolute paths. Because absolute paths break after the desktop file is
copied by a desktop environment, make Exec and Icon be just a name.
Diffstat (limited to 'pkgs/os-specific/linux/nvidia-x11')
-rw-r--r--pkgs/os-specific/linux/nvidia-x11/settings.nix11
1 files changed, 11 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/nvidia-x11/settings.nix b/pkgs/os-specific/linux/nvidia-x11/settings.nix
index 5420a651c79..1867c1a133a 100644
--- a/pkgs/os-specific/linux/nvidia-x11/settings.nix
+++ b/pkgs/os-specific/linux/nvidia-x11/settings.nix
@@ -72,6 +72,17 @@ stdenv.mkDerivation rec {
     ${lib.optionalString (!withGtk3) ''
       rm -f $out/lib/libnvidia-gtk3.so.*
     ''}
+
+    # Install the desktop file and icon.
+    # The template has substitution variables intended to be replaced resulting
+    # in absolute paths. Because absolute paths break after the desktop file is
+    # copied by a desktop environment, make Exec and Icon be just a name.
+    sed -i doc/nvidia-settings.desktop \
+      -e "s|^Exec=.*$|Exec=nvidia-settings|" \
+      -e "s|^Icon=.*$|Icon=nvidia-settings|" \
+      -e "s|__NVIDIA_SETTINGS_DESKTOP_CATEGORIES__|Settings|g"
+    install doc/nvidia-settings.desktop -D -t $out/share/applications/
+    install doc/nvidia-settings.png -D -t $out/share/icons/hicolor/128x128/apps/
   '';
 
   binaryName = if withGtk3 then ".nvidia-settings-wrapped" else "nvidia-settings";