diff options
| author | Tim Keller <tjk@tjkeller.xyz> | 2026-08-01 12:53:01 -0500 |
|---|---|---|
| committer | Tim Keller <tjk@tjkeller.xyz> | 2026-08-01 12:53:01 -0500 |
| commit | a653121ef3d285d2484ed865d6c9460ff81dfb0d (patch) | |
| tree | 2825fc9ce48f95ba4f0bb4cc54a7ae2c6e937b17 | |
| parent | 914dfc4f066ef16a75e69f4bad304895b38a1aa5 (diff) | |
| download | nixos-master.tar.xz nixos-master.zip | |
| -rw-r--r-- | flake.lock | 21 | ||||
| -rw-r--r-- | flake.nix | 6 | ||||
| -rw-r--r-- | home-manager/firefox.nix | 4 | ||||
| -rw-r--r-- | home-manager/resources/firefox/userChrome.css | 175 |
4 files changed, 28 insertions, 178 deletions
@@ -22,6 +22,26 @@ "type": "github" } }, + "firefox-userchrome": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1785605892, + "narHash": "sha256-/2Ov0VsC5Ri2sK4HDrYDzpSME96z1E/mROfevcMe2kQ=", + "ref": "refs/heads/master", + "rev": "106c1b7c7ae2119cf8ab10d87af6e4ca5a21f2e5", + "revCount": 9, + "type": "git", + "url": "git://git.tjkeller.xyz/firefox-chrome" + }, + "original": { + "type": "git", + "url": "git://git.tjkeller.xyz/firefox-chrome" + } + }, "flake-compat": { "flake": false, "locked": { @@ -202,6 +222,7 @@ "root": { "inputs": { "arkenfox": "arkenfox", + "firefox-userchrome": "firefox-userchrome", "home-manager": "home-manager", "neovim-vanilla-wrapped": "neovim-vanilla-wrapped", "nixpkgs": "nixpkgs", @@ -29,6 +29,10 @@ rec { url = "git://git.tjkeller.xyz/neovim-vanilla-wrapped"; inputs.nixpkgs.follows = "nixpkgs"; }; + firefox-userchrome = { + url = "git://git.tjkeller.xyz/firefox-chrome"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { nixpkgs, home-manager, ... }@inputs: let @@ -62,6 +66,7 @@ rec { useGlobalPkgs = true; useUserPackages = true; sharedModules = homeManagerModules; + extraSpecialArgs = { inherit inputs; }; }; } ]; @@ -78,7 +83,6 @@ rec { pkgs = nixpkgs.legacyPackages.${system}; extraSpecialArgs = { inherit inputs; - inherit hostname; lib = extLibHomeManagerStandalone; }; modules = homeManagerModules ++ [ diff --git a/home-manager/firefox.nix b/home-manager/firefox.nix index 7c95e56..119ff35 100644 --- a/home-manager/firefox.nix +++ b/home-manager/firefox.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: let +{ config, lib, pkgs, inputs, ... }: let cfg = config.programs.firefox; search = { engines = { @@ -30,7 +30,7 @@ privateDefault = "Timmy Search"; force = true; # Overwrite old }; - userChrome = builtins.readFile ./resources/firefox/userChrome.css; + userChrome = inputs.firefox-userchrome.userChrome; uiCustomization = { placements = { nav-bar = [ diff --git a/home-manager/resources/firefox/userChrome.css b/home-manager/resources/firefox/userChrome.css deleted file mode 100644 index 7ec4588..0000000 --- a/home-manager/resources/firefox/userChrome.css +++ /dev/null @@ -1,175 +0,0 @@ -/* TODO create separate repo for this */ -/* TOP BAR */ -#navigator-toolbox { - --uc-navigationbar-width: 40vw; - - #TabsToolbar { - /* Move new tab to far right */ - #tabbrowser-arrowscrollbox-periphery { margin-left: auto } - /* remove alltabs button */ - #alltabs-button { display: none } - } - - #nav-bar { - /* Remove overflow button */ - #nav-bar-overflow-button { display: none } - } - - #PersonalToolbar { - /* Change background color of bookmarks toolbar */ - background: var(--toolbox-bgcolor) !important; - /* Adjust spacing of toolbar items */ - #PlacesToolbarItems { gap: .35rem; margin-block: .2rem } - } -} - -/* Media queries for width of nav bar */ -@media screen and (max-width: 1000px) { - #navigator-toolbox { --uc-navigationbar-width: 50vw } -} -@media screen and (max-width: 800px) { - #navigator-toolbox { --uc-navigationbar-width: 60vw } -} - -/* Change look of tabs in smaller view */ -@media screen and (max-width: 800px) { - #TabsToolbar-customization-target { - /* TODO fix w/o. Don't allow tabbar to move up when moving tabs */ - height: 37px; - /* Make tabs fill more vertical space */ - .tab-background { margin-block: 1px !important } - } -} - - -/* COMBINE TOP BAR */ -/* Combine top bar into single line if width >= 800px */ -@media screen and (min-width: 800px) { - /* Half height bar */ - :root { --uc-toolbar-height: 36px } - - /* Modify these to change relative widths or default height */ - #navigator-toolbox { - margin-bottom: 0px; - padding-top: 1px; /* Top bar is cut off otherwise */ - - #TabsToolbar { - margin-left: calc(var(--uc-navigationbar-width) + 2px); /* Resize tab bar */ - margin-top: -4px; - margin-bottom: 2px; - - #TabsToolbar-customization-target { - height: var(--uc-toolbar-height); - - /* Tabs extend to bottom of bar */ - .tab-background { - margin-bottom: 0 !important; - margin-top: 3px !important; /* See above navigator-toolbox rule. Avoid cutting off top */ - } - - /* 1px margin on touch density causes tabs to be too high */ - .tab-close-button { margin-top: 0 !important } - } - - /* Center tab buttons */ - #tabs-newtab-button, #alltabs-button { margin-top: 4px !important } - } - - /* Integrate url / nav bar */ - #nav-bar { - margin-right:calc(100vw - var(--uc-navigationbar-width)); - margin-top: calc(0px - var(--uc-toolbar-height)); - border-radius: 0 var(--tab-border-radius) var(--tab-border-radius) 0; - border-right: 1px solid ThreeDShadow !important; - box-shadow: 0 0 4px rgba(0,0,0,.4) !important; - /* Fix spacing around tabs by removing nav bar top border */ - border: none !important; - - #urlbar-container { - /* Remove min and max width of urlbar */ - width: 0 !important; - /* Make opened urlbar overlay the toolbar */ - #urlbar[open]:focus-within { min-width: 50vw !important } - } - } - - /* Bottom of tags is cut off by 1px without this */ - #PersonalToolbar { margin-top: 1px } - } - - /* Fix customization view */ - #customization-panelWrapper .panel-arrowbox .panel-arrow { - margin-inline-end: initial !important; - } - - /* Shorten findbar */ - findbar { - width: 600px !important; - border-radius: 0 0 0 5px; - border-bottom: none !important; - box-shadow: 0 2px 4px rgba(0,0,0,.4); /* Move down 2px so it doesn't go over the tab bar */ - } -} - - -/* FINDBAR */ -findbar { - width: 100vw; - position: absolute; - top: 0; - right: 0; - padding: 0 !important; - padding-top: 1px !important; - background: -moz-headerbar Field !important; - border-top-width: 0px !important; - border-bottom: 1px solid ThreeDShadow; - - .findbar-container { - padding-bottom: 5px !important; /* Move search bar closer to left edge */ - padding-top: 2px !important; /* Move search bar closer to left edge */ - height: max-content !important; - gap: 2px; - justify-content: space-between; - flex-wrap: wrap; - - /* Force textbox to fill up first line */ - .findbar-textbox { - width: 100% !important; - background: Field !important; /* Set the background color to be consistent with found-matches label when unfocused */ - } - - description { - /* Hide description showing wrap conditions etc. */ - display: none; - /* Show description when it says "Phrase Not Found" */ - &[status=notfound] { display: inline-block } - } - - /* Move found matches label (roughly) into the textbox */ - label.found-matches, - description { - position: absolute; - top: 6.5px; - right: 110px; - color: color-mix(in srgb, -moz-headerbartext, transparent 46%) !important; - /* So this text overrides the text below, TODO find a more elegant solution */ - padding-inline: 1ex; - background: Field; - } - - /* Force checkboxes onto second line */ - hbox { width: 100% } - } -} - - -/* BOOKMARK BAR */ -@-moz-document url(chrome://browser/content/browser.xhtml) { - #PersonalToolbar { - background: -moz-headerbar Field !important; - border-top: 1px solid ThreeDShadow !important; - z-index: 1000; /* To not be affected by shadow from navbar */ - /* Space out bookmark items */ - .bookmark-item .toolbarbutton-text { padding: 2.5px 4px } - } -} |
