From 4fec5df9087951b55334aa3052e47c058c759a6e Mon Sep 17 00:00:00 2001 From: eymeric Date: Sat, 19 Oct 2024 17:01:45 +0200 Subject: [PATCH] antares: add .desktop file install --- pkgs/by-name/an/antares/package.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/pkgs/by-name/an/antares/package.nix b/pkgs/by-name/an/antares/package.nix index eea89f2ff8dd..e5cc1e500a47 100644 --- a/pkgs/by-name/an/antares/package.nix +++ b/pkgs/by-name/an/antares/package.nix @@ -4,6 +4,8 @@ buildNpmPackage, electron, nodejs, + makeDesktopItem, + copyDesktopItems, }: buildNpmPackage rec { @@ -28,6 +30,8 @@ buildNpmPackage rec { buildInputs = [ nodejs ]; + nativeBuildInputs = [ copyDesktopItems ]; + npmBuildScript = "compile"; installPhase = '' @@ -38,12 +42,30 @@ buildNpmPackage rec { makeWrapper ${lib.getExe electron} $out/bin/antares \ --add-flags $out/lib/node_modules/antares/main.js runHook postInstall + + # Install icon files + mkdir -pv $out/share/icon/ + cp assets/icon.ico $out/share/icon/antares.ico ''; npmFlags = [ "--legacy-peer-deps" ]; env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1"; env.PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = "1"; + desktopItems = [ + (makeDesktopItem { + name = pname; + desktopName = "Antares SQL"; + exec = pname; + icon = pname; + terminal = false; + type = "Application"; + startupWMClass = pname; + comment = "A modern, fast and productivity driven SQL client with a focus in UX"; + categories = [ "Development" ]; + }) + ]; + meta = with lib; { description = "Modern, fast and productivity driven SQL client with a focus in UX"; homepage = "https://github.com/antares-sql/antares";