nix-community / home-manager

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

Add librewolf support to the firefox config module #2803

Closed TilCreator closed 1 month ago

TilCreator commented 2 years ago

I want to use Librewolf instead of Firefox, mostly because Mozilla is doing more and more "evil" things. I tried to just set programs.firefox.package to pkgs.librewolf(and create new profiles). But this fails with something in the firefox wrapper:

error: attribute 'gtk3' missing

       at /nix/store/21d58mybzbw2h1piiyr95yfh1k2s3ajh-nixos/nixos/pkgs/applications/networking/browsers/firefox/wrapper.nix:179:23:

          178|       nativeBuildInputs = [ makeWrapper lndir replace jq ];
          179|       buildInputs = [ browser.gtk3 ];
             |                       ^
          180|

I don't know exactly how the Firefox and Librewolf package differ, but I would guess that just a further check in https://github.com/nix-community/home-manager/blob/master/modules/programs/firefox.nix#L337-L354 for Librewolf would be enough to make this work?

SuperSandro2000 commented 2 years ago

librewolf is missing this part https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/browsers/firefox/common.nix#L363-L374

TilCreator commented 2 years ago

I don't quite get it, isn't Librewolf build with that Nix file?

TilCreator commented 2 years ago

I think it would also be better to have an extra module for Librewolf, like with I3 and sway. So that one can have Librewolf profiles in ~/.librewolf and Firefox profiles in ~/.mozilla/firefox. What do you think?

SuperSandro2000 commented 2 years ago

I don't quite get it, isn't Librewolf build with that Nix file?

No, it uses this one https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/browsers/firefox/librewolf/default.nix

What do you think?

I don't know, I am not using it.

TilCreator commented 2 years ago

No, it uses this one https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/browsers/firefox/librewolf/default.nix

But that file is only used as source in https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/browsers/firefox/packages.nix#L62 that is then used in https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/browsers/firefox/common.nix Please correct me if I'm wrong, I'm sure you have more experience and there has to be a reason why it doesn't work after all.

I don't know, I am not using it.

sry, that was meant for everyone stumbling onto this issue ^^

toastal commented 2 years ago

I was actually hoping to switch over as well feeling jaded with Mozilla.

Having a separate area for your "profile" would be nice for migrating as you can open the two browsers to check that everything looks and feels about the same before removing the old profile.

The higher-ground approach though would be $XDG_CONFIG_HOME/librewolf.

iv-nn commented 2 years ago

I had the same issue, in fact even the following config triggered the error:

programs.firefox = {
  enable = true;
  package = pkgs.firefox;
}

As it turns out this was because my home.stateVersion was unset, setting it fixed the issue and I can now use either firefox or librewolf.

@toastal Lirewolf does use $HOME/.librewolf for it's configuration, including profiles. I don't know if there is a way to make it use $XDG_CONFIG_HOME. But extensions managed by home-manager are still installed in $HOME/.mozilla, I've not yet looked at how to fix this.

toastal commented 2 years ago

Their bug tracker said they'd switch to $XDG_CONFIG_HOME after a patch got merged upstream.

onny commented 2 years ago

I created a module to configure the overrides ( https://librewolf.net/docs/settings/ ) file at least https://github.com/nix-community/home-manager/pull/2976 This is something which only applies to Librewolf and I guess it would be okay to have a separate module for it.

onny commented 2 years ago

Looking for reviewers :)

TilCreator commented 2 years ago

Not exactly what I was looking for in this PR (mostly because I hardcode my LibreWolf settings in the users.js), but still appreciated ^^

stale[bot] commented 2 years 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.

TilCreator commented 1 year ago

(Sry for just answering now) I still consider this issue active, as Librewolf can still not be used as an drop in replacement for Firefox in Home Manager. My favorite solution would be to have all the options of the Firefox package on the Librewolf package as well, but have them generate the profiles to ~/librewolf. Alternatively it would be nice to have an option in program.firefox that allows one to set the profiles directory, since Librewolf always just searches in ~/librewolf instead of ~/.mozilla/firefox.

TilCreator commented 1 year ago

I just noticed that is option is available in the master branch, so I guess I request a back port of program.firefox?

Also thx for maintaining this awesome project, I have the feeling my previous message was a bit harsh and is probably not entirely true as I now found out.

TilCreator commented 1 year ago

I messed up again, not my day, I thought the profilesPath in program.firefox is a config option, but it's not. Would be nice if it was easily changeable though.

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