Skip to content

DivitMittal/firefox-nixCfg

firefox-nixCfg

A declarative Firefox configuration using Nix home-manager, designed for enhanced performance, a streamlined UI, and powerful automation.




Table of Contents


This Nix flake-based configuration provides a highly customized and declarative Firefox configuration, managed through a home-manager module. It focuses on delivering a superior browsing experience by integrating performance enhancements, UI/UX improvements, and automation scripts.

Features

Performance & Security (Betterfox)

The configuration incorporates hardened user preferences from Betterfox, deployed via betterfox-nix. This generates a comprehensive user.js file within the Firefox profile, responsible for enhancing performance, removing distracting UI elements, and strengthening security and privacy.

UI/UX & CSS Hacks

The user interface is heavily customized to be minimal, clean, & efficient, largely based on styles from MrOtherGuy/firefox-csshacks.

  • Minimalist Design: The tab bar is hidden, and the URL bar is streamlined for a distraction-free look.
  • Custom Styles: Additional CSS tweaks are applied to refine margins and element spacing for a polished feel.
  • Declarative Theming: All userChrome.css and userContent.css files are managed directly by Nix.

Custom Firefox UI

Automation

This module leverages MrOtherGuy/fx-autoconfig to automatically load custom user scripts (*.uc.js) and CSS at startup. While fx-autoconfig normally requires a manual, procedural setup, this module packages it into a declarative, Nix-based configuration, simplifying management and ensuring reproducibility.

Sidebery Integration

Advanced functionality is added via JavaScript user scripts (*.uc.js), enabling powerful UI automation for the Sidebery extension.

  • Collapsible Sidebar: The sidebar can be automatically collapsed and expanded on hover or by holding the Ctrl key, maximizing screen real estate without sacrificing functionality.

Sidebery Automation GIF

Tridactyl Integration

For keyboard-driven power users, the configuration includes a custom theme and setup for the Tridactyl extension, providing a seamless Vim-like browsing experience.

Tridactyl Theme GIF

Flakes Usage

Add the flake input and import homeManagerConfigurations.default directly into your home-manager modules list. The module is automatically imported — no extra wiring needed:

## flake.nix
{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
    home-manager.url = "github:nix-community/home-manager";
    firefox-nixCfg.url = "github:DivitMittal/firefox-nixCfg";
  };

  outputs = { nixpkgs, home-manager, firefox-nixCfg, ... }: {
    homeConfigurations.your-user = home-manager.lib.homeManagerConfiguration {
      pkgs = nixpkgs.legacyPackages.x86_64-linux;
      modules = [
        firefox-nixCfg.homeManagerConfigurations.default
        ./home.nix
      ];
    };
  };
}

Then configure the available options in your home.nix:

## home.nix
{
  programs.firefox-nixCfg = {
    enableTridactyl = true;     # optional — enables Tridactyl vim keybindings
    package = pkgs.firefox-bin; # optional — override the Firefox package
  };
}

macOS Support: For macOS, this module defaults to using a pre-built Firefox binary from the nixpkgs-firefox-darwin overlay, ensuring a native and optimized experience.

Related Repositories

For AI Agents

Context files (AGENTS.md, CLAUDE.md) are generated — not committed. Run apm compile before exploring the repo to get directory-level guidance.

About

A declarative Firefox configuration using Nix home-manager, designed for enhanced performance, a streamlined UI, and powerful automation

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Contributors