feat(firefox): Use betterfox

This commit is contained in:
js0ny 2025-11-15 02:39:56 +00:00
parent f80d83bbd7
commit 28797f148f
12 changed files with 273 additions and 118 deletions

133
nixcfgs/flake.lock generated
View file

@ -37,6 +37,27 @@
"type": "github" "type": "github"
} }
}, },
"betterfox-nix": {
"inputs": {
"flake-parts": "flake-parts",
"import-tree": "import-tree",
"nixpkgs": "nixpkgs",
"systems": "systems"
},
"locked": {
"lastModified": 1762735459,
"narHash": "sha256-VZRCyMRSLFORBzH+pYzDSx/ooIBD5Ohrv28sWktSiqk=",
"owner": "HeitorAugustoLN",
"repo": "betterfox-nix",
"rev": "37ac3490a7e2825985ce5c0004489b2264ea1cd0",
"type": "github"
},
"original": {
"owner": "HeitorAugustoLN",
"repo": "betterfox-nix",
"type": "github"
}
},
"caelestia-cli": { "caelestia-cli": {
"inputs": { "inputs": {
"caelestia-shell": [ "caelestia-shell": [
@ -100,7 +121,7 @@
}, },
"devshell": { "devshell": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_4" "nixpkgs": "nixpkgs_5"
}, },
"locked": { "locked": {
"lastModified": 1741473158, "lastModified": 1741473158,
@ -133,6 +154,27 @@
} }
}, },
"flake-parts": { "flake-parts": {
"inputs": {
"nixpkgs-lib": [
"betterfox-nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1762440070,
"narHash": "sha256-xxdepIcb39UJ94+YydGP221rjnpkDZUlykKuF54PsqI=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "26d05891e14c88eb4a5d5bee659c0db5afb609d8",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_2": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
"nur", "nur",
@ -153,7 +195,7 @@
"type": "github" "type": "github"
} }
}, },
"flake-parts_2": { "flake-parts_3": {
"inputs": { "inputs": {
"nixpkgs-lib": "nixpkgs-lib" "nixpkgs-lib": "nixpkgs-lib"
}, },
@ -216,7 +258,7 @@
}, },
"home-manager_2": { "home-manager_2": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_5" "nixpkgs": "nixpkgs_6"
}, },
"locked": { "locked": {
"lastModified": 1756842514, "lastModified": 1756842514,
@ -306,9 +348,9 @@
"hyprlang": "hyprlang", "hyprlang": "hyprlang",
"hyprutils": "hyprutils", "hyprutils": "hyprutils",
"hyprwayland-scanner": "hyprwayland-scanner", "hyprwayland-scanner": "hyprwayland-scanner",
"nixpkgs": "nixpkgs_6", "nixpkgs": "nixpkgs_7",
"pre-commit-hooks": "pre-commit-hooks", "pre-commit-hooks": "pre-commit-hooks",
"systems": "systems", "systems": "systems_2",
"xdph": "xdph" "xdph": "xdph"
}, },
"locked": { "locked": {
@ -513,11 +555,26 @@
"type": "github" "type": "github"
} }
}, },
"import-tree": {
"locked": {
"lastModified": 1762327901,
"narHash": "sha256-AJ96FNj50DU0bTyIzAPkPOjCZTHqjURVjok8qoXvmqM=",
"owner": "vic",
"repo": "import-tree",
"rev": "90fa129798be99cde036b78658e89475710966a1",
"type": "github"
},
"original": {
"owner": "vic",
"repo": "import-tree",
"type": "github"
}
},
"niri-flake": { "niri-flake": {
"inputs": { "inputs": {
"niri-stable": "niri-stable", "niri-stable": "niri-stable",
"niri-unstable": "niri-unstable", "niri-unstable": "niri-unstable",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs_2",
"nixpkgs-stable": "nixpkgs-stable", "nixpkgs-stable": "nixpkgs-stable",
"xwayland-satellite-stable": "xwayland-satellite-stable", "xwayland-satellite-stable": "xwayland-satellite-stable",
"xwayland-satellite-unstable": "xwayland-satellite-unstable" "xwayland-satellite-unstable": "xwayland-satellite-unstable"
@ -607,16 +664,16 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1762844143, "lastModified": 1762482733,
"narHash": "sha256-SlybxLZ1/e4T2lb1czEtWVzDCVSTvk9WLwGhmxFmBxI=", "narHash": "sha256-g/da4FzvckvbiZT075Sb1/YDNDr+tGQgh4N8i5ceYMg=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "9da7f1cf7f8a6e2a7cb3001b048546c92a8258b4", "rev": "e1ebeec86b771e9d387dd02d82ffdc77ac753abc",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "nixos-unstable", "ref": "nixpkgs-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
@ -669,6 +726,22 @@
} }
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": {
"lastModified": 1762844143,
"narHash": "sha256-SlybxLZ1/e4T2lb1czEtWVzDCVSTvk9WLwGhmxFmBxI=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9da7f1cf7f8a6e2a7cb3001b048546c92a8258b4",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1762604901, "lastModified": 1762604901,
"narHash": "sha256-Pr2jpryIaQr9Yx8p6QssS03wqB6UifnnLr3HJw9veDw=", "narHash": "sha256-Pr2jpryIaQr9Yx8p6QssS03wqB6UifnnLr3HJw9veDw=",
@ -684,7 +757,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_3": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1762844143, "lastModified": 1762844143,
"narHash": "sha256-SlybxLZ1/e4T2lb1czEtWVzDCVSTvk9WLwGhmxFmBxI=", "narHash": "sha256-SlybxLZ1/e4T2lb1czEtWVzDCVSTvk9WLwGhmxFmBxI=",
@ -700,7 +773,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_4": { "nixpkgs_5": {
"locked": { "locked": {
"lastModified": 1722073938, "lastModified": 1722073938,
"narHash": "sha256-OpX0StkL8vpXyWOGUD6G+MA26wAXK6SpT94kLJXo6B4=", "narHash": "sha256-OpX0StkL8vpXyWOGUD6G+MA26wAXK6SpT94kLJXo6B4=",
@ -716,7 +789,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_5": { "nixpkgs_6": {
"locked": { "locked": {
"lastModified": 1756542300, "lastModified": 1756542300,
"narHash": "sha256-tlOn88coG5fzdyqz6R93SQL5Gpq+m/DsWpekNFhqPQk=", "narHash": "sha256-tlOn88coG5fzdyqz6R93SQL5Gpq+m/DsWpekNFhqPQk=",
@ -732,7 +805,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_6": { "nixpkgs_7": {
"locked": { "locked": {
"lastModified": 1751792365, "lastModified": 1751792365,
"narHash": "sha256-J1kI6oAj25IG4EdVlg2hQz8NZTBNYvIS0l4wpr9KcUo=", "narHash": "sha256-J1kI6oAj25IG4EdVlg2hQz8NZTBNYvIS0l4wpr9KcUo=",
@ -748,7 +821,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_7": { "nixpkgs_8": {
"locked": { "locked": {
"lastModified": 1756819007, "lastModified": 1756819007,
"narHash": "sha256-12V64nKG/O/guxSYnr5/nq1EfqwJCdD2+cIGmhz3nrE=", "narHash": "sha256-12V64nKG/O/guxSYnr5/nq1EfqwJCdD2+cIGmhz3nrE=",
@ -764,7 +837,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_8": { "nixpkgs_9": {
"locked": { "locked": {
"lastModified": 1747958103, "lastModified": 1747958103,
"narHash": "sha256-qmmFCrfBwSHoWw7cVK4Aj+fns+c54EBP8cGqp/yK410=", "narHash": "sha256-qmmFCrfBwSHoWw7cVK4Aj+fns+c54EBP8cGqp/yK410=",
@ -782,8 +855,8 @@
}, },
"nur": { "nur": {
"inputs": { "inputs": {
"flake-parts": "flake-parts", "flake-parts": "flake-parts_2",
"nixpkgs": "nixpkgs_3" "nixpkgs": "nixpkgs_4"
}, },
"locked": { "locked": {
"lastModified": 1762951833, "lastModified": 1762951833,
@ -869,12 +942,13 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"betterfox-nix": "betterfox-nix",
"caelestia-shell": "caelestia-shell", "caelestia-shell": "caelestia-shell",
"home-manager": "home-manager", "home-manager": "home-manager",
"niri-flake": "niri-flake", "niri-flake": "niri-flake",
"nix-darwin": "nix-darwin", "nix-darwin": "nix-darwin",
"nix-flatpak": "nix-flatpak", "nix-flatpak": "nix-flatpak",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_3",
"nixpkgs-stable": "nixpkgs-stable_2", "nixpkgs-stable": "nixpkgs-stable_2",
"nur": "nur", "nur": "nur",
"plasma-manager": "plasma-manager", "plasma-manager": "plasma-manager",
@ -903,6 +977,21 @@
} }
}, },
"systems": { "systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": { "locked": {
"lastModified": 1689347949, "lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
@ -919,7 +1008,7 @@
}, },
"treefmt-nix": { "treefmt-nix": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_8" "nixpkgs": "nixpkgs_9"
}, },
"locked": { "locked": {
"lastModified": 1750931469, "lastModified": 1750931469,
@ -1003,10 +1092,10 @@
"inputs": { "inputs": {
"crane": "crane", "crane": "crane",
"devshell": "devshell", "devshell": "devshell",
"flake-parts": "flake-parts_2", "flake-parts": "flake-parts_3",
"home-manager": "home-manager_2", "home-manager": "home-manager_2",
"hyprland": "hyprland", "hyprland": "hyprland",
"nixpkgs": "nixpkgs_7", "nixpkgs": "nixpkgs_8",
"treefmt-nix": "treefmt-nix", "treefmt-nix": "treefmt-nix",
"xremap": "xremap" "xremap": "xremap"
}, },

View file

@ -35,6 +35,8 @@
niri-flake.url = "github:sodiboo/niri-flake"; niri-flake.url = "github:sodiboo/niri-flake";
# xremap - kay remapper like keyd # xremap - kay remapper like keyd
xremap-flake.url = "github:xremap/nix-flake"; xremap-flake.url = "github:xremap/nix-flake";
# betterfox - preconfigured firefox user.js
betterfox-nix.url = "github:HeitorAugustoLN/betterfox-nix";
}; };
outputs = { outputs = {
@ -50,6 +52,7 @@
sops-nix, sops-nix,
niri-flake, niri-flake,
xremap-flake, xremap-flake,
betterfox-nix,
... ...
} @ inputs: let } @ inputs: let
overlays = [ overlays = [
@ -112,6 +115,7 @@
nix-flatpak.homeManagerModules.nix-flatpak nix-flatpak.homeManagerModules.nix-flatpak
sops-nix.homeManagerModules.sops sops-nix.homeManagerModules.sops
niri-flake.homeModules.niri niri-flake.homeModules.niri
betterfox-nix.modules.homeManager.betterfox
]; ];
}; };
"js0ny@nixvirt" = home-manager.lib.homeManagerConfiguration { "js0ny@nixvirt" = home-manager.lib.homeManagerConfiguration {

View file

@ -72,4 +72,13 @@
]; ];
}; };
}; };
# treat the virtual keyboard as internal
# https://github.com/xremap/xremap/discussions/656
environment.etc."libinput/local-overrides.quirks".text = ''
[xremap]
MatchName=xremap
MatchUdevType=keyboard
AttrKeyboardIntegration=internal
'';
} }

View file

@ -29,6 +29,7 @@
pcloud pcloud
telegram-desktop telegram-desktop
steam steam
signal-desktop
# Use Wayland for Jetbrains # Use Wayland for Jetbrains
(jetbrains.idea-ultimate.override { (jetbrains.idea-ultimate.override {
vmopts = ''-Dawt.toolkit.name=WLToolkit''; vmopts = ''-Dawt.toolkit.name=WLToolkit'';

View file

@ -31,7 +31,8 @@
touchpad = { touchpad = {
tap = true; tap = true;
natural-scroll = true; natural-scroll = true;
disabled-on-external-mouse = true; disabled-on-external-mouse = false;
dwt = true; # disable on typing
}; };
mouse = {}; mouse = {};

View file

@ -1,92 +0,0 @@
{pkgs, ...}: {
programs.firefox = {
enable = true;
profiles.default = {
search.engines = {
archwiki = {
name = "ArchWiki";
urls = [
{
template = "https://wiki.archlinux.org/index.php?search={searchTerms}";
}
];
icon = "https://archlinux.org/favicon.ico";
definedAliases = ["@aw"];
};
aur = {
name = "Arch User Repository";
urls = [
{
template = "https://aur.archlinux.org/?K={searchTerms}";
}
];
icon = "https://archlinux.org/favicon.ico";
definedAliases = ["@aur"];
};
arch-packages = {
name = "ArchLinux Packages";
urls = [{template = "https://archlinux.org/packages/?q={searchTerms}";}];
icon = "https://archlinux.org/favicon.ico";
definedAliases = ["@pac"];
};
chatgpt = {
name = "ChatGPT";
urls = [{template = "https://chatgpt.com/?q={searchTerms}";}];
icon = "https://chatgpt.com/favicon.ico";
definedAliases = ["@gpt"];
};
scoop = {
name = "scoop";
urls = [{template = "https://scoop.sh/#/apps?q={searchTerms}";}];
icon = "https://scoop.sh/favicon.ico";
definedAliases = ["@sc"];
};
perplexity = {
name = "Perplexity";
urls = [{template = "https://www.perplexity.ai/?q={searchTerms}";}];
icon = "https://perplexity.ai/favicon.ico";
definedAliases = ["@pplx"];
};
winget = {
name = "Windows Package Manager";
urls = [{template = "https://winget.ragerworks.com/search/all/{searchTerms}";}];
icon = "https://microsoft.com/favicon.ico";
definedAliases = ["@win"];
};
github = {
name = "GitHub Repository";
urls = [{template = "https://github.com/search?type=repositories&q={searchTerms}";}];
icon = "https://github.com/favicon.ico";
definedAliases = ["@gh"];
};
repology = {
name = "Repology";
urls = [{template = "https://repology.org/projects/?search={searchTerms}";}];
icon = "https://repology.org/favicon.ico";
definedAliases = ["@repo"];
};
};
extensions.packages = with pkgs.nur.repos.rycee.firefox-addons; [
darkreader
rsshub-radar
proton-pass
surfingkeys
web-archives
# immersive-translate
tampermonkey
stylus
foxy-gestures
google-container
refined-github
downthemall
material-icons-for-github
single-file
return-youtube-dislikes
steam-database
bilisponsorblock
sponsorblock
buster-captcha-solver
];
};
};
}

View file

@ -0,0 +1,31 @@
{pkgs, ...}: let
addons = pkgs.nur.repos.rycee.firefox-addons;
in {
# imports = [./lib.nix]; # TODO: Declarative extension permissions
programs.firefox.profiles.default = {
extensions.packages = with addons; [
ublock-origin
darkreader
rsshub-radar
proton-pass
proton-vpn
surfingkeys
web-archives
tampermonkey
stylus
foxy-gestures
google-container
refined-github
downthemall
material-icons-for-github
single-file
return-youtube-dislikes
steam-database
bilisponsorblock
sponsorblock
buster-captcha-solver
protondb-for-steam
i-dont-care-about-cookies
];
};
}

View file

@ -0,0 +1,10 @@
{...}: {
programs.firefox.betterfox = {
enable = true;
profiles.default.settings = {
fastfox.enable = true;
securefox.enable = true;
peskyfox.enable = true;
};
};
}

View file

@ -0,0 +1,20 @@
# Run nightly:
# nix run "github:nix-community/flake-firefox-nightly#firefox-nightly-bin"
{...}: {
imports = [
./addons.nix
./search.nix
./betterfox.nix
];
programs.firefox = {
enable = true;
profiles.default = {
settings = {
"extensions.update.enabled" = true;
"sidebar.expandOnHover" = true;
"sidebar.visibility" = "expand-on-hover";
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
};
};
};
}

View file

@ -0,0 +1,82 @@
{lib, ...}: {
# Overwrite search.json.mozlz4
home.file.".mozilla/firefox/default/search.json.mozlz4".force = lib.mkForce true;
programs.firefox.profiles.default.search.engines = {
alternativeto = {
name = "AlternativeTo";
urls = [
{template = "https://alternativeto.net/browse/search/?q={searchTerms}";}
];
icon = "https://alternativeto.net/favicon.ico";
definedAliases = ["@a2"];
};
archwiki = {
name = "ArchWiki";
urls = [
{
template = "https://wiki.archlinux.org/index.php?search={searchTerms}";
}
];
icon = "https://archlinux.org/favicon.ico";
definedAliases = ["@aw"];
};
aur = {
name = "Arch User Repository";
urls = [
{
template = "https://aur.archlinux.org/?K={searchTerms}";
}
];
icon = "https://archlinux.org/favicon.ico";
definedAliases = ["@aur"];
};
arch-packages = {
name = "ArchLinux Packages";
urls = [{template = "https://archlinux.org/packages/?q={searchTerms}";}];
icon = "https://archlinux.org/favicon.ico";
definedAliases = ["@pac"];
};
chatgpt = {
name = "ChatGPT";
urls = [{template = "https://chatgpt.com/?q={searchTerms}";}];
icon = "https://chatgpt.com/favicon.ico";
definedAliases = ["@gpt"];
};
scoop = {
name = "scoop";
urls = [{template = "https://scoop.sh/#/apps?q={searchTerms}";}];
icon = "https://scoop.sh/favicon.ico";
definedAliases = ["@sc"];
};
perplexity = {
name = "Perplexity";
urls = [{template = "https://www.perplexity.ai/?q={searchTerms}";}];
icon = "https://perplexity.ai/favicon.ico";
definedAliases = ["@pplx"];
};
pypi = {
name = "PyPi";
urls = [{template = "https://pypi.org/search/?q={searchTerms}";}];
icon = "https://pypi.org/favicon.ico";
definedAliases = ["@py"];
};
winget = {
name = "Windows Package Manager";
urls = [{template = "https://winget.ragerworks.com/search/all/{searchTerms}";}];
icon = "https://microsoft.com/favicon.ico";
definedAliases = ["@win"];
};
github = {
name = "GitHub Repository";
urls = [{template = "https://github.com/search?type=repositories&q={searchTerms}";}];
icon = "https://github.com/favicon.ico";
definedAliases = ["@gh"];
};
repology = {
name = "Repology";
urls = [{template = "https://repology.org/projects/?search={searchTerms}";}];
icon = "https://repology.org/favicon.ico";
definedAliases = ["@repo"];
};
};
}

View file

@ -50,8 +50,8 @@ in {
# setopt GLOB_DOTS # Include dotfiles in globbing # setopt GLOB_DOTS # Include dotfiles in globbing
# Error correction # Error correction
setopt CORRECT # Suggest corrections for commands # setopt CORRECT # Suggest corrections for commands
setopt CORRECT_ALL # Suggest corrections for arguments # setopt CORRECT_ALL # Suggest corrections for arguments
# edit command line # edit command line
autoload -Uz edit-command-line autoload -Uz edit-command-line

View file

@ -22,7 +22,7 @@
# Personal Program # Personal Program
./programs/chromium.nix ./programs/chromium.nix
./programs/firefox.nix ./programs/firefox
./programs/emacs.nix ./programs/emacs.nix
./programs/vscode.nix ./programs/vscode.nix
./programs/xilinx.nix ./programs/xilinx.nix