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

View file

@ -35,6 +35,8 @@
niri-flake.url = "github:sodiboo/niri-flake";
# xremap - kay remapper like keyd
xremap-flake.url = "github:xremap/nix-flake";
# betterfox - preconfigured firefox user.js
betterfox-nix.url = "github:HeitorAugustoLN/betterfox-nix";
};
outputs = {
@ -50,6 +52,7 @@
sops-nix,
niri-flake,
xremap-flake,
betterfox-nix,
...
} @ inputs: let
overlays = [
@ -112,6 +115,7 @@
nix-flatpak.homeManagerModules.nix-flatpak
sops-nix.homeManagerModules.sops
niri-flake.homeModules.niri
betterfox-nix.modules.homeManager.betterfox
];
};
"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
telegram-desktop
steam
signal-desktop
# Use Wayland for Jetbrains
(jetbrains.idea-ultimate.override {
vmopts = ''-Dawt.toolkit.name=WLToolkit'';

View file

@ -31,7 +31,8 @@
touchpad = {
tap = true;
natural-scroll = true;
disabled-on-external-mouse = true;
disabled-on-external-mouse = false;
dwt = true; # disable on typing
};
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
# Error correction
setopt CORRECT # Suggest corrections for commands
setopt CORRECT_ALL # Suggest corrections for arguments
# setopt CORRECT # Suggest corrections for commands
# setopt CORRECT_ALL # Suggest corrections for arguments
# edit command line
autoload -Uz edit-command-line

View file

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