Skip to content

tidal-hifi: improve quality of the desktop entry#419474

Merged
roberth merged 2 commits intoNixOS:masterfrom
spikespaz-contrib:u/jacob/tidal-hifi/improve-desktop-entry
Jun 27, 2025
Merged

tidal-hifi: improve quality of the desktop entry#419474
roberth merged 2 commits intoNixOS:masterfrom
spikespaz-contrib:u/jacob/tidal-hifi/improve-desktop-entry

Conversation

@spikespaz
Copy link
Contributor

@spikespaz spikespaz commented Jun 24, 2025

This PR improves the desktop entry for tidal-hifi because I noticed it looked a little funny.

Summary:

  • Changed the file name to tidal-hifi (to remove the whitespace).
  • Change the desktopName (aesthetic name) to "TIDAL Hi-Fi".
  • Change the generic name to "Music Player" because "TIDAL Hi-Fi" is not generic.
  • Make comment and exec (and name) follow the values used for meta attributes to reduce maintenance overhead slightly.
  • Fix capitalization errors in meta.description.
  • Change the categories slightly to be more similar to other streaming service programs.
  • Re-ordered the attributes to make it easier to read along with https://specifications.freedesktop.org/desktop-entry-spec/1.4/recognized-keys.html.

Each commit has a justification in its summary.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • Nixpkgs 25.11 Release Notes (or backporting 24.11 and 25.05 Nixpkgs Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
  • NixOS 25.11 Release Notes (or backporting 24.11 and 25.05 NixOS Release notes)
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other contributing documentation in corresponding paths.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Jun 24, 2025
@nix-owners nix-owners bot requested review from Gerg-L and qbit June 24, 2025 07:30
Copy link
Contributor

@Gerg-L Gerg-L left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to mirror upstreams desktop entry... This is fine though.

It only needs to be one commit

@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. labels Jun 24, 2025
@spikespaz spikespaz force-pushed the u/jacob/tidal-hifi/improve-desktop-entry branch from 2594f48 to 46a2557 Compare June 24, 2025 18:12
This reorders all of the attributes to follow the same order as the
Freedesktop.org specification.

<https://specifications.freedesktop.org/desktop-entry-spec/1.4/recognized-keys.html>
This patch improves the desktop entry for `tidal-hifi` because I noticed it looked a little funny.

Summary:
 - Changed the file name to `tidal-hifi` (to remove the whitespace).
 - Change the `desktopName` (aesthetic name) to "TIDAL Hi-Fi".
 - Change the generic name to "Music Player" because "TIDAL Hi-Fi" is not generic.
 - Make `comment` and `exec` (and `name`) follow the values used for `meta` attributes to reduce maintenance overhead slightly.
 - Fix capitalization errors in `meta.description`.
 - Change the `categories` slightly to be more similar to other streaming service programs.
 - Re-ordered the attributes to make it easier to read along with <https://specifications.freedesktop.org/desktop-entry-spec/1.4/recognized-keys.html>.

Each commit has a justification in its summary.

tidal-hifi: remove type from desktop entry

It already has a default value of `"Application"` if left unspecified.

It's also not included in the example for this build helper.

<https://github.com/NixOS/nixpkgs/blob/fd751b2cae7edc93d8f4bf11916169aae84964aa/doc/build-helpers/trivial-build-helpers.chapter.md?plain=1#L219-L221>

tidal-hifi: change desktop entry filename to self.pname

The `name` argument for this function corresponds to the filename in the
Nix store, it is not the human-friendly display name.

Some desktop entries use the display name as the filename, but I hate
spaces in filenames if they aren't necessary.

<https://github.com/NixOS/nixpkgs/blob/fd751b2cae7edc93d8f4bf11916169aae84964aa/doc/build-helpers/trivial-build-helpers.chapter.md?plain=1#L215-L217>

tidal-hifi: change desktop entry display name to TIDAL Hi-Fi

The `desktopName` argument to this function corresponds with the `Name`
key in the generated `.desktop` file, which is the display name for the
human.

<https://github.com/NixOS/nixpkgs/blob/fd751b2cae7edc93d8f4bf11916169aae84964aa/doc/build-helpers/trivial-build-helpers.chapter.md?plain=1#L223-L225>

tidal-hifi: change desktop entry generic name to Music Player

Judging by the example given in the Nixpkgs documentation, this generic
name should be a short description of what the program does.

In this case, it is a "Music Player".

<https://github.com/NixOS/nixpkgs/blob/fd751b2cae7edc93d8f4bf11916169aae84964aa/doc/build-helpers/trivial-build-helpers.chapter.md?plain=1#L247>

tidal-hifi: desktop entry comment same as meta.description

There's no reason to say the same thing twice.

Also fixed the capitalization of "Electron" and "Widevine"
since they are proper nouns.

tidal-hifi: change desktop entry exec to meta.mainProgram

The `meta.mainProgram` attribute is now considered the source of truth
if the binary name changes upstream, it only has to be updated in one
position for this package.

tidal-hifi: change desktop entry categories to match other music players

Removed `Video`, kept `Network`, now it matches Spotify's desktop entry
more closely.
desktopName = "tidal-hifi";
genericName = "TIDAL Hi-Fi";
comment = "The web version of listen.tidal.com running in electron with hifi support thanks to widevine.";
name = self.pname;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm not mistaken, it is discouraged to re-use pname in the derivation. Please, keep the hard-coded name here.

Copy link
Contributor Author

@spikespaz spikespaz Jun 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm afraid I need to ask you to cite a source (or reason it out). I'm not sure I recall seeing that advice anywhere.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That comment you linked covers a very specific circumstance. That is not this circumstance. In this case, that's the reason to use self.pname recursively, where it is not a footgun.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name (String)

The name of the desktop file in the Nix store.

Seems like a match.
It is not the Name field of the desktop entry, so it seems quite inconsequential.
LGTM.

comment = self.meta.description;
icon = "tidal-hifi";
startupNotify = true;
exec = self.meta.mainProgram;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I'm less sure... Maybe it's better to switch to meta.mainProgram indeed... Not sure though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the advice you recall is that using attributes via rec is bad, given the wide scope that is a package definition? Certainly, if someone overrides this package and changes the meta.mainProgram because the package's executable has been renamed, they'd appreciate the recursion.

Same goes for pname in fact, if this definition is used as the base for a fork, and pname is changed via overrideAttrs, you'd want the desktop entry's filename to not conflict with the upstream one. Doing the same thing with a let binding only accomplishes the second purpose, the single source of truth. For overrides, that benefit would be lost.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very hypothetical, but LGTM.

@roberth roberth merged commit 12f7523 into NixOS:master Jun 27, 2025
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants