feat(crumb): Configure Firefox

- Set search engines.
- Install extensions
- Set basic Firefox settings.
- Bump home-manager to use updated `programs.firefox` API.  Namely,
  `programs.firefox.profiles.NAME.extensions`.
This commit is contained in:
Madeleine Sydney
2025-03-04 03:10:59 -07:00
parent 3603bea1c7
commit 04a23ded90
3 changed files with 199 additions and 7 deletions

79
flake.lock generated
View File

@@ -80,6 +80,27 @@
} }
}, },
"flake-parts": { "flake-parts": {
"inputs": {
"nixpkgs-lib": [
"nur",
"nixpkgs"
]
},
"locked": {
"lastModified": 1733312601,
"narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_2": {
"inputs": { "inputs": {
"nixpkgs-lib": "nixpkgs-lib" "nixpkgs-lib": "nixpkgs-lib"
}, },
@@ -135,11 +156,11 @@
"nixpkgs": "nixpkgs_3" "nixpkgs": "nixpkgs_3"
}, },
"locked": { "locked": {
"lastModified": 1736441698, "lastModified": 1741376022,
"narHash": "sha256-0CpZ8xp6C9/k3KVul1xhsVOnPyYZ3OWp/6sA8WGOWM4=", "narHash": "sha256-EPMhteiZurPFiVs1ioBtiUgUMih52w3IwOWLV0hoX1w=",
"owner": "msyds", "owner": "msyds",
"repo": "home-manager", "repo": "home-manager",
"rev": "71be4c32c349f3ea85cdfbe0f21c44357644fc91", "rev": "7b87c2d8b9ad72e83402f8fc6dde24e76b28ee67",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -222,7 +243,7 @@
}, },
"nix-fetcher-data": { "nix-fetcher-data": {
"inputs": { "inputs": {
"flake-parts": "flake-parts", "flake-parts": "flake-parts_2",
"nixpkgs": [ "nixpkgs": [
"sydnix-cli", "sydnix-cli",
"clj-nix", "clj-nix",
@@ -304,11 +325,11 @@
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1736012469, "lastModified": 1741010256,
"narHash": "sha256-/qlNWm/IEVVH7GfgAIyP6EsVZI6zjAx1cV5zNyrs+rI=", "narHash": "sha256-WZNlK/KX7Sni0RyqLSqLPbK8k08Kq7H7RijPJbq9KHM=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "8f3e1f807051e32d8c95cd12b9b421623850a34d", "rev": "ba487dbc9d04e0634c64e3b1f0d25839a0a68246",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -398,6 +419,28 @@
"type": "github" "type": "github"
} }
}, },
"nur": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": [
"nixpkgs"
],
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1741373419,
"narHash": "sha256-RkLmZob4GnlKntjO26io6wf6haE24pcTr3jAljMJ45c=",
"owner": "nix-community",
"repo": "NUR",
"rev": "4463e6382eca077dbd3c74ae336aef516221b4fc",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "NUR",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"copyparty": "copyparty", "copyparty": "copyparty",
@@ -406,6 +449,7 @@
"impermanence": "impermanence", "impermanence": "impermanence",
"niri": "niri", "niri": "niri",
"nixpkgs": "nixpkgs_5", "nixpkgs": "nixpkgs_5",
"nur": "nur",
"sops-nix": "sops-nix", "sops-nix": "sops-nix",
"sydnix-cli": "sydnix-cli" "sydnix-cli": "sydnix-cli"
} }
@@ -460,6 +504,27 @@
"type": "github" "type": "github"
} }
}, },
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"nur",
"nixpkgs"
]
},
"locked": {
"lastModified": 1733222881,
"narHash": "sha256-JIPcz1PrpXUCbaccEnrcUS8jjEb/1vJbZz5KkobyFdM=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "49717b5af6f80172275d47a418c9719a31a78b53",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
},
"xwayland-satellite-stable": { "xwayland-satellite-stable": {
"flake": false, "flake": false,
"locked": { "locked": {

View File

@@ -12,6 +12,11 @@
sops-nix.url = "github:Mic92/sops-nix"; sops-nix.url = "github:Mic92/sops-nix";
sydnix-cli.url = "path:///persist/dots/scripts/sydnix-cli"; sydnix-cli.url = "path:///persist/dots/scripts/sydnix-cli";
copyparty.url = "github:9001/copyparty"; copyparty.url = "github:9001/copyparty";
# Used for Firefox extensions/addons.
nur = {
url = "github:nix-community/NUR";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = { nixpkgs, ... }@inputs: outputs = { nixpkgs, ... }@inputs:

View File

@@ -0,0 +1,122 @@
{ config, lib, pkgs, inputs, ... }@args:
let
pkgs' = import inputs.nixpkgs {
system = args.system;
overlays = [ inputs.nur.overlays.default ];
};
in {
programs.firefox = {
enable = true;
# Available language codes can be found on the releases page:
# https://releases.mozilla.org/pub/firefox/releases/134.0.2/linux-x86_64/xpi/.
# The string `134.0.2` may be substituted for any other Firefox release
# number.
languagePacks = [
"en-US"
"en-GB"
];
# Available options can be found at https://mozilla.github.io/policy-templates/.
policies = {
DisableTelemetry = true;
DisableFirefoxStudies = false;
EnableTrackingProtection = {
Value = true;
Locked = true;
Cryptomining = true;
Fingerprinting = true;
};
# Weird advertiser shit.
FirefoxSuggest = {
WebSuggestions = false;
SponsoredSuggestions = false;
ImproveSuggest = false;
Locked = false;
};
# Weird advertiser shit.
DisablePocket = true;
DisableFirefoxAccounts = true;
DisableAccounts = true;
# Firefox has an in-built screenshot tool that I do not need.
DisableFirefoxScreenshots = true;
# Disable pop-up windows that appear after installation and updates.
OverrideFirstRunPage = "";
OverridePostUpdatePage = "";
# You think you're so important, don't you, Firefox?
DontCheckDefaultBrowser = true;
# Only tabs not yet visiting a page. Alternatives: `always`, `never`,
# `newtab`.
DisplayBookmarksToolbar = "newtab";
# Alternatives: `always`, `never`, `default-on`, `default-on`.
DisplayMenuBar = "default-off";
# Alternative: `unified`, `separate`.
SearchBar = "unified";
};
profiles."msyds" = {
bookmarks = [];
# Check about:support for extension/add-on ID strings.
extensions = {
# Override non-declared settings.
force = true;
packages = with pkgs'.nur.repos.rycee.firefox-addons; [
ublock-origin
darkreader
privacy-badger
vimium
kagi-search
duckduckgo-privacy-essentials
edit-with-emacs
copy-as-org-mode
clearurls
];
};
search = {
# Override non-declared settings.
force = true;
# Precedence of search engines.
order = [ "Kagi" "DuckDuckGo" ];
default = "Kagi";
privateDefault = "DuckDuckGo";
engines = {
"Nixpkgs" = {
urls = [{
template = "https://search.nixos.org/packages";
params = [
{ name = "type"; value = "packages"; }
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon =
"${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "!np" ];
};
};
};
# See `about:config` in Firefox for available settings.
settings = {
# Disable suggestions.
"browser.search.suggest.enabled" = false;
# Enable dark theme for non-website UI; the URL bar and such.
"extensions.activeThemeID" = "firefox-compact-dark@mozilla.org";
"browser.theme.content-theme" = 0;
"browser.theme.toolbar-theme" = 0;
# Disable sponsored suggestions.
"browser.newtabpage.activity-stream.showSponsoredTopSites" = false;
"browser.newtabpage.activity-stream.system.showSponsored" = false;
"browser.newtabpage.activity-stream.showSponsored" = false;
"browser.urlbar.sponsoredTopSites" = false;
"services.sync.prefs.sync.browser.newtabpage.activity-stream.showSponsored"
= false;
"services.sync.prefs.sync.browser.newtabpage.activity-stream.showSponsoredTopSites"
= false;
};
};
};
}