fix(nix): provide .desktop entry and icon for librefang-desktop (#3156)#3165
Merged
Conversation
Switch to nixpkgs' standard makeDesktopItem + copyDesktopItems helpers instead of an inline heredoc, and install icons at every native size shipped in the repo (32, 128, 256, 512) under share/icons/hicolor so desktop environments can pick the closest match without rescaling. Also drops the manual update-desktop-database call -- that cache is maintained by the user environment, not the package output, and the non-standard 'AI' Categories value (which desktop-file-validate flags) is replaced with the standard Development;Utility; pair.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
Author
|
✅ SSH-validated on NixOS (Linux 6.12.82, nix 2.31.4): Initial build hit After fix: The validate hint is cosmetic (some DEs may list LibreFang twice if both Development and Utility menus are shown). If you'd rather suppress that hint, change `categories = [ "Development" ];` (drop "Utility") in `flake.nix`. The functional behaviour is correct as-is. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactors the
librefang-desktopNix derivation to follow the standard nixpkgs pattern for shipping a Linux desktop application, addressing the underlying cause of #3156.The previous fix (#3157) wrote the
.desktopfile via an inline heredoc and only installed a single 128x128 icon. This PR moves to themakeDesktopItem+copyDesktopItemshelpers and installs every icon size already shipped incrates/librefang-desktop/icons/, so launchers under GNOME / KDE / sway / etc. can pick the closest match without rescaling.Changes
flake.nix(only thelibrefang-desktoppackage — CLI, devShell, checks untouched, no new flake inputs,flake.locknot modified):librefangDesktopItemviapkgs.makeDesktopItem(proper XDG escaping, no manual heredoc).copyDesktopItemstonativeBuildInputs(Linux only — no-op on darwin).[email protected]) and 512x512 (fromicon.png) under$out/share/icons/hicolor/<size>/apps/librefang-desktop.png.update-desktop-databasecall — that cache is maintained by the user environment, not the package output.AIvalue inCategories(whichdesktop-file-validateflags) with the standardDevelopment;Utility;pair. Keywords still exposeAI;Agent;LLM;Automation;for search.Icon=librefang-desktopandStartupWMClass=librefang-desktopso launchers correlate the menu entry with the running Tauri window.Verification (ssh to a NixOS machine required)
The CI sandbox in this environment cannot run
nix build, so the changes were not built locally. A reviewer with access to a Linux NixOS machine should run:Expected: launching from the menu starts
librefang-desktop, the window's launcher icon (viaStartupWMClass) matches the menu icon, and #3156 is closed.Notes
makeDesktopItemandcopyDesktopItemsship in nixpkgs.flake.lockis intentionally unchanged.copyDesktopItemsand thepostInstallicon installs are gated onpkgs.stdenv.isLinux.