Add uBlock Origin to Firefox

This commit is contained in:
Joshua Yuen 2026-06-19 19:36:29 -04:00
parent ce29145fa1
commit db2b9c3da9
Signed by: josh
GPG Key ID: 502720BC22ED411C
4 changed files with 46 additions and 4 deletions

View File

@ -9,10 +9,6 @@ let
pipewireCfg = config.modules.pipewire; pipewireCfg = config.modules.pipewire;
in in
{ {
programs = {
firefox.enable = true;
};
# Add wayland screensharing support if PipeWire is enabled # Add wayland screensharing support if PipeWire is enabled
environment.systemPackages = environment.systemPackages =
with pkgs; with pkgs;

View File

@ -4,6 +4,7 @@
{ {
imports = [ imports = [
./direnv.nix ./direnv.nix
./firefox.nix
./fzf.nix ./fzf.nix
./hyprland ./hyprland
./kitty.nix ./kitty.nix

38
modules/homes/firefox.nix Normal file
View File

@ -0,0 +1,38 @@
{
pkgs,
username,
...
}:
{
programs.firefox = {
enable = true;
package = pkgs.firefox;
policies = {
# Updates & Background Services
AppAutoUpdate = false;
BackgroundAppUpdate = false;
# Extensions
ExtensionSettings = let
moz = short: "https://addons.mozilla.org/firefox/downloads/latest/${short}/latest.xpi";
in {
"*".installation_mode = "blocked";
"uBlock0@raymondhill.net" = {
install_url = moz "ublock-origin";
installation_mode = "force_installed";
updates_disabled = true;
};
};
profiles = {
${username} = {
id = 0;
isDefault = true;
name = "${username}";
};
};
};
};
}

View File

@ -1,5 +1,6 @@
{ {
pkgs, pkgs,
username,
... ...
}: }:
{ {
@ -39,5 +40,11 @@
name = "Bibata-Modern-Classic"; name = "Bibata-Modern-Classic";
size = 24; size = 24;
}; };
targets = {
firefox = {
profileNames = [ "${username}" ];
};
};
}; };
} }