From b5c5a0936e12d4d18fa4b924d1619db6bb8d92f2 Mon Sep 17 00:00:00 2001 From: FliegendeWurst <2012gdwu+github@posteo.de> Date: Mon, 16 Oct 2023 08:42:28 +0200 Subject: [PATCH] openscad-snapshot: add desktop item --- pkgs/openscad-snapshot/default.nix | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/pkgs/openscad-snapshot/default.nix b/pkgs/openscad-snapshot/default.nix index 6d948bf..4ff8748 100644 --- a/pkgs/openscad-snapshot/default.nix +++ b/pkgs/openscad-snapshot/default.nix @@ -1,4 +1,4 @@ -{ lib, fetchurl, appimageTools, openscad, makeWrapper }: +{ lib, fetchurl, appimageTools, openscad, makeWrapper, makeDesktopItem }: let pname = "openscad"; @@ -7,6 +7,19 @@ let url = "https://files.openscad.org/snapshots/OpenSCAD-${version}-x86_64.AppImage"; sha256 = "sha256-mEGmkL2lL7JxK0nRPLtnfg4vxtkK3URz351eyuRHZPE="; }; + + desktopItem = makeDesktopItem { + name = "OpenSCAD"; + exec = "${pname}-${version} %f"; + comment = "The Programmers Solid 3D CAD Modeller (development snapshot)"; + icon = "openscad-nightly"; + desktopName = "OpenSCAD"; + genericName = "OpenSCAD"; + mimeTypes = [ "application/x-openscad" ]; + categories = [ "Graphics" "3DGraphics" "Engineering" ]; + keywords = [ "3d" "solid" "geometry" "csg" "model" "stl"]; + }; + appimageContents = appimageTools.extractType2 { inherit pname version src; }; in appimageTools.wrapType2 { @@ -16,6 +29,9 @@ appimageTools.wrapType2 { source "${makeWrapper}/nix-support/setup-hook" wrapProgram $out/bin/${pname}-${version} \ --unset QT_PLUGIN_PATH + + mkdir -p $out/share + cp -rt $out/share ${desktopItem}/share/applications ${appimageContents}/usr/share/icons ''; meta = with lib; {