Change to Firefox, generalize terminal apps, update Forgejo, simplify other files

This commit is contained in:
Jimbo 2025-02-22 02:21:44 -05:00
parent 63fc72eeb0
commit eda4cd528f
20 changed files with 81 additions and 94 deletions

View file

@ -1,288 +0,0 @@
{ pkgs, config, lib, nur, ... }:
{
config = lib.mkIf config.home.desktop.enable {
programs.firefox = {
enable = true;
package = pkgs.librewolf;
profiles = let
# FireFox css, based on https://github.com/Dook97/firefox-qutebrowser-userchrome
themeFont = ''
--tab-font: '${config.look.fonts.main}';
--urlbar-font: '${config.look.fonts.main}';
'';
themeMain = ''
:root {
--tab-active-bg-color: #${config.look.colors.prime};
--tab-hover-bg-color: #${config.look.colors.accent};
--tab-inactive-bg-color: #${config.look.colors.dark};
--tab-active-fg-fallback-color: #FFFFFF;
--tab-inactive-fg-fallback-color: #${config.look.colors.text};
--urlbar-focused-bg-color: #${config.look.colors.dark};
--urlbar-not-focused-bg-color: #${config.look.colors.dark};
--toolbar-bgcolor: #${config.look.colors.dark} !important;
'';
themeAlt = ''
:root {
--tab-active-bg-color: #${config.look.colors.dark};
--tab-hover-bg-color: #${config.look.colors.accent};
--tab-inactive-bg-color: #${config.look.colors.prime};
--tab-active-fg-fallback-color: #${config.look.colors.text};
--tab-inactive-fg-fallback-color: #FFFFFF;
--urlbar-focused-bg-color: #${config.look.colors.prime};
--urlbar-not-focused-bg-color: #${config.look.colors.prime};
--toolbar-bgcolor: #${config.look.colors.prime} !important;
'';
# Profile settings
commonExtensions = with pkgs.nur.repos.rycee.firefox-addons; [
ublock-origin
bitwarden
darkreader
sponsorblock
return-youtube-dislikes
simple-tab-groups
vimium
];
commonSearch = {
force = true;
default = "Ecosia";
order = [
"Ecosia"
"NixPKGs"
"MyNixOS"
"YouTube"
];
engines = {
"Ecosia" = {
urls = [
{
template = "https://www.ecosia.org/search";
params = [
{
name = "q";
value = "{searchTerms}";
}
];
}
];
definedAliases = [ "@e" ];
};
"NixPKGs" = {
urls = [
{
template = "https://search.nixos.org/packages";
params = [
{
name = "type";
value = "packages";
}
{
name = "query";
value = "{searchTerms}";
}
];
}
];
definedAliases = [ "@p" ];
};
"MyNixOS" = {
urls = [
{
template = "https://mynixos.com/search";
params = [
{
name = "q";
value = "{searchTerms}";
}
];
}
];
definedAliases = [ "@my" ];
};
"YouTube" = {
urls = [
{
template = "https://www.youtube.com/results";
params = [
{
name = "search_query";
value = "{searchTerms}";
}
];
}
];
definedAliases = [ "@y" ];
};
};
};
commonBookmarks = [
{
name = "NixFox";
url = "https://nixfox.ca";
}
{
name = "Corn";
url = "https://freecorn1854.win";
}
{
name = "Luna";
url = "https://www.lunamoonlight.xyz";
}
{
name = "Kernel";
url = "https://www.kernel.org";
}
];
commonSettings = {
"general.autoScroll" = true;
"font.name.serif.x-western" = config.look.fonts.main;
"font.name.sans-serif.x-western" = config.look.fonts.main;
"font.name.monospace.x-western" = config.look.fonts.nerd;
"browser.uidensity" = 1;
"browser.compactmode.show" = true;
"browser.send_pings" = false;
"browser.shell.checkDefaultBrowser" = false;
"browser.toolbars.bookmarks.visibility" = "never";
"browser.contentblocking.category" = "strict";
"browser.helperApps.deleteTempFileOnExit" = true;
"browser.search.separatePrivateDefault" = false;
"browser.download.useDownloadDir" = true;
"browser.aboutConfig.showWarning" = false;
"browser.startup.page" = 3;
"browser.theme.content-theme" = 0;
"browser.theme.toolbar-theme" = 0;
"browser.newtabpage.enabled" = false;
"browser.newtabpage.activity-stream.showSponsoredTopSites" = false;
"browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons" = false;
"browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features" = false;
"browser.tabs.inTitlebar" = 0;
"browser.tabs.closeWindowWithLastTab" = false;
"browser.urlbar.speculativeConnect.enabled" = false;
"browser.discovery.enabled" = false;
"browser.safebrowsing.downloads.enabled" = false;
"browser.safebrowsing.downloads.remote.enabled" = false;
"browser.safebrowsing.downloads.remote.block_uncommon" = false;
"browser.safebrowsing.downloads.remote.block_potentially_unwanted" = false;
"browser.safebrowsing.malware.enabled" = false;
"browser.safebrowsing.phishing.enabled" = false;
"browser.safebrowsing.blockedURIs.enabled" = false;
"browser.safebrowsing.provider.google4.gethashURL" = false;
"browser.safebrowsing.provider.google4.updateURL" = false;
"browser.safebrowsing.provider.google.gethashURL" = false;
"browser.safebrowsing.provider.google.updateURL" = false;
"extensions.pocket.enabled" = false;
"extensions.autoDisableScopes" = 0;
"extensions.activeThemeID" = "firefox-compact-dark@mozilla.org";
"extensions.formautofill.addresses.enabled" = false;
"extensions.formautofill.creditCards.enabled" = false;
"extensions.getAddons.showPane" = false;
"extensions.webservice.discoverURL" = "";
"extensions.getAddons.discovery.api_url" = "";
"extensions.htmlaboutaddons.discover.enabled" = false;
"extensions.htmlaboutaddons.recommendations.enabled" = false;
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
"toolkit.tabbox.switchByScrolling" = true;
"privacy.resistFingerprinting" = true;
"privacy.resistFingerprinting.autoDeclineNoUserInputCanvasPrompts" = true;
"privacy.firstparty.isolate" = true;
"privacy.fingerprintingProtection" = true;
"privacy.donottrackheader.enabled" = true;
"privacy.globalprivacycontrol.enabled" = true;
"privacy.globalprivacycontrol.functionality.enabled" = true;
"privacy.clearOnShutdown.cookies" = false;
"privacy.clearOnShutdown_v2.cookiesAndStorage" = false;
"urlclassifier.trackingSkipURLs" = "*.reddit.com, *.twitter.com, *.twimg.com, *.tiktok.com";
"urlclassifier.features.socialtracking.skipURLs" = "*.instagram.com, *.twitter.com, *.twimg.com";
"network.trr.mode" = 3;
"network.trr.uri" = "https://wikimedia-dns.org/dns-query";
"network.cookie.cookieBehavior" = 1;
"network.cookie.sameSite.noneRequiresSecure" = true;
"network.http.referer.XOriginPolicy" = 2;
"network.http.referer.XOriginTrimmingPolicy" = 2;
"network.http.referer.trimmingPolicy" = 2;
"media.ffmpeg.vaapi.enabled" = true;
"media.rdd-ffmpeg.enabled" = true;
"media.hardware-video-decoding.force-enabled" = true;
"signon.rememberSignons" = false;
"signon.management.page.breach-alerts.enabled" = false;
"dom.private-attribution.submission.enabled" = false;
"dom.battery.enabled" = false;
"dom.security.https_only_mode" = true;
"dom.security.https_only_mode.upgrade_local" = true;
"dom.security.https_only_mode_ever_enabled" = true;
"dom.security.https_only_mode_ever_enabled_pbm" = true;
"clipboard.autocopy" = false;
"middlemouse.paste" = false;
"identity.fxaccounts.enabled" = false;
"gfx.webrender.all" = true;
"sidebar.position_start" = false;
"datareporting.healthreport.uploadEnabled" = false;
"svg.context-properties.content.enabled" = true;
"services.sync.engine.addresses.available" = false;
"device.sensors.motion.enabled" = false;
"security.OCSP.require" = true;
"gnomeTheme.hideSingleTab" = true;
"webgl.disabled" = false;
};
in {
Main = {
id = 0;
isDefault = true;
extensions = commonExtensions;
search = commonSearch;
bookmarks = commonBookmarks;
settings = commonSettings;
userChrome = ''
${themeMain}
${themeFont}
${builtins.readFile ./quteFox.css}
'';
};
Alt = {
id = 1;
extensions = commonExtensions;
search = commonSearch;
bookmarks = commonBookmarks;
settings = commonSettings;
userChrome = ''
${themeAlt}
${themeFont}
${builtins.readFile ./quteFox.css}
'';
};
Misc = {
id = 2;
extensions = commonExtensions;
search = commonSearch;
bookmarks = commonBookmarks;
settings = commonSettings;
};
};
};
# Fixes
home.file = {
# Symlinks to Librewolf
".librewolf".source = config.lib.file.mkOutOfStoreSymlink "/home/${config.home.username}/.mozilla/firefox";
# Gnome theme
".mozilla/firefox/Misc/chrome".source = fetchTarball {
url = "https://github.com/rafaelmardojai/firefox-gnome-theme/archive/refs/tags/v132.zip";
sha256 = "095sv1ann2v7q5bfy65i118ylhp2vkpbgyf6fz84nd9yrx14rzwm";
};
};
};
}

View file

@ -1,294 +0,0 @@
/* try increasing if you encounter problems */
--urlbar-height-setting: 24px;
--tab-min-height: 20px !important;
/* I don't recommend you touch this unless you know what you're doing */
--arrowpanel-menuitem-padding: 2px !important;
--arrowpanel-border-radius: 0px !important;
--arrowpanel-menuitem-border-radius: 0px !important;
--toolbarbutton-border-radius: 0px !important;
--toolbarbutton-inner-padding: 0px 2px !important;
--toolbar-field-focus-background-color: var(--urlbar-focused-bg-color) !important;
--toolbar-field-background-color: var(--urlbar-not-focused-bg-color) !important;
--toolbar-field-focus-border-color: transparent !important;
}
/* --- GENERAL DEBLOAT ---------------------------------- */
/* Bottom left page loading status or url preview */
#statuspanel { display: none !important; }
/* remove radius from right-click popup */
menupopup, panel { --panel-border-radius: 0px !important; }
menu, menuitem, menucaption { border-radius: 0px !important; }
/* no stupid large buttons in right-click menu */
menupopup > #context-navigation { display: none !important; }
menupopup > #context-sep-navigation { display: none !important; }
/* --- DEBLOAT NAVBAR ----------------------------------- */
#back-button { display: none; }
#forward-button { display: none; }
#reload-button { display: none; }
#stop-button { display: none; }
#home-button { display: none; }
#library-button { display: none; }
/* #fxa-toolbar-menu-button { display: none; } */
/* empty space before and after the url bar */
#customizableui-special-spring1, #customizableui-special-spring2 { display: none; }
.private-browsing-indicator-with-label { display: none; }
/* --- STYLE NAVBAR ------------------------------------ */
/* remove padding between toolbar buttons */
toolbar .toolbarbutton-1 { padding: 0 0 !important; }
/* add it back to the downloads button, otherwise it's too close to the urlbar */
#downloads-button {
margin-left: 2px !important;
}
/* add padding to the right of the last button so that it doesn't touch the edge of the window */
#PanelUI-menu-button {
padding: 0px 4px 0px 0px !important;
}
#urlbar-container {
--urlbar-container-height: var(--urlbar-height-setting) !important;
margin-left: 0 !important;
margin-right: 0 !important;
padding-top: 0 !important;
padding-bottom: 0 !important;
font-family: var(--urlbar-font, 'monospace');
font-size: 14px;
}
#urlbar {
--urlbar-height: var(--urlbar-height-setting) !important;
--urlbar-toolbar-height: var(--urlbar-height-setting) !important;
min-height: var(--urlbar-height-setting) !important;
border-color: var(--lwt-toolbar-field-border-color, hsla(240,5%,5%,.25)) !important;
}
#urlbar-input {
margin-left: 0.4em !important;
margin-right: 0.4em !important;
}
#navigator-toolbox {
border: none !important;
}
/* keep pop-up menus from overlapping with navbar */
#widget-overflow { margin: 4px !important; }
#customizationui-widget-panel { margin: 4px !important; }
#unified-extensions-panel { margin-top: 4px !important; }
#appMenu-popup { margin-top: 4px !important; }
/* --- UNIFIED EXTENSIONS BUTTON ------------------------ */
/* make extension icons smaller */
#unified-extensions-view {
--uei-icon-size: 16px;
}
/* hide bloat */
.unified-extensions-item-message-deck,
#unified-extensions-view > .panel-header,
#unified-extensions-view > toolbarseparator,
#unified-extensions-manage-extensions {
display: none !important;
}
/* add 3px padding on the top and the bottom of the box */
.panel-subview-body {
padding: 3px 0px !important;
}
#unified-extensions-view .toolbarbutton-icon {
padding: 0 !important;
}
.unified-extensions-item-contents {
line-height: 1 !important;
white-space: nowrap !important;
}
#unified-extensions-panel .unified-extensions-item {
margin-block: 0 !important;
}
.toolbar-menupopup :is(menu, menuitem), .subview-subheader, panelview
.toolbarbutton-1, .subviewbutton, .widget-overflow-list .toolbarbutton-1 {
padding: 4px !important;
}
/* --- DEBLOAT URLBAR ----------------------------------- */
#pageActionButton { display: none; }
#pocket-button { display: none; }
#urlbar-zoom-button { display: none; }
#tracking-protection-icon-container { display: none !important; }
/* #reader-mode-button{ display: none !important; } */
/* #star-button { display: none; } */
/* #star-button-box:hover { background: inherit !important; } */
#identity-box { margin-inline-end: 0 !important; }
/* Go to arrow button at the end of the urlbar when searching */
#urlbar-go-button { display: none; }
/* remove container indicator from urlbar */
#userContext-label, #userContext-indicator { display: none !important;}
/* --- STYLE TAB TOOLBAR -------------------------------- */
#titlebar {
--proton-tab-block-margin: 0px !important;
--tab-block-margin: 0px !important;
}
#TabsToolbar, .tabbrowser-tab {
max-height: var(--tab-min-height) !important;
font-size: 14px !important;
}
/* Change color of normal tabs */
tab:not([selected="true"]) {
background-color: var(--tab-inactive-bg-color) !important;
color: var(--identity-icon-color, var(--tab-inactive-fg-fallback-color)) !important;
}
tab {
font-family: var(--tab-font, monospace);
border: none !important;
padding-top: 0 !important;
}
.tab-content {
padding: 0 0 0 var(--tab-inline-padding);
}
.tab-background {
margin-block: 0 !important;
min-height: var(--tab-min-height);
outline-offset: 0 !important;
}
/* safari style tab width */
.tabbrowser-tab[fadein] {
max-width: 100vw !important;
border: none
}
/* Hide close button on tabs */
#tabbrowser-tabs .tabbrowser-tab .tab-close-button { display: none !important; }
/* disable favicons in tab */
/* .tab-icon-stack:not([pinned]) { display: none !important; } */
.tabbrowser-tab {
/* remove border between tabs */
padding-inline: 0px !important;
/* reduce fade effect of tab text */
--tab-label-mask-size: 1em !important;
/* fix pinned tab behaviour on overflow */
overflow-clip-margin: 0px !important;
}
/* Tab: selected colors */
#tabbrowser-tabs .tabbrowser-tab[selected] .tab-content {
background: var(--tab-active-bg-color) !important;
color: var(--identity-icon-color, var(--tab-active-fg-fallback-color)) !important;
}
/* Tab: hovered colors */
#tabbrowser-tabs .tabbrowser-tab:hover:not([selected]) .tab-content {
background: var(--tab-hover-bg-color) !important;
}
/* hide window controls */
.titlebar-buttonbox-container { display: none; }
/* remove titlebar spacers */
.titlebar-spacer { display: none !important; }
/* disable tab shadow */
#tabbrowser-tabs:not([noshadowfortests]) .tab-background:is([selected], [multiselected]) {
box-shadow: none !important;
}
/* remove dark space between pinned tab and first non-pinned tab */
#tabbrowser-tabs[haspinnedtabs]:not([positionpinnedtabs]) >
#tabbrowser-arrowscrollbox >
.tabbrowser-tab:nth-child(1 of :not([pinned], [hidden])) {
margin-inline-start: 0px !important;
}
/* remove dropdown menu button which displays all tabs on overflow */
#alltabs-button { display: none !important }
/* fix displaying of pinned tabs on overflow */
#tabbrowser-tabs:not([secondarytext-unsupported]) .tab-label-container {
height: var(--tab-min-height) !important;
}
#tabbrowser-tabs {
min-height: var(--tab-min-height) !important;
}
/* remove overflow scroll buttons */
#scrollbutton-up, #scrollbutton-down { display: none !important; }
/* remove new tab button */
#tabs-newtab-button {
display: none !important;
}
/* hide private browsing indicator */
#private-browsing-indicator-with-label {
display: none;
}
/* --- AUTOHIDE NAVBAR ---------------------------------- */
#nav-bar,
#urlbar {
transform: translateY(calc(0px - var(--urlbar-height-setting)));
opacity: 0;
}
#navigator-toolbox {
min-height: var(--tab-min-height) !important;
height: var(--tab-min-height) !important;
}
#navigator-toolbox:focus-within {
min-height: calc(var(--urlbar-height-setting) + var(--tab-min-height)) !important;
height: calc(var(--urlbar-height-setting) + var(--tab-min-height)) !important;
transform: translateY(calc(0px - var(--tab-min-height)));
}
#TabsToolbar {
transform: translateY(var(--tab-min-height));
}
#nav-bar:focus-within {
transform: translateY(var(--tab-min-height));
opacity: 1;
}
#urlbar:focus-within {
transform: translateY(0);
opacity: 1;
}
/* --- P/EVENT TAB FOLDING -------------------------- */
.tabbrowser-tab {
min-width: initial !important;
}
.tab-content {
overflow: hidden !important;
}