feat(firefox): move to dev edition and chase home-manager module changes

This commit is contained in:
matt1432 2025-03-21 02:25:56 -04:00
parent 696c2deebf
commit 92d7df0f11
10 changed files with 61 additions and 306 deletions

18
flake.lock generated
View file

@ -255,23 +255,6 @@
"type": "github" "type": "github"
} }
}, },
"firefox-gx-src": {
"flake": false,
"locked": {
"lastModified": 1736531964,
"narHash": "sha256-k6Bh/YX500HWN8RqZelg752emMwelQo16fp+eZYUDk8=",
"owner": "Godiesc",
"repo": "firefox-gx",
"rev": "6f5d07e11e008d6cbf4461e53daf80820afa8418",
"type": "github"
},
"original": {
"owner": "Godiesc",
"repo": "firefox-gx",
"rev": "6f5d07e11e008d6cbf4461e53daf80820afa8418",
"type": "github"
}
},
"flake-compat": { "flake-compat": {
"locked": { "locked": {
"lastModified": 1733328505, "lastModified": 1733328505,
@ -1627,7 +1610,6 @@
"dracula-plymouth-src": "dracula-plymouth-src", "dracula-plymouth-src": "dracula-plymouth-src",
"eisa-scripts-src": "eisa-scripts-src", "eisa-scripts-src": "eisa-scripts-src",
"extended-ollama-conversation-src": "extended-ollama-conversation-src", "extended-ollama-conversation-src": "extended-ollama-conversation-src",
"firefox-gx-src": "firefox-gx-src",
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",

View file

@ -79,13 +79,6 @@
repo = "extended_ollama_conversation"; repo = "extended_ollama_conversation";
type = "github"; type = "github";
}; };
firefox-gx-src = {
flake = false;
owner = "Godiesc";
repo = "firefox-gx";
rev = "6f5d07e11e008d6cbf4461e53daf80820afa8418";
type = "github";
};
flake-compat = { flake-compat = {
owner = "edolstra"; owner = "edolstra";
repo = "flake-compat"; repo = "flake-compat";

View file

@ -1,22 +1,17 @@
{ {
stdenv, stdenv,
dart-sass, dart-sass,
firefox-gx,
rounding,
... ...
}: }:
stdenv.mkDerivation { stdenv.mkDerivation {
pname = "custom-css"; pname = "custom-css";
inherit (firefox-gx) version; version = "0.0.0";
src = ./.; src = ./.;
nativeBuildInputs = [dart-sass]; nativeBuildInputs = [dart-sass];
buildPhase = '' buildPhase = ''
substituteInPlace ./style.scss --replace-fail \
'$rounding' '${toString rounding}px'
sass ./style.scss ./style.css sass ./style.scss ./style.css
''; '';

View file

@ -1,112 +1,6 @@
// Global Vars
:root * {
--tab-height-personal: 43px !important;
--uc-tab-corner-height: 41px !important;
--my-vertical-toolbar-width: 46px !important;
--uc-margin-left-right: -1px !important; // Fix left tab margin on desktop
}
// Put main menu under logo
#appMenu-popup {
--my-menu-button-height: 0 !important;
}
#appMenu-mainView {
// Main Menu outline
.panel-subview-body {
outline: 2px solid var(--button-background-color-primary);
}
// Makes main menu rows all the same height
.subviewbutton {
min-height: 40px !important;
}
}
// Hide unused menu rows // Hide unused menu rows
#appMenu-mainView .browser-toolbar>* #alltabs-button, #appMenu-mainView .browser-toolbar>* #alltabs-button,
#appMenu-fxa-status2, #appMenu-fxa-status2,
#appMenu-fxa-separator { #appMenu-fxa-separator {
display: none !important; display: none !important;
} }
// Extension padding on sidebar
toolbar .toolbarbutton-1>.toolbarbutton-badge-stack {
padding: 10px !important;
}
// Hamburger button style
:root:not([chromehidden~="toolbar"]) #PanelUI-menu-button[open] {
&>.toolbarbutton-badge-stack {
border-top-left-radius: $rounding !important;
--my-menu-button-width: calc(var(--my-menu-button-height) + 4px) !important;
}
}
// Hide "Menu" label
:root:not([chromehidden~="toolbar"]) #PanelUI-menu-button>.toolbarbutton-badge-stack {
.toolbarbutton-icon {
margin-right: 4px;
margin-left: 2px;
margin-top: 4px;
}
}
// Fix extension dialog going off screen
#appMenu-addon-installed-notification,
#notification-popup {
margin-top: -1px !important;
margin-inline: -505px !important;
}
#customizationui-widget-panel {
margin-top: -1px !important;
}
#PersonalToolbar {
.toolbarbutton-1 {
margin-block: 0px !important;
}
#PlacesToolbarItems>.bookmark-item {
margin-block: 6px !important;
}
}
/* ------------------------- Tricks ------------------------------------- */
/* https://github.com/Godiesc/firefox-gx/blob/main/Tricks/README.md */
/* Extensions button into the "left-sidebar" - Immovable */
:root:not([chromehidden~="toolbar"],
[sizemode="fullscreen"]) #PersonalToolbar {
--padding-top-left-sidebar: 75px !important;
/* 182px to one-line config */
}
:root:not([chromehidden~="toolbar"],
[sizemode="fullscreen"]) #unified-extensions-button {
--toolbarbutton-hover-background: transparent !important;
--toolbarbutton-active-background: transparent !important;
position: fixed;
display: flex;
top: 42px !important;
left: 3px !important;
z-index: 2 !important;
fill: var(--general-color) !important;
width: calc(var(--uc-vertical-toolbar-width) - 4px) !important;
}
:root:not([chromehidden~="toolbar"],
:root:not([chromehidden~="toolbar"],
[sizemode="fullscreen"]) #unified-extensions-button:hover,
[sizemode="fullscreen"]) #unified-extensions-button[open] {
transform: scale(1.24) !important;
transition: ease-in-out !important;
}
:root:not([chromehidden~="toolbar"],
[sizemode="fullscreen"]) #unified-extensions-button:active {
transform: scale(1.12) !important;
transition-duration: 0ms !important;
}

View file

@ -8,12 +8,10 @@ self: {
inherit (lib) attrsToList attrValues mkIf mkOption singleton types; inherit (lib) attrsToList attrValues mkIf mkOption singleton types;
mainProfile = "dev-edition-default";
cfg = config.programs.firefox; cfg = config.programs.firefox;
rounding = (config.wayland.windowManager.hyprland.settings.decoration.rounding or 2) - 2; custom-css = pkgs.callPackage ./custom-css {};
firefox-gx = pkgs.callPackage ./firefox-gx {inherit self;};
custom-css = pkgs.callPackage ./custom-css {inherit rounding firefox-gx;};
in { in {
options.programs.firefox.enableCustomConf = mkOption { options.programs.firefox.enableCustomConf = mkOption {
type = types.bool; type = types.bool;
@ -21,32 +19,23 @@ in {
}; };
config = mkIf cfg.enableCustomConf { config = mkIf cfg.enableCustomConf {
home.file = {
".mozilla/firefox/matt/chrome/userContent.css".source = "${firefox-gx}/chrome/userContent.css";
".mozilla/firefox/matt/chrome/components".source = "${firefox-gx}/chrome/components";
".mozilla/firefox/matt/chrome/images".source = "${firefox-gx}/chrome/images";
".mozilla/firefox/matt/chrome/icons".source = "${firefox-gx}/chrome/icons";
};
programs.firefox = { programs.firefox = {
enable = true; enable = true;
profiles.matt = { package = pkgs.firefox-devedition;
profiles.${mainProfile} = {
isDefault = true; isDefault = true;
id = 0; id = 0;
userChrome = '' userChrome = ''
@import url("file://${firefox-gx}/chrome/userChrome.css");
@import url("file://${custom-css}"); @import url("file://${custom-css}");
''; '';
settings = { settings = {
# Theme # Developer Edition Settings
"firefoxgx.tab-shapes" = true; "xpinstall.signatures.required" = false;
"firefoxgx.left-sidebar" = true; "extensions.experiments.enabled" = true;
"userChrome.tab.bottom_rounded_corner" = true;
"userChrome.tab.bottom_rounded_corner.wave" = false;
"userChrome.tab.bottom_rounded_corner.australis" = true;
# Use the normal file picker # Use the normal file picker
"widget.use-xdg-desktop-portal.file-picker" = 0; "widget.use-xdg-desktop-portal.file-picker" = 0;
@ -62,9 +51,10 @@ in {
"layout.css.backdrop-filter.enabled" = true; "layout.css.backdrop-filter.enabled" = true;
"browser.newtabpage.activity-stream.improvesearch.handoffToAwesomebar" = false; "browser.newtabpage.activity-stream.improvesearch.handoffToAwesomebar" = false;
"browser.newtabpage.activity-stream.newtabWallpapers.enabled" = true; "browser.newtabpage.activity-stream.newtabWallpapers.enabled" = true;
"browser.newtabpage.activity-stream.newtabWallpapers.v2.enabled" = true;
/* /*
To active container tabs without any extension To activate container tabs without any extension
*/ */
"privacy.userContext.enabled" = true; "privacy.userContext.enabled" = true;
"privacy.userContext.ui.enabled" = true; "privacy.userContext.ui.enabled" = true;
@ -89,6 +79,7 @@ in {
# remove first run and warning stuff # remove first run and warning stuff
"datareporting.policy.firstRunURL" = ""; "datareporting.policy.firstRunURL" = "";
"extensions.autoDisableScopes" = 0;
"browser.aboutwelcome.enabled" = false; "browser.aboutwelcome.enabled" = false;
"browser.aboutConfig.showWarning" = false; "browser.aboutConfig.showWarning" = false;
@ -109,21 +100,24 @@ in {
}; };
search = { search = {
default = "SearXNG"; default = "searxng";
force = true; force = true;
engines = { engines = {
"SearXNG" = { searxng = {
name = "SearXNG";
urls = singleton { urls = singleton {
template = "https://search.nelim.org/search"; template = "https://search.nelim.org/search";
params = attrsToList { params = attrsToList {
"q" = "{searchTerms}"; "q" = "{searchTerms}";
}; };
}; };
iconMapObj."16" = "https://search.nelim.org/favicon.ico"; icon = "https://search.nelim.org/favicon.ico";
definedAliases = ["@s"]; definedAliases = ["@s"];
}; };
"Github Search Code" = { code = {
name = "Github Search Code";
urls = singleton { urls = singleton {
template = "https://github.com/search"; template = "https://github.com/search";
params = attrsToList { params = attrsToList {
@ -131,11 +125,12 @@ in {
"q" = "NOT is:fork {searchTerms}"; "q" = "NOT is:fork {searchTerms}";
}; };
}; };
iconMapObj."16" = "https://icon.horse/icon/github.com"; icon = "https://icon.horse/icon/github.com";
definedAliases = ["@gs"]; definedAliases = ["@gs"];
}; };
"Github Nix Code" = { nixcode = {
name = "Github Nix Code";
urls = singleton { urls = singleton {
template = "https://github.com/search"; template = "https://github.com/search";
params = attrsToList { params = attrsToList {
@ -143,11 +138,12 @@ in {
"q" = "lang:Nix NOT is:fork {searchTerms}"; "q" = "lang:Nix NOT is:fork {searchTerms}";
}; };
}; };
iconMapObj."16" = "https://icon.horse/icon/github.com"; icon = "https://icon.horse/icon/github.com";
definedAliases = ["@gn"]; definedAliases = ["@gn"];
}; };
"Nixpkgs" = { nixpkgs = {
name = "Nixpkgs";
urls = singleton { urls = singleton {
template = "https://github.com/search"; template = "https://github.com/search";
params = attrsToList { params = attrsToList {
@ -155,95 +151,100 @@ in {
"q" = "repo:NixOS/nixpkgs {searchTerms}"; "q" = "repo:NixOS/nixpkgs {searchTerms}";
}; };
}; };
iconMapObj."16" = "https://icon.horse/icon/github.com"; icon = "https://icon.horse/icon/github.com";
definedAliases = ["@pkgs"]; definedAliases = ["@pkgs"];
}; };
"NixOS Wiki" = { nixwiki = {
name = "NixOS Wiki";
urls = singleton { urls = singleton {
template = "https://wiki.nixos.org/w/index.php"; template = "https://wiki.nixos.org/w/index.php";
params = attrsToList { params = attrsToList {
"search" = "{searchTerms}"; "search" = "{searchTerms}";
}; };
}; };
iconMapObj."16" = "https://wiki.nixos.org/favicon.ico"; icon = "https://wiki.nixos.org/favicon.ico";
definedAliases = ["@nw"]; definedAliases = ["@nw"];
}; };
"MyNixos" = { mynixos = {
name = "MyNixos";
urls = singleton { urls = singleton {
template = "https://mynixos.com/search"; template = "https://mynixos.com/search";
params = attrsToList { params = attrsToList {
"q" = "{searchTerms}"; "q" = "{searchTerms}";
}; };
}; };
iconMapObj."16" = "https://mynixos.com/favicon.ico"; icon = "https://mynixos.com/favicon.ico";
definedAliases = ["@mn"]; definedAliases = ["@mn"];
}; };
"Noogle" = { noogle = {
name = "Noogle";
urls = singleton { urls = singleton {
template = "https://noogle.dev/q"; template = "https://noogle.dev/q";
params = attrsToList { params = attrsToList {
"term" = "{searchTerms}"; "term" = "{searchTerms}";
}; };
}; };
iconMapObj."16" = "https://noogle.dev/favicon.ico"; icon = "https://noogle.dev/favicon.ico";
definedAliases = ["@ng"]; definedAliases = ["@ng"];
}; };
"Firefox Add-ons" = { extensions = {
name = "Firefox Add-ons";
urls = singleton { urls = singleton {
template = "https://addons.mozilla.org/en-US/firefox/search"; template = "https://addons.mozilla.org/en-US/firefox/search";
params = attrsToList { params = attrsToList {
"q" = "{searchTerms}"; "q" = "{searchTerms}";
}; };
}; };
iconMapObj."16" = "https://addons.mozilla.org/favicon.ico"; icon = "https://addons.mozilla.org/favicon.ico";
definedAliases = ["@fa"]; definedAliases = ["@fa"];
}; };
"ProtonDB" = { protondb = {
name = "ProtonDB";
urls = singleton { urls = singleton {
template = "https://www.protondb.com/search"; template = "https://www.protondb.com/search";
params = attrsToList { params = attrsToList {
"q" = "{searchTerms}"; "q" = "{searchTerms}";
}; };
}; };
iconMapObj."16" = "https://www.protondb.com/favicon.ico"; icon = "https://www.protondb.com/favicon.ico";
definedAliases = ["@pdb"]; definedAliases = ["@pdb"];
}; };
"YouTube" = { youtube = {
name = "YouTube";
urls = singleton { urls = singleton {
template = "https://www.youtube.com/results"; template = "https://www.youtube.com/results";
params = attrsToList { params = attrsToList {
"search_query" = "{searchTerms}"; "search_query" = "{searchTerms}";
}; };
}; };
iconMapObj."16" = "https://www.youtube.com/favicon.ico"; icon = "https://www.youtube.com/favicon.ico";
definedAliases = ["@yt" "@youtube"]; definedAliases = ["@yt" "@youtube"];
}; };
"Bing".metaData.hidden = true; bing.metaData.hidden = true;
"Google".metaData.hidden = true; google.metaData.hidden = true;
"eBay".metaData.hidden = true; ebay.metaData.hidden = true;
}; };
order = [ order = [
"SearXNG" "searxng"
"DuckDuckGo" "ddg"
"MyNixos" "mynixos"
"NixOS Wiki" "nixwiki"
"Github Search Code" "code"
"Github Nix Code" "nixcode"
"Nixpkgs" "nixpkgs"
"Noogle" "noogle"
"Wikipedia (en)" "wikipedia"
"YouTube" "youtube"
"Firefox Add-ons" "extensions"
"ProtonDB" "protondb"
"Amazon.ca"
]; ];
}; };
@ -252,15 +253,13 @@ in {
(firefoxAddons) (firefoxAddons)
auto-refresh-page auto-refresh-page
bitwarden bitwarden
checkmarks-web-ext
darkreader darkreader
floccus floccus
frankerfacez
google-container google-container
image-search-options image-search-options
istilldontcareaboutcookies istilldontcareaboutcookies
opera-gx-witchcraft-purple
return-youtube-dislikes return-youtube-dislikes
seventv
sponsorblock sponsorblock
sound-volume sound-volume
stylus stylus

View file

@ -1,40 +0,0 @@
{
lib,
self,
stdenvNoCC,
}: let
inherit (builtins) fromJSON readFile;
inherit (lib) hasPrefix replaceStrings;
inherit (self.inputs) firefox-gx-src;
inherit (self.lib) mkVersion;
lock = fromJSON (readFile ../../../flake.lock);
rev =
lock.nodes.firefox-gx-src.original.ref
or lock.nodes.firefox-gx-src.original.rev;
in
stdenvNoCC.mkDerivation {
pname = "firefox-gx";
version =
if hasPrefix "v." rev
then replaceStrings ["v"] ["0"] rev
else mkVersion firefox-gx-src;
src = firefox-gx-src;
installPhase = ''
# Personal changes
sed -i 's/var(--fuchsia))/var(--purple))/' ./chrome/components/ogx_root-personal.css
sed -i 's#../newtab/wallpaper-dark1.png#../newtab/wallpaper-dark2.png#' ./chrome/components/ogx_root-personal.css
mkdir -p $out
cp -r ./* $out
'';
meta = {
description = "Firefox Theme CSS to Opera GX Lovers";
homepage = "https://github.com/Godiesc/firefox-gx";
license = lib.licenses.mspl;
};
}

View file

@ -384,12 +384,6 @@ let
owner = "matt1432"; owner = "matt1432";
repo = "bat"; repo = "bat";
} }
{
owner = "Godiesc";
repo = "firefox-gx";
# ref = "v.9.9";
rev = "6f5d07e11e008d6cbf4461e53daf80820afa8418";
}
{ {
name = "git-theme-src"; name = "git-theme-src";
owner = "dracula"; owner = "dracula";

View file

@ -6,9 +6,6 @@
"pname": "bitwarden", "pname": "bitwarden",
"slug": "bitwarden-password-manager" "slug": "bitwarden-password-manager"
}, },
{
"slug": "checkmarks-web-ext"
},
{ {
"slug": "darkreader" "slug": "darkreader"
}, },
@ -31,9 +28,6 @@
"shortName": "mpl11" "shortName": "mpl11"
} }
}, },
{
"slug": "opera-gx-witchcraft-purple"
},
{ {
"slug": "return-youtube-dislikes" "slug": "return-youtube-dislikes"
}, },

View file

@ -39,24 +39,4 @@
inherit buildFirefoxXpiAddon fetchurl lib stdenv; inherit buildFirefoxXpiAddon fetchurl lib stdenv;
}; };
in in
lib.makeScope pkgs.newScope ( lib.makeScope pkgs.newScope (_: packages // {inherit buildFirefoxXpiAddon;})
_:
packages
// {
inherit buildFirefoxXpiAddon;
seventv = buildFirefoxXpiAddon {
pname = "frankerfacez";
version = "4.0";
addonId = "frankerfacez@frankerfacez.com";
url = "https://cdn.frankerfacez.com/script/frankerfacez-4.0-an+fx.xpi";
sha256 = "sha256-U/yAra2c+RlGSaQtHfBz9XYsoDaJ67gmPJBsFrpqoE8=";
meta = with lib; {
homepage = "https://www.frankerfacez.com/";
description = "The Twitch Enhancement Suite. Get custom emotes and tons of new features you'll never want to go without.";
license = licenses.asl20;
platforms = platforms.all;
};
};
}
)

View file

@ -56,29 +56,6 @@
platforms = platforms.all; platforms = platforms.all;
}; };
}; };
"checkmarks-web-ext" = buildFirefoxXpiAddon {
pname = "checkmarks-web-ext";
version = "1.6.1";
addonId = "{bd97f89b-17ba-4539-9fec-06852d07f917}";
url = "https://addons.mozilla.org/firefox/downloads/file/3594420/checkmarks_web_ext-1.6.1.xpi";
sha256 = "c3ccf4b302ee96c9b883c4a1f7d26395ab4e276b976cab2d65c9cd898964e4f0";
meta = with lib; {
homepage = "https://github.com/tanwald/checkmarks";
description = "Checks, sorts, formats bookmarks and loads favicons.";
license = licenses.gpl3;
mozPermissions = [
"<all_urls>"
"bookmarks"
"browsingData"
"storage"
"tabs"
"webNavigation"
"webRequest"
"webRequestBlocking"
];
platforms = platforms.all;
};
};
"darkreader" = buildFirefoxXpiAddon { "darkreader" = buildFirefoxXpiAddon {
pname = "darkreader"; pname = "darkreader";
version = "4.9.103"; version = "4.9.103";
@ -201,19 +178,6 @@
platforms = platforms.all; platforms = platforms.all;
}; };
}; };
"opera-gx-witchcraft-purple" = buildFirefoxXpiAddon {
pname = "opera-gx-witchcraft-purple";
version = "2.0";
addonId = "{bf197856-a3c2-4280-84c5-9b556379b706}";
url = "https://addons.mozilla.org/firefox/downloads/file/3522842/opera_gx_witchcraft_purple-2.0.xpi";
sha256 = "aa3c6377b8571c42a3988de042694be70ec6a250a9aea7ae1cc262acdc9374eb";
meta = with lib; {
description = "inspired by Opera GX";
license = licenses.cc-by-sa-30;
mozPermissions = [];
platforms = platforms.all;
};
};
"return-youtube-dislikes" = buildFirefoxXpiAddon { "return-youtube-dislikes" = buildFirefoxXpiAddon {
pname = "return-youtube-dislikes"; pname = "return-youtube-dislikes";
version = "3.0.0.18"; version = "3.0.0.18";