summary refs log tree commit diff
path: root/pkgs/games
diff options
context:
space:
mode:
authorMartin Weinelt <hexa@darmstadt.ccc.de>2020-08-06 22:52:35 +0200
committerMartin Weinelt <hexa@darmstadt.ccc.de>2020-08-07 01:05:30 +0200
commit6dbeed2d1d355b16145255a18321eacd32d93852 (patch)
tree406398f3b0d597420933c954b32c3b40215d5f57 /pkgs/games
parentcab546b13806d351f44c75c4cb73eec625582b38 (diff)
downloadnixpkgs-6dbeed2d1d355b16145255a18321eacd32d93852.tar
nixpkgs-6dbeed2d1d355b16145255a18321eacd32d93852.tar.gz
nixpkgs-6dbeed2d1d355b16145255a18321eacd32d93852.tar.bz2
nixpkgs-6dbeed2d1d355b16145255a18321eacd32d93852.tar.lz
nixpkgs-6dbeed2d1d355b16145255a18321eacd32d93852.tar.xz
nixpkgs-6dbeed2d1d355b16145255a18321eacd32d93852.tar.zst
nixpkgs-6dbeed2d1d355b16145255a18321eacd32d93852.zip
factorio: add .desktop file
Diffstat (limited to 'pkgs/games')
-rw-r--r--pkgs/games/factorio/default.nix17
1 files changed, 16 insertions, 1 deletions
diff --git a/pkgs/games/factorio/default.nix b/pkgs/games/factorio/default.nix
index d8770addf66..fb69b9d3819 100644
--- a/pkgs/games/factorio/default.nix
+++ b/pkgs/games/factorio/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, makeWrapper
+{ stdenv, fetchurl, makeWrapper, makeDesktopItem
 , alsaLib, libpulseaudio, libX11, libXcursor, libXinerama, libXrandr, libXi, libGL
 , libSM, libICE, libXext, factorio-utils
 , releaseType
@@ -45,6 +45,16 @@ let
     Note the ultimate "_" is replaced with "-" in the --name arg!
   '';
 
+  desktopItem = makeDesktopItem {
+    name = "factorio";
+    desktopName = "Factorio";
+    comment = "A game in which you build and maintain factories.";
+    exec = "factorio";
+    icon = "factorio";
+    type = "Application";
+    categories = "Game";
+  };
+
   branch = if experimental then "experimental" else "stable";
 
   # NB `experimental` directs us to take the latest build, regardless of its branch;
@@ -148,6 +158,11 @@ let
       patchelf \
         --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
         $out/bin/factorio
+
+      mkdir -p $out/share/icons/hicolor/{64x64,128x128}/apps
+      cp -a data/core/graphics/factorio-icon.png $out/share/icons/hicolor/64x64/apps/factorio.png
+      cp -a data/core/graphics/factorio-icon@2x.png $out/share/icons/hicolor/128x128/apps/factorio.png
+      ln -s ${desktopItem}/share/applications $out/share/
     '';
 
     meta = {