browser: make more easily swappable between firefox and librewolf
This commit is contained in:
parent
5ff47b3719
commit
3ecfea158a
|
@ -25,7 +25,7 @@
|
|||
|
||||
# usability compromises
|
||||
sane.impermanence.home-dirs = [
|
||||
".librewolf"
|
||||
config.sane.web-browser.dotDir
|
||||
];
|
||||
|
||||
# sane.home-packages.enableGuiPkgs = false; # XXX faster builds/imaging for debugging
|
||||
|
|
|
@ -20,9 +20,9 @@ in
|
|||
imports = [
|
||||
./aerc.nix
|
||||
./discord.nix
|
||||
./firefox.nix
|
||||
./git.nix
|
||||
./kitty.nix
|
||||
./librewolf.nix
|
||||
./mpv.nix
|
||||
./nb.nix
|
||||
./neovim.nix
|
||||
|
@ -134,7 +134,7 @@ in
|
|||
# - `xdg-mime query filetype path/to/thing.ext`
|
||||
xdg.mimeApps.enable = true;
|
||||
xdg.mimeApps.defaultApplications = let
|
||||
www = "librewolf.desktop";
|
||||
www = sysconfig.sane.web-browser.desktop;
|
||||
pdf = "org.gnome.Evince.desktop";
|
||||
md = "obsidian.desktop";
|
||||
thumb = "org.gnome.gThumb.desktop";
|
||||
|
|
|
@ -7,27 +7,29 @@
|
|||
# see: https://gitlab.com/librewolf-community/settings/-/blob/master/distribution/policies.json
|
||||
|
||||
{ config, lib, pkgs, ...}:
|
||||
with lib;
|
||||
let
|
||||
# allow easy switching between firefox and librewolf with `active`, below
|
||||
cfg = config.sane.web-browser;
|
||||
# allow easy switching between firefox and librewolf with `defaultSettings`, below
|
||||
librewolfSettings = {
|
||||
browser = pkgs.librewolf-unwrapped;
|
||||
libName = "librewolf";
|
||||
dotDir = ".librewolf";
|
||||
desktop = "librewolf.desktop";
|
||||
};
|
||||
firefoxSettings = {
|
||||
browser = pkgs.firefox-esr-unwrapped;
|
||||
libName = "firefox";
|
||||
dotDir = ".mozilla/firefox";
|
||||
desktop = "firefox.desktop";
|
||||
};
|
||||
defaultSettings = firefoxSettings;
|
||||
|
||||
# active = librewolfSettings;
|
||||
active = firefoxSettings;
|
||||
|
||||
package = pkgs.wrapFirefox active.browser {
|
||||
package = pkgs.wrapFirefox cfg.browser {
|
||||
# inherit the default librewolf.cfg
|
||||
# it can be further customized via ~/.librewolf/librewolf.overrides.cfg
|
||||
inherit (pkgs.librewolf-unwrapped) extraPrefsFiles;
|
||||
inherit (active) libName;
|
||||
inherit (cfg) libName;
|
||||
|
||||
extraNativeMessagingHosts = [ pkgs.browserpass ];
|
||||
# extraNativeMessagingHosts = [ pkgs.gopass-native-messaging-host ];
|
||||
|
@ -90,6 +92,13 @@ let
|
|||
};
|
||||
in
|
||||
{
|
||||
options = {
|
||||
sane.web-browser = mkOption {
|
||||
default = defaultSettings;
|
||||
type = types.attrs;
|
||||
};
|
||||
};
|
||||
config = {
|
||||
# XXX: although home-manager calls this option `firefox`, we can use other browsers and it still mostly works.
|
||||
home-manager.users.colin = lib.mkIf (config.sane.gui.enable) {
|
||||
programs.firefox = {
|
||||
|
@ -105,7 +114,7 @@ in
|
|||
# the specific attribute path is found via scraping ublock code here:
|
||||
# - <https://github.com/gorhill/uBlock/blob/master/src/js/storage.js>
|
||||
# - <https://github.com/gorhill/uBlock/blob/master/assets/assets.json>
|
||||
home.file."${active.dotDir}/managed-storage/uBlock0@raymondhill.net.json".text = ''
|
||||
home.file."${cfg.dotDir}/managed-storage/uBlock0@raymondhill.net.json".text = ''
|
||||
{
|
||||
"name": "uBlock0@raymondhill.net",
|
||||
"description": "ignored",
|
||||
|
@ -115,11 +124,12 @@ in
|
|||
}
|
||||
}
|
||||
'';
|
||||
home.file."${active.dotDir}/${active.libName}.overrides.cfg".text = ''
|
||||
home.file."${cfg.dotDir}/${cfg.libName}.overrides.cfg".text = ''
|
||||
// if we can't query the revocation status of a SSL cert because the issuer is offline,
|
||||
// treat it as unrevoked.
|
||||
// see: <https://librewolf.net/docs/faq/#im-getting-sec_error_ocsp_server_error-what-can-i-do>
|
||||
defaultPref("security.OCSP.require", false);
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user