nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
6.26k stars 1.68k forks source link

Add option to generate `.desktop` files for Firefox profiles #5099

Open lordkekz opened 3 months ago

lordkekz commented 3 months ago

Goal

I'm using multiple Firefox profiles and want to easily start them from my application launcher. This is possible by creating separate .desktop files which launch a specific Firefox profile. I believe such an option would be useful, because it is likely that you'd want such an entry and it takes away the need for users to define all the options of the desktop entry.

Suggestion

I suggest extending the firefox.nix module to allow for configuration on a per-profile basis, like so:

programs.firefox.profiles."myprofile" = {
  id = 1;
  isDefault = false;
  desktopEntry = {
    enable = true;
    icon = "${./my-custom-icon.png}";
  };
};

which would generate a desktop entry using the xdg-desktop-entries.nix module:

xdg.desktopEntries."firefox-profile-myprofile" = ...

Open Questions

Implementation

I have already implemented this option in my personal dotfiles (option declaration, config definition, usage) and could send a PR with appropriate changes if you want. This is my first time writing any Nix modules/options, so it might not be the most optimal way to do it, but it works :)

Module Maintainers @rycee @kira-bruneau

stale[bot] commented 2 weeks ago

Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.

If you are the original author of the issue

* If this is resolved, please consider closing it so that the maintainers know not to focus on this. * If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

If you are not the original author of the issue

* If you are also experiencing this issue, please add details of your situation to help with the debugging process. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

Memorandum on closing issues

Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.