Skip to content

Commit

Permalink
firefox: load betterfox settings
Browse files Browse the repository at this point in the history
  • Loading branch information
xddxdd committed Dec 10, 2024
1 parent 9b04b0b commit f0c630b
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 2 deletions.
21 changes: 21 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
inputs.home-manager.follows = "home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
betterfox-nix = {
url = "github:HeitorAugustoLN/betterfox-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
cities-json = {
url = "github:lutangar/cities.json";
flake = false;
Expand Down
43 changes: 41 additions & 2 deletions nixos/client-apps/firefox.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{ pkgs, lib, ... }:
{
pkgs,
lib,
inputs,
...
}:
let
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
bitwarden
Expand Down Expand Up @@ -32,6 +37,40 @@ let
wappalyzer
wayback-machine
];

loadBetterfox =
path:
let
autogen = lib.importJSON (inputs.betterfox-nix + "/autogen/firefox/main.json");
settings = lib.attrByPath (lib.splitString "." "${path}.settings") null autogen;
in
builtins.listToAttrs (builtins.filter (v: v.enabled) settings);

betterfoxConfig = builtins.foldl' (a: b: a // loadBetterfox b) { } [
"fastfox.general"
"fastfox.gfx"
"fastfox.disk-cache"
"fastfox.media-cache"
"fastfox.image-cache"
"fastfox.network"
"fastfox.speculative-loading"
"fastfox.experimental"
"securefox.ocsp-and-certs-with-hpkp"
"securefox.ssl-with-tls"
"securefox.disk-avoidance"
"securefox.https-first-policy"
"securefox.mixed-content-plus-cross-site"
"securefox.headers-with-referers"
"securefox.safe-browsing"
"securefox.telemetry"
"securefox.experiments"
"securefox.crash-reports"
"peskyfox.mozilla-ui"
"peskyfox.url-bar"
"peskyfox.new-tab-page"
"peskyfox.pocket"
"peskyfox.downloads"
];
in
{
environment.systemPackages = [
Expand Down Expand Up @@ -140,7 +179,7 @@ in
) extensions
);
};
preferences = {
preferences = betterfoxConfig // {
"browser.aboutConfig.showWarning" = false;
"gfx.webrender.all" = true;
"gfx.webrender.compositor.force-enabled" = true;
Expand Down

0 comments on commit f0c630b

Please sign in to comment.