feat(firefox): move to dev edition and chase home-manager module changes
All checks were successful
Discord / discord commits (push) Has been skipped

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"
}
},
"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": {
"locked": {
"lastModified": 1733328505,
@ -1627,7 +1610,6 @@
"dracula-plymouth-src": "dracula-plymouth-src",
"eisa-scripts-src": "eisa-scripts-src",
"extended-ollama-conversation-src": "extended-ollama-conversation-src",
"firefox-gx-src": "firefox-gx-src",
"flake-compat": "flake-compat",
"flake-parts": "flake-parts",
"flake-utils": "flake-utils",

View file

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

View file

@ -1,22 +1,17 @@
{
stdenv,
dart-sass,
firefox-gx,
rounding,
...
}:
stdenv.mkDerivation {
pname = "custom-css";
inherit (firefox-gx) version;
version = "0.0.0";
src = ./.;
nativeBuildInputs = [dart-sass];
buildPhase = ''
substituteInPlace ./style.scss --replace-fail \
'$rounding' '${toString rounding}px'
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
#appMenu-mainView .browser-toolbar>* #alltabs-button,
#appMenu-fxa-status2,
#appMenu-fxa-separator {
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;
mainProfile = "dev-edition-default";
cfg = config.programs.firefox;
rounding = (config.wayland.windowManager.hyprland.settings.decoration.rounding or 2) - 2;
firefox-gx = pkgs.callPackage ./firefox-gx {inherit self;};
custom-css = pkgs.callPackage ./custom-css {inherit rounding firefox-gx;};
custom-css = pkgs.callPackage ./custom-css {};
in {
options.programs.firefox.enableCustomConf = mkOption {
type = types.bool;
@ -21,32 +19,23 @@ in {
};
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 = {
enable = true;
profiles.matt = {
package = pkgs.firefox-devedition;
profiles.${mainProfile} = {
isDefault = true;
id = 0;
userChrome = ''
@import url("file://${firefox-gx}/chrome/userChrome.css");
@import url("file://${custom-css}");
'';
settings = {
# Theme
"firefoxgx.tab-shapes" = true;
"firefoxgx.left-sidebar" = true;
"userChrome.tab.bottom_rounded_corner" = true;
"userChrome.tab.bottom_rounded_corner.wave" = false;
"userChrome.tab.bottom_rounded_corner.australis" = true;
# Developer Edition Settings
"xpinstall.signatures.required" = false;
"extensions.experiments.enabled" = true;
# Use the normal file picker
"widget.use-xdg-desktop-portal.file-picker" = 0;
@ -62,9 +51,10 @@ in {
"layout.css.backdrop-filter.enabled" = true;
"browser.newtabpage.activity-stream.improvesearch.handoffToAwesomebar" = false;
"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.ui.enabled" = true;
@ -89,6 +79,7 @@ in {
# remove first run and warning stuff
"datareporting.policy.firstRunURL" = "";
"extensions.autoDisableScopes" = 0;
"browser.aboutwelcome.enabled" = false;
"browser.aboutConfig.showWarning" = false;
@ -109,21 +100,24 @@ in {
};
search = {
default = "SearXNG";
default = "searxng";
force = true;
engines = {
"SearXNG" = {
searxng = {
name = "SearXNG";
urls = singleton {
template = "https://search.nelim.org/search";
params = attrsToList {
"q" = "{searchTerms}";
};
};
iconMapObj."16" = "https://search.nelim.org/favicon.ico";
icon = "https://search.nelim.org/favicon.ico";
definedAliases = ["@s"];
};
"Github Search Code" = {
code = {
name = "Github Search Code";
urls = singleton {
template = "https://github.com/search";
params = attrsToList {
@ -131,11 +125,12 @@ in {
"q" = "NOT is:fork {searchTerms}";
};
};
iconMapObj."16" = "https://icon.horse/icon/github.com";
icon = "https://icon.horse/icon/github.com";
definedAliases = ["@gs"];
};
"Github Nix Code" = {
nixcode = {
name = "Github Nix Code";
urls = singleton {
template = "https://github.com/search";
params = attrsToList {
@ -143,11 +138,12 @@ in {
"q" = "lang:Nix NOT is:fork {searchTerms}";
};
};
iconMapObj."16" = "https://icon.horse/icon/github.com";
icon = "https://icon.horse/icon/github.com";
definedAliases = ["@gn"];
};
"Nixpkgs" = {
nixpkgs = {
name = "Nixpkgs";
urls = singleton {
template = "https://github.com/search";
params = attrsToList {
@ -155,95 +151,100 @@ in {
"q" = "repo:NixOS/nixpkgs {searchTerms}";
};
};
iconMapObj."16" = "https://icon.horse/icon/github.com";
icon = "https://icon.horse/icon/github.com";
definedAliases = ["@pkgs"];
};
"NixOS Wiki" = {
nixwiki = {
name = "NixOS Wiki";
urls = singleton {
template = "https://wiki.nixos.org/w/index.php";
params = attrsToList {
"search" = "{searchTerms}";
};
};
iconMapObj."16" = "https://wiki.nixos.org/favicon.ico";
icon = "https://wiki.nixos.org/favicon.ico";
definedAliases = ["@nw"];
};
"MyNixos" = {
mynixos = {
name = "MyNixos";
urls = singleton {
template = "https://mynixos.com/search";
params = attrsToList {
"q" = "{searchTerms}";
};
};
iconMapObj."16" = "https://mynixos.com/favicon.ico";
icon = "https://mynixos.com/favicon.ico";
definedAliases = ["@mn"];
};
"Noogle" = {
noogle = {
name = "Noogle";
urls = singleton {
template = "https://noogle.dev/q";
params = attrsToList {
"term" = "{searchTerms}";
};
};
iconMapObj."16" = "https://noogle.dev/favicon.ico";
icon = "https://noogle.dev/favicon.ico";
definedAliases = ["@ng"];
};
"Firefox Add-ons" = {
extensions = {
name = "Firefox Add-ons";
urls = singleton {
template = "https://addons.mozilla.org/en-US/firefox/search";
params = attrsToList {
"q" = "{searchTerms}";
};
};
iconMapObj."16" = "https://addons.mozilla.org/favicon.ico";
icon = "https://addons.mozilla.org/favicon.ico";
definedAliases = ["@fa"];
};
"ProtonDB" = {
protondb = {
name = "ProtonDB";
urls = singleton {
template = "https://www.protondb.com/search";
params = attrsToList {
"q" = "{searchTerms}";
};
};
iconMapObj."16" = "https://www.protondb.com/favicon.ico";
icon = "https://www.protondb.com/favicon.ico";
definedAliases = ["@pdb"];
};
"YouTube" = {
youtube = {
name = "YouTube";
urls = singleton {
template = "https://www.youtube.com/results";
params = attrsToList {
"search_query" = "{searchTerms}";
};
};
iconMapObj."16" = "https://www.youtube.com/favicon.ico";
icon = "https://www.youtube.com/favicon.ico";
definedAliases = ["@yt" "@youtube"];
};
"Bing".metaData.hidden = true;
"Google".metaData.hidden = true;
"eBay".metaData.hidden = true;
bing.metaData.hidden = true;
google.metaData.hidden = true;
ebay.metaData.hidden = true;
};
order = [
"SearXNG"
"DuckDuckGo"
"MyNixos"
"NixOS Wiki"
"Github Search Code"
"Github Nix Code"
"Nixpkgs"
"Noogle"
"Wikipedia (en)"
"YouTube"
"Firefox Add-ons"
"ProtonDB"
"Amazon.ca"
"searxng"
"ddg"
"mynixos"
"nixwiki"
"code"
"nixcode"
"nixpkgs"
"noogle"
"wikipedia"
"youtube"
"extensions"
"protondb"
];
};
@ -252,15 +253,13 @@ in {
(firefoxAddons)
auto-refresh-page
bitwarden
checkmarks-web-ext
darkreader
floccus
frankerfacez
google-container
image-search-options
istilldontcareaboutcookies
opera-gx-witchcraft-purple
return-youtube-dislikes
seventv
sponsorblock
sound-volume
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";
repo = "bat";
}
{
owner = "Godiesc";
repo = "firefox-gx";
# ref = "v.9.9";
rev = "6f5d07e11e008d6cbf4461e53daf80820afa8418";
}
{
name = "git-theme-src";
owner = "dracula";

View file

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

View file

@ -39,24 +39,4 @@
inherit buildFirefoxXpiAddon fetchurl lib stdenv;
};
in
lib.makeScope pkgs.newScope (
_:
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;
};
};
}
)
lib.makeScope pkgs.newScope (_: packages // {inherit buildFirefoxXpiAddon;})

View file

@ -56,29 +56,6 @@
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 {
pname = "darkreader";
version = "4.9.103";
@ -201,19 +178,6 @@
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 {
pname = "return-youtube-dislikes";
version = "3.0.0.18";