nixos-config/users/simon/modules/librewolf.nix

36 lines
1.2 KiB
Nix
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# SPDX-FileCopyrightText: 2023 Simon Bruder <simon@sbruder.de>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
{ config, lib, nixosConfig, ... }:
let
mkOverridesFile = prefs: ''
// Generated by Home Manager.
// Function taken from upstream home-manger,
// modified to use pref instead of defaultPref.
${lib.concatStrings (lib.mapAttrsToList (name: value: ''
pref("${name}", ${builtins.toJSON value});
'') prefs)}
'';
in
lib.mkIf nixosConfig.sbruder.gui.enable {
programs.librewolf = {
enable = true;
settings = {
"accessibility.force_disabled" = 1;
"browser.uidensity" = 1; # more compact layout
"identity.fxaccounts.enabled" = true;
"middlemouse.paste" = false;
"privacy.clearOnShutdown.history" = false;
"webgl.disabled" = false; # requires installing CanvasBlocker
#"network.http.referer.XOriginPolicy" = 2; # breaks sites that include images from restrictive sources
#"privacy.resistFingerprinting.letterboxing" = true; # quite annoying
};
};
# overrides home-managers definition
home.file.".librewolf/librewolf.overrides.cfg".text = lib.mkForce (mkOverridesFile config.programs.librewolf.settings);
}