NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.33k stars 13.57k forks source link

Birdtray hard codes a default path #291745

Open Syonis opened 6 months ago

Syonis commented 6 months ago

Birdtray hard codes a default path

Steps to reproduce the behavior:

  1. nix-shell -p birdtray
  2. start birdtray

Expected behavior

If you leave it as it is Birdtray tries to start Thunderbird with "/usr/bin/thunderbird" If you change that to "thunderbird" and launch birdtray it tries to launch "home/user/thunderbird"

Screenshots

birdtray_1 birdtray_2

Notify maintainers

@Flakebi

nixos-discourse commented 6 months ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/birdtray-path-of-thunderbird/40319/3

eclairevoyant commented 6 months ago

If you've added thunderbird to environment.systemPackages, then something like /run/current-system/sw/bin/thunderbird should work in the settings.

Syonis commented 6 months ago

Jep, thx. that worked. Should I than close this issue? Since the reason isn't fixed?

AndrewKvalheim commented 6 months ago

Ideally the package should manage this e.g. via OPT_THUNDERBIRD_CMDLINE.

eclairevoyant commented 6 months ago

Ideally the package should manage this e.g. via OPT_THUNDERBIRD_CMDLINE.

That's only going to set the default, and will become wrong if the thunderbird storepath changes, because the config will not update even if the default does.

AndrewKvalheim commented 6 months ago

I see, you’re pointing out that the default is copied to a stateful configuration file rather than merely used as a fallback.

eclairevoyant commented 6 months ago

Yes, and the copying only happens if the config file doesn't already exist. I'm inclined to say that upstream should consider reading from PATH, or provide the capability to do so.

dotlambda commented 6 months ago

Why don't we patch https://github.com/gyunaev/birdtray/blob/00110c50398cbae4d6da4521ccbf5d7166eac670/src/utils.cpp#L207? Replace the path with lib.getExe pkgs.thunderbird.

eclairevoyant commented 6 months ago

As said above, that will only affect the default path to thunderbird. That would break as soon as thunderbird updates and the config file points to a nonexistent binary.

If any patching were to be done, it would have to be done in src/settings.cpp, but that would break things for users who actually want to point to a binary elsewhere

ddogfoodd commented 4 months ago

What if there was a fork of birdtray for nix users that don't want to customize the binary path and just let nix handle it? Wouldn't that work?

Sikeen commented 3 months ago

what about a check for whether the system is nix or not? would that work?

Sikeen commented 3 months ago

in this case, another if statement in the code

eclairevoyant commented 1 month ago

Now that upstream has made a fix, I've created a PR to pull in that commit. Please give the PR #327363 a test and let me know if it works as expected.

ddogfoodd commented 1 month ago

@eclairevoyant thanks! I am not sure, if it works for me. I can make birdtray start thunderbird and the birdtray log shows an unread message for an inbox as it should. However other than the log and startup, it doesn't seem connected. It shows a red cross as if it was not connected and doesn't show unread counter or quits thunderbird when is quit itself.

eclairevoyant commented 1 month ago

Fair, I don't really use birdtray, so I don't know how it works, just made a best-effort attempt. If it doesn't work as designed, I can close it out and leave it for someone else to work on.