Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On the NixOS desktop install a default browser? #101729

Open
worldofpeace opened this issue Oct 26, 2020 · 6 comments
Open

On the NixOS desktop install a default browser? #101729

worldofpeace opened this issue Oct 26, 2020 · 6 comments
Labels
0.kind: enhancement 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: nixos

Comments

@worldofpeace
Copy link
Contributor

worldofpeace commented Oct 26, 2020

Describe the bug
Overall in the GNOME scheme of things we've polished things up to having a very basic suite of applications installed default (as per what's basically a distributor recommendation) and making things flexible with various options

  • services.gnome3.core-utilities.enable
  • services.gnome3.games.enable
  • environment.gnome3.excludePackages (this even applies to packages that are installed via enabling another option. it would be interesting if putting a package like evince into systemPackages would instead turn on a nixos option instead of just putting it into system path only, thusly avoiding mis-configuration if a nixos module needs to exist for a specific program)

and more details on how those choices have been fine tuned #67310 and iterated on recently in #101516 13b1927

But one thing inside all graphical ISO media that will remain incongruent to installed systems is... the web browser.

We have the graphical profile and installation-cd installing Firefox #47204 #20433, but if someone installs a DE like plasma5 or gnome3 that application will not be there. I think it's only correct if the ISO's are congruent to defaults for a deployed system (if possible). The issue here is... I don't really know the correct way to go about having a default browser installed for nixos.

An idea?

An interesting idea we had for dealing with automatically installing GUI's was for flatpak recently https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/desktops/flatpak.nix#L19. A DE can register what GUI would be appropriate by setting it within their module (so pantheon would have appcenter and plasma would have discover). This makes sense because... really flatpak is to install graphical applications, so having a GUI automatically provisioned is nice.

I felt borrowing from that we could have:

programs.defaultBrowser = mkOption {
  type = types.enum [ 
    "firefox"
    "chromium"
    "google-chrome"
    "other-browers"
  ];
  default = [ "firefox" ];
  ... 
  # this would obfuscate things in the case of chromium needing a nixos module switched on
};

programs.enableDefaultBrowser = mkOption {
  type = types.bool;
  default = config.isDesktop; 
  # this boolean is hypothetical because we have no switch in nixos to say "this is a desktop" 
  #  (maybe enabling any desktop manager can set it internally )
  # which could be really useful in the future for having better defaults for things like
  # better power management for workstations using tlp
  ...
};

(I'm not sold on these names and it's clearly different from the code I linked)

enableDefaultBrowser will simply provision firefox because that's the default selection. DE maintainers that find this choice not being correct in their environment can select a different one. And from there document in the release note that power users would probably like to disable enableDefaultBrowser if it's not congruent with their current browser of choice.

Future Work
Generally within NixOS having a switch to know what kind of system we're working with is going to be useful to enable things that are going to give users a better experience. This issue had a hypothetical config.isDesktop or it could be config.roles.desktop == true. I got really into this issue on a thread on discourse https://discourse.nixos.org/t/why-i-switched-to-manjaro-linux/5903, where it's well known that NixOS doesn't really cater well to general users. And it also makes developers that use NixOS as a daily driver have to spend a lot of time curating optimized config for their workstations. I'd really like to see that we can have the "best of both worlds" in nixpkgs without my having to invest in making a NixOS distro to make it better.

@worldofpeace
Copy link
Contributor Author

cc @jtojnar @hedning @matthewbauer

@jtojnar
Copy link
Member

jtojnar commented Oct 26, 2020

I think browser is more of a personal choice than something that comes with a DE (though some DEs ship their own browsers). Given that user needs to choose DE when creating their config, they can choose the browser as well (we already include Firefox in the generated configuration template). Additionally, there are really only two choices a “general” user would choose so having this kind of opinionated layer does not seem that useful to me.

The reason we did that for the stores was not to install relevant software, but to not install useless software, which would be installed by default on other distros with working PackageKit integration.

I agree that this kind of opinionated layers (TLP, USBGuard, SANE, CUPS, Bluetooth…) can be useful and we might want to enable them by default for desktops but balancing everything will be hard.

@worldofpeace
Copy link
Contributor Author

I agree that this kind of opinionated layers (TLP, USBGuard, SANE, CUPS, Bluetooth…) can be useful and we might want to enable them by default for desktops but balancing everything will be hard.

Right, like there could be roles as a feature, or we could have users set properties about their system in configuration.nix hardware.battery = true; -> "enables an optimized profile for basically laptop batteries" || an option to tell nixos to not optimize my system leave it to me.

I think browser is more of a personal choice than something that comes with a DE (though some DEs ship their own browsers). Given that user needs to choose DE when creating their config, they can choose the browser as well (we already include Firefox in the generated configuration template). Additionally, there are really only two choices a “general” user would choose so having this kind of opinionated layer does not seem that useful to me.

The reason we did that for the stores was not to install relevant software, but to not install useless software, which would be installed by default on other distros with working PackageKit integration.

I think the framing of this issue is a bit, well I think GNOME should ship a browser, and that being firefox. Pantheon also ships epiphany as a default browser (might back out on this since it doesn't work well in nixos). An interesting choice to harmonize in Plasma5 would be falkon https://www.falkon.org/. This at some point coalesces to having to introduce environment.$desktop.excludePackages everywhere or have some sort of option for a defaultBrowser.
Anyways, I get what you mean with just being a personal choice when it's just add thing into systemPackages, but I really don't think it would be too much code to have some semblance of a "blessed" program for NixOS. I do see some reasoning for doing that instead of "let's do it because... because yes" 😁

@justinlovinger
Copy link
Contributor

it would be interesting if putting a package like evince into systemPackages would instead turn on a nixos option instead of just putting it into system path only, thusly avoiding mis-configuration if a nixos module needs to exist for a specific program

Perhaps warn the user if a package in systemPackages has a corresponding programs. option.

@stale
Copy link

stale bot commented Apr 26, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Apr 26, 2021
@patka-123
Copy link
Contributor

Hello @worldofpeace 👋

Is this issue still relevant? If not, would you be able to close this issue?

(I'm going through issues marked as stale to see what can be resolved. If this is still an issue then don't mind me).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: enhancement 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: nixos
Projects
None yet
Development

No branches or pull requests

5 participants