nix-community / home-manager

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

Allow final browser package to be accessible over config. #4723

Open Animeshz opened 7 months ago

Animeshz commented 7 months ago

Description

The final browser package by https://github.com/nix-community/home-manager/blob/master/modules/programs/chromium.nix internally creates a override and does not provide any way to access or refer to that derivation.

https://github.com/nix-community/home-manager/blob/4a8545f5e737a6338814a4676dc8e18c7f43fc57/modules/programs/chromium.nix#L181-L186

Such that these example config's create two copies of browser on the system,

{
  home.sessionVariables = {
    BROWSER = "${config.programs.brave.package}/bin/brave";            # for xdg-open
  };
  # Or maybe set a keybind with absolute path
}

Can we expose the final package by creating an internal field in the chromium submodule that is set first and then reused later in its own module as well as expose it to all other modules for consumption at the same time?

I'm talking about something like in emacs module:

https://github.com/nix-community/home-manager/blob/4a8545f5e737a6338814a4676dc8e18c7f43fc57/modules/programs/emacs.nix#L90

Animeshz commented 7 months ago

If emacs final package exposure seems correct, I can send a quick PR, let me know!

stale[bot] commented 4 months 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.

Animeshz commented 4 months ago

@rycee soft ping!

teto commented 4 months ago

I think that's fair go ahead.

stale[bot] commented 1 month 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.