WiP firefox changes
This commit is contained in:
parent
47dc90e87c
commit
e06971a6a8
5 changed files with 36 additions and 38 deletions
141
modules/common-desktop/firefox/default.nix
Normal file
141
modules/common-desktop/firefox/default.nix
Normal file
|
@ -0,0 +1,141 @@
|
|||
{
|
||||
lib,
|
||||
inputs,
|
||||
self,
|
||||
...
|
||||
}: {
|
||||
# From https://hedgedoc.grimmauld.de/s/rVnTq0-Rs
|
||||
nixpkgs.overlays = lib.singleton (final: prev: {
|
||||
firefox = prev.firefox.overrideAttrs (old: {
|
||||
nativeBuildInputs = (old.nativeBuildInputs or []) ++ (with prev; [zip unzip gnused]);
|
||||
buildCommand =
|
||||
''
|
||||
export buildRoot="$(pwd)"
|
||||
''
|
||||
+ old.buildCommand
|
||||
+ ''
|
||||
pushd $buildRoot
|
||||
unzip $out/lib/firefox/browser/omni.ja -d patched_omni || ret=$?
|
||||
if [[ $ret && $ret -ne 2 ]]; then
|
||||
echo "unzip exited with unexpected error"
|
||||
exit $ret
|
||||
fi
|
||||
rm $out/lib/firefox/browser/omni.ja
|
||||
cd patched_omni
|
||||
sed -i 's/"enterprise_only"\s*:\s*true,//' modules/policies/schema.sys.mjs
|
||||
zip -0DXqr $out/lib/firefox/browser/omni.ja * # potentially qr9XD
|
||||
popd
|
||||
'';
|
||||
});
|
||||
});
|
||||
|
||||
systemd.tmpfiles.settings.firefox = {
|
||||
"/home/quadradical/.mozilla/firefox/quadradical/chrome"."D".user = "quadradical";
|
||||
"/home/quadradical/.mozilla/firefox/quadradical/chrome/userChrome.css"."f+".argument = "@import '${self}/nord.css';@import '${inputs.firefox-gnome-theme}/userChrome.css';";
|
||||
"/home/quadradical/.mozilla/firefox/quadradical/chrome/userContent.css"."f+".argument = "@import '${inputs.firefox-gnome-theme}/userContent.css'";
|
||||
};
|
||||
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
|
||||
policies = {
|
||||
ShowHomeButton = false;
|
||||
|
||||
DisablePocket = true;
|
||||
DisableTelemetry = true;
|
||||
DisableFirefoxStudies = true;
|
||||
DisableFirefoxScreenshots = true;
|
||||
DisableSetDesktopBackground = true;
|
||||
DisableMasterPasswordCreation = true;
|
||||
|
||||
DontCheckDefaultBrowser = true;
|
||||
|
||||
HttpsOnlyMode = "force_enabled";
|
||||
|
||||
DisplayMenuBar = "never";
|
||||
DisplayBookmarksToolbar = "never";
|
||||
|
||||
DNSOverHTTPS.Enabled = false;
|
||||
|
||||
EnableTrackingProtection = {
|
||||
Value = true;
|
||||
Locked = true;
|
||||
Cryptomining = true;
|
||||
Fingerprinting = true;
|
||||
};
|
||||
|
||||
FirefoxHome = {
|
||||
TopSites = true;
|
||||
SponsoredTopSites = false;
|
||||
|
||||
Pocket = false;
|
||||
Snippets = false;
|
||||
Highlights = false;
|
||||
Locked = true;
|
||||
};
|
||||
|
||||
FirefoxSuggest = {
|
||||
WebSuggestions = false;
|
||||
SponsoredSuggestions = false;
|
||||
ImproveSuggest = false;
|
||||
Locked = true;
|
||||
};
|
||||
|
||||
ExtensionSettings = lib.mkForce (lib.listToAttrs (lib.map (id: {
|
||||
name = id;
|
||||
value = {
|
||||
install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/${id}/latest.xpi";
|
||||
installation_mode = "force_installed";
|
||||
};
|
||||
}) [
|
||||
"historyblock@kain"
|
||||
"uBlock0@raymondhill.net"
|
||||
"sponsorBlocker@ajay.app"
|
||||
"jid1-MnnxcxisBPnSXQ@jetpack" # Privacy Badger
|
||||
"frankerfacez@frankerfacez.com"
|
||||
"7esoorv3@alefvanoon.anonaddy.me" # LibRedirect
|
||||
"{4ce83447-8255-43c2-b8f7-e02eb8c2cc39}" # Draw on Page
|
||||
"{ac34afe8-3a2e-4201-b745-346c0cf6ec7d}" # Better Youtube Shorts
|
||||
"{2327d818-55d3-441d-aea2-8b44aa2cb9aa}" # Toggle Website Colors
|
||||
"{a6c4a591-f1b2-4f03-b3ff-767e5bedf4e7}" # User-Agent Switcher and Manager
|
||||
"enhancerforyoutube@maximerf.addons.mozilla.org"
|
||||
]));
|
||||
|
||||
SearchEngines = {
|
||||
Default = "DuckDuckGo";
|
||||
Remove = ["Bing" "Google" "Amazon.ca" "eBay"];
|
||||
Add = [
|
||||
{
|
||||
Name = "Nix Package Search";
|
||||
URLTemplate = "https://search.nixos.org/packages?channel=unstable&query={searchTerms}";
|
||||
IconURL = "https://github.com/NixOS/nixos-artwork/raw/refs/heads/master/logo/nix-snowflake-white.svg";
|
||||
Alias = "np";
|
||||
}
|
||||
{
|
||||
Name = "NixOS Option Search";
|
||||
URLTemplate = "https://search.nixos.org/options?channel=unstable&query={searchTerms}";
|
||||
IconURL = "https://github.com/NixOS/nixos-artwork/raw/refs/heads/master/logo/nix-snowflake-white.svg";
|
||||
Alias = "no";
|
||||
}
|
||||
{
|
||||
Name = "NixOS Wiki";
|
||||
URLTemplate = "https://nixos.wiki/index.php?search={searchTerms}";
|
||||
IconURL = "https://github.com/NixOS/nixos-artwork/raw/refs/heads/master/logo/nix-snowflake-white.svg";
|
||||
Alias = "nw";
|
||||
}
|
||||
{
|
||||
Name = "Home Manager Option Search";
|
||||
URLTemplate = "https://mipmip.github.io/home-manager-option-search?query={searchTerms}";
|
||||
IconURL = "https://github.com/NixOS/nixos-artwork/raw/refs/heads/master/logo/nix-snowflake-white.svg";
|
||||
Alias = "hm";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
Preferences = {
|
||||
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
|
||||
"browser.uiCustomization.state" = "{\"placements\":{\"widget-overflow-fixed-list\":[],\"unified-extensions-area\":[],\"nav-bar\":[\"back-button\",\"forward-button\",\"stop-reload-button\",\"urlbar-container\",\"downloads-button\"],\"toolbar-menubar\":[\"menubar-items\"],\"TabsToolbar\":[\"tabbrowser-tabs\",\"new-tab-button\",\"alltabs-button\"],\"PersonalToolbar\":[\"personal-bookmarks\"]},\"seen\":[\"save-to-pocket-button\",\"developer-button\"],\"dirtyAreaCache\":[\"nav-bar\",\"PersonalToolbar\",\"toolbar-menubar\",\"TabsToolbar\"],\"currentVersion\":19}";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
140
modules/common-desktop/firefox/nord.css
Normal file
140
modules/common-desktop/firefox/nord.css
Normal file
|
@ -0,0 +1,140 @@
|
|||
@namespace xul url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
|
||||
|
||||
/* Variables that start with --gnome- are added by me and are assigned
|
||||
* to elements somewhere in this code. The rest of the variables are
|
||||
* built-in in Firefox, so you need to add an !important if you wanna
|
||||
* override them. */
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
/* Browser area before a page starts loading */
|
||||
--gnome-browser-before-load-background: #2e3440;
|
||||
|
||||
/* Accent */
|
||||
--gnome-accent-bg: #3584e4;
|
||||
--gnome-accent: #78aeed;
|
||||
|
||||
/* Toolbars */
|
||||
--gnome-toolbar-background: var(--gnome-headerbar-background);
|
||||
--gnome-toolbar-color: #d8dee9;
|
||||
--gnome-toolbar-border-color: rgba(0, 0, 0, 0.36);
|
||||
--gnome-toolbar-icon-fill: #eeeeec;
|
||||
--gnome-inactive-toolbar-color: #919190;
|
||||
--gnome-inactive-toolbar-background: var(
|
||||
--gnome-inactive-headerbar-background
|
||||
);
|
||||
--gnome-inactive-toolbar-border-color: var(
|
||||
--gnome-toolbar-border-color
|
||||
);
|
||||
--gnome-inactive-toolbar-icon-fill: #919190;
|
||||
|
||||
/* Sidebar */
|
||||
--gnome-sidebar-background: var(--gnome-toolbar-background);
|
||||
--gnome-inactive-sidebar-background: var(--gnome-sidebar-background);
|
||||
|
||||
/* Menus */
|
||||
--gnome-menu-background: #3b4252;
|
||||
--gnome-menu-border-color: rgba(0, 0, 0, 0.14);
|
||||
--gnome-menu-shadow: 0 1px 5px 1px rgba(0, 0, 0, 0.09),
|
||||
0 2px 14px 3px rgba(0, 0, 0, 0.05);
|
||||
--gnome-menu-button-hover-background: var(--gnome-button-background);
|
||||
--gnome-menu-separator-color: rgba(255, 255, 255, 0.1);
|
||||
|
||||
/* Header bar */
|
||||
--gnome-headerbar-background: #2e3440;
|
||||
--gnome-headerbar-border-color: var(--gnome-toolbar-border-color);
|
||||
/* --gnome-inactive-headerbar-background: var(--gnome-browser-before-load-background);*/
|
||||
--gnome-inactive-headerbar-background: #3b4252;
|
||||
--gnome-inactive-headerbar-border-color: var(
|
||||
--gnome-inactive-toolbar-border-color
|
||||
);
|
||||
|
||||
/* Buttons */
|
||||
--gnome-button-background: rgba(255, 255, 255, 0.1);
|
||||
--gnome-button-hover-background: rgba(255, 255, 255, 0.15);
|
||||
--gnome-button-active-background: rgba(255, 255, 255, 0.3);
|
||||
--gnome-button-flat-hover-background: rgba(255, 255, 255, 0.07);
|
||||
--gnome-button-flat-active-background: rgba(255, 255, 255, 0.1);
|
||||
--gnome-button-suggested-action-background: var(--gnome-accent-bg);
|
||||
--gnome-button-destructive-action-background: #e01b24;
|
||||
|
||||
--gnome-button-close-background: var(
|
||||
--gnome-button-flat-hover-background
|
||||
);
|
||||
--gnome-button-hover-close-background: var(
|
||||
--gnome-button-hover-background
|
||||
);
|
||||
--gnome-button-active-close-background: var(
|
||||
--gnome-button-active-background
|
||||
);
|
||||
|
||||
--gnome-toolbar-star-button: #f8e45c;
|
||||
|
||||
/* Entries */
|
||||
--gnome-entry-background: rgba(255, 255, 255, 0.1);
|
||||
--gnome-entry-color: #d8dee9;
|
||||
--gnome-inactive-entry-color: #d6d6d6;
|
||||
--gnome-focused-urlbar-border-color: rgba(
|
||||
120,
|
||||
174,
|
||||
237,
|
||||
0.5
|
||||
); /* Same as --gnome-accent but with opacity*/
|
||||
|
||||
/* Switch */
|
||||
--gnome-switch-background: rgba(255, 255, 255, 0.15);
|
||||
--gnome-switch-slider-background: #d2d2d2;
|
||||
--gnome-switch-active-background: var(--gnome-accent-bg);
|
||||
--gnome-switch-active-slider-background: #d8dee9;
|
||||
|
||||
/* Tabs */
|
||||
--gnome-tabbar-background: var(--gnome-headerbar-background);
|
||||
--gnome-tabbar-tab-separator-color: rgba(255, 255, 255, 0.15);
|
||||
--gnome-tabbar-tab-hover-background: #3a404b; /* Hardcoded color */
|
||||
--gnome-tabbar-tab-active-background: #3f4551; /* Hardcoded color */
|
||||
--gnome-tabbar-tab-active-background-contrast: #616979; /* Hardcoded color */
|
||||
--gnome-tabbar-tab-active-hover-background: #444a56; /* Hardcoded color */
|
||||
--gnome-inactive-tabbar-background: var(
|
||||
--gnome-inactive-headerbar-background
|
||||
);
|
||||
--gnome-inactive-tabbar-tab-hover-background: #404857; /* Hardcoded color */
|
||||
--gnome-inactive-tabbar-tab-active-background: #434a59; /* Hardcoded color */
|
||||
--gnome-tab-button-background: rgba(0, 0, 0, 0.5);
|
||||
--gnome-tab-button-hover-background: rgba(0, 0, 0, 0.6);
|
||||
--gnome-tabbar-tab-identity-base-opacity: 0;
|
||||
--gnome-tabbar-tab-needs-attetion: #546f8e;
|
||||
}
|
||||
|
||||
/* Private window colors */
|
||||
:root {
|
||||
--gnome-private-accent: #71a1db;
|
||||
|
||||
/* Toolbars */
|
||||
--gnome-private-toolbar-background: #1c2438;
|
||||
--gnome-private-inactive-toolbar-background: var(
|
||||
--gnome-private-toolbar-background
|
||||
);
|
||||
/* Menus */
|
||||
--gnome-private-menu-background: #252f49;
|
||||
/* Header bar */
|
||||
--gnome-private-headerbar-background: #252f49;
|
||||
--gnome-private-inactive-headerbar-background: var(
|
||||
--gnome-private-toolbar-background
|
||||
);
|
||||
/* Tabs */
|
||||
--gnome-private-tabbar-tab-hover-background: #343e56; /* Hardcoded color */
|
||||
--gnome-private-tabbar-tab-active-background: #343e56; /* Hardcoded color */
|
||||
--gnome-private-tabbar-tab-active-background-contrast: #495675; /* Hardcoded color */
|
||||
--gnome-private-tabbar-tab-active-hover-background: #414a61; /* Hardcoded color */
|
||||
--gnome-private-inactive-tabbar-tab-hover-background: #242c3f; /* Hardcoded color */
|
||||
--gnome-private-inactive-tabbar-tab-active-background: #272e41; /* Hardcoded color */
|
||||
|
||||
/* Text color for Firefox Logo in new private tab */
|
||||
--gnome-private-wordmark: #fbfbfe;
|
||||
|
||||
/* New private tab background */
|
||||
--gnome-private-in-content-page-background: #1c2438;
|
||||
|
||||
/* Private browsing info box */
|
||||
--gnome-private-text-primary-color: #fbfbfe;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue