oklch-color-picker: add desktop entry

This commit is contained in:
Thibaut Smith
2026-09-05 14:49:29 +02:00
parent 0af3d1402d
commit 06e4e90bca

View File

@@ -9,6 +9,8 @@
libxkbcommon,
libGL,
stdenv,
makeDesktopItem,
copyDesktopItems,
}:
rustPlatform.buildRustPackage (finalAttrs: {
@@ -24,7 +26,10 @@ rustPlatform.buildRustPackage (finalAttrs: {
cargoHash = "sha256-FB8zvWhO+ZbzWjkQCnf3ghgM+IL4px7QNO4dLPcczec=";
nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ];
nativeBuildInputs = [
copyDesktopItems
]
++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ];
runtimeDependencies = [
libGL
@@ -38,6 +43,24 @@ rustPlatform.buildRustPackage (finalAttrs: {
doInstallCheck = true;
passthru.updateScript = nix-update-script { };
postInstall = ''
install -Dm444 assets/icon.png $out/share/icons/hicolor/512x512/apps/${finalAttrs.meta.mainProgram}.png
'';
desktopItems = [
(makeDesktopItem {
name = finalAttrs.meta.mainProgram;
exec = finalAttrs.meta.mainProgram;
icon = finalAttrs.meta.mainProgram;
desktopName = "OKLCH Color Picker";
genericName = "Color Picker";
comment = finalAttrs.meta.description;
categories = [
"Graphics"
];
})
];
meta = {
description = "Color picker for Oklch";
longDescription = ''
@@ -46,6 +69,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
'';
homepage = "https://github.com/eero-lehtinen/oklch-color-picker";
changelog = "https://github.com/eero-lehtinen/oklch-color-picker/releases/tag/${finalAttrs.version}";
mainProgram = "oklch-color-picker";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ videl ];
};