{ config, pkgs, ... }: let colo = config.local.scheme; in { environment.systemPackages = with pkgs; [ firefox ]; environment.sessionVariables = { BROWSER = "firefox"; }; services.psd.enable = true; home-manager.users.andrew = { home.file."user-overrides.js" = { target = ".mozilla/firefox/default/user-overrides.js"; source = ../../../files/firefox/user-overrides.js; }; home.file."firefox-gnome-theme" = { target = ".mozilla/firefox/default/chrome/firefox-gnome-theme"; source = (pkgs.fetchFromGitHub { owner = "rafaelmardojai"; repo = "firefox-gnome-theme"; rev = "66b7c635763d8e6eb86bd766de5a1e1fbfcc1047"; hash = "sha256-OkFLrD3pFR952TrjQi1+Vdj604KLcMnkpa7lkW7XskI="; }); }; home.file."customChrome.css" = { target = ".mozilla/firefox/default/chrome/customChrome.css"; source = pkgs.writeText "customChrome.css" '' @namespace xul url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); @media (prefers-color-scheme: ${colo.lightness}) { :root { /* Accent */ --gnome-accent-bg: #${colo.color3}; --gnome-accent: #${colo.color4}; --gnome-toolbar-star-button: #${colo.color4}; /* Window */ --gnome-window-background: #${colo.background}; --gnome-window-color: #${colo.foreground}; --gnome-view-background: #${colo.background}; --gnome-sidebar-background: #${colo.color5}; --gnome-secondary-sidebar-background: #${colo.color4}; /* Card */ --gnome-card-background: #${colo.background}; --gnome-card-shade-color: #${colo.color4}; /* Menu */ --gnome-menu-background: #${colo.background}; /* Header bar */ --gnome-headerbar-background: #${colo.background}; --gnome-headerbar-shade-color: #${colo.background}; /* Toolbars */ --gnome-toolbar-icon-fill: #${colo.foreground}; /* Tabs */ --gnome-tabbar-tab-hover-background: #${colo.color5}; --gnome-tabbar-tab-active-background: #${colo.color4}; --gnome-tabbar-tab-active-background-contrast: #${colo.color4}; --gnome-tabbar-tab-active-hover-background: #${colo.color5}; --gnome-tabbar-identity-color-green: var(--gnome-palette-green-1); --gnome-tabbar-identity-color-yellow: var(--gnome-palette-yellow-2); --gnome-tabbar-identity-color-orange: var(--gnome-palette-orange-3); --gnome-tabbar-identity-color-red: var(--gnome-palette-red-1); --gnome-tabbar-identity-color-purple: var(--gnome-palette-purple-1); /* Text color for Firefox Logo in new private tab */ --gnome-private-wordmark: #${colo.background}; /* New private tab background */ --gnome-private-in-content-page-background: #${colo.background}; /* Private browsing info box */ --gnome-private-text-primary-color: #${colo.background}; } /* Backdrop colors */ :root:-moz-window-inactive { --gnome-tabbar-tab-hover-background: #${colo.background}; --gnome-tabbar-tab-active-background: #${colo.background}; } /* Private colors */ :root[privatebrowsingmode="temporary"] { --gnome-accent-fg: #${colo.color4}; /* Headerbar */ --gnome-headerbar-background: #${colo.color5} !important; /* Tabs */ --gnome-tabbar-tab-hover-background: #${colo.color5}; --gnome-tabbar-tab-active-background: #${colo.background}; --gnome-tabbar-tab-active-background-contrast: #${colo.background}; --gnome-tabbar-tab-active-hover-background: #${colo.color5}; } /* Private and backdrop colors */ :root[privatebrowsingmode="temporary"]:-moz-window-inactive { --gnome-headerbar-background: #${colo.color5} !important; --gnome-tabbar-tab-hover-background: #${colo.color5}; --gnome-tabbar-tab-active-background: #${colo.color5}; } } ''; }; home.sessionVariables = { MOZ_WEBRENDER = "1"; MOZ_USE_XINPUT2 = "1"; MOZ_ENABLE_WAYLAND = "1"; }; programs.firefox = { enable = true; profiles.default = { extensions.packages = with pkgs.nur.repos.rycee.firefox-addons; [ ublock-origin youtube-recommended-videos ]; userChrome = '' @import "firefox-gnome-theme/userChrome.css"; @import "customChrome.css"; #urlbar .search-one-offs { display: none !important; } #tabbrowser-tabpanels{ background-color: #${colo.background} !important; } ''; userContent = '' @import "firefox-gnome-theme/userContent.css"; @-moz-document url("about:home"),url("about:blank"),url("about:newtab"),url("about:privatebrowsing") { body{ background-color: #${colo.background} !important } } ''; }; }; }; }