dotfiles/user-modules/browser/firefox/default.nix

88 lines
2.2 KiB
Nix
Raw Normal View History

2024-07-19 12:00:55 +00:00
{
config,
lib,
pkgs,
...
}:
2024-07-18 04:08:27 +00:00
2024-07-19 19:54:41 +00:00
with lib;
2024-07-18 04:08:27 +00:00
let
cfg = config.modules.firefox;
2024-07-19 12:00:55 +00:00
in
{
2024-07-20 04:10:56 +00:00
options.modules.firefox = {
enable = lib.mkEnableOption "firefox";
default = lib.mkEnableOption "default";
};
2024-07-18 04:08:27 +00:00
config = lib.mkIf cfg.enable {
2024-07-20 04:10:56 +00:00
default.browser = mkIf cfg.default "firefox.desktop";
2024-07-18 04:08:27 +00:00
# Enable NUR
nixpkgs.config.packageOverrides = pkgs: {
# TODO: Pin the version
2024-12-01 23:49:55 +00:00
nur = import (builtins.fetchTarball {
2024-12-02 10:18:22 +00:00
url = "https://github.com/nix-community/NUR/archive/f6b1d11161a18420ae699f3202f6cf113f509e8a.tar.gz";
sha256 = "1yj78q8dgvx94mdhd9dy9p7iwxmfl6rx8h0sypfp2x5wzb1sr2g6";
2024-12-01 23:49:55 +00:00
}) { inherit pkgs; };
2024-07-18 04:08:27 +00:00
};
programs.firefox = {
enable = true;
policies = {
AppAutoUpdate = false;
2024-07-19 19:54:41 +00:00
# BlockAboutAddons = true;
# BlockAboutConfig = true;
# BlockAboutProfiles = true;
2024-07-18 04:08:27 +00:00
DisableAppUpdate = true;
DisableFeedbackCommands = true;
DisableMasterPasswordCreation = true;
DisablePocket = true;
DisableProfileImport = true;
DisableProfileRefresh = true;
DisableSetDesktopBackground = true;
DisableTelemetry = true;
DisplayBookmarksToolbar = "never";
DisplayMenuBar = "never";
2024-07-19 12:00:55 +00:00
DNSOverHTTPS = {
Enabled = false;
};
2024-07-18 04:08:27 +00:00
DontCheckDefaultBrowser = true;
PasswordManagerEnabled = false;
TranslateEnabled = true;
UseSystemPrintDialog = true;
};
2024-07-19 12:00:55 +00:00
2024-07-18 04:08:27 +00:00
profiles.nixos = {
search.default = "DuckDuckGo";
2024-07-19 19:54:41 +00:00
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
# firefox-color
ublock-origin
];
# Theming
userChrome = readFile (
pkgs.substituteAll {
src = ./userChrome.css;
colors = config.theming.colorsCSS;
}
);
2024-07-18 04:08:27 +00:00
settings = {
"browser.tabs.inTitlebar" = 0;
"extensions.autoDisableScopes" = 0;
2024-07-19 19:54:41 +00:00
"devtools.chrome.enabled" = true;
"devtools.debugger.remote-enabled" = true;
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
2024-07-18 04:08:27 +00:00
};
# Force overwriting configuration file
search.force = true;
containersForce = true;
};
};
};
2024-07-19 12:00:55 +00:00
}