diff --git a/home/common/firefox.nix b/home/common/firefox.nix index 887a105..6a933fb 100644 --- a/home/common/firefox.nix +++ b/home/common/firefox.nix @@ -1,67 +1,43 @@ { config, pkgs, ... }: -/*let firefoxWithCcache = ({ useSccache, firefox-unwrapped }: - (firefox-unwrapped.override { - buildMozillaMach = (x: (pkgs.buildMozillaMach (x // { - extraConfigureFlags = x.extraConfigureFlags ++ [ - (if useSccache then "--with-ccache=sccache" else "--with-ccache") - ]; - }))); - }).overrideAttrs (prev: if useSccache then { - nativeBuildInputs = prev.nativeBuildInputs ++ [ pkgs.sccache ]; - SCCACHE_DIR = "/var/cache/sccache"; - SCCACHE_MAX_FRAME_LENGTH = "104857600"; - RUSTC_WRAPPER = "${pkgs.sccache}/bin/sccache"; - } else { - nativeBuildInputs = prev.nativeBuildInputs ++ [ pkgs.ccache ]; - CCACHE_CPP2 = "yes"; - CCACHE_COMPRESS = "1"; - CCACHE_UMASK = "007"; - CCACHE_DIR = "/var/cache/ccache"; - }) -); in*/ - { imports = [ ./gui.nix ]; programs.firefox = { enable = true; - package = - pkgs.wrapFirefox pkgs.librewolf-unwrapped { - inherit (pkgs.librewolf-unwrapped) extraPrefsFiles extraPoliciesFiles; - wmClass = "LibreWolf"; - libName = "librewolf"; - cfg.enableKeePassXC = true; - }; - profiles = { - chayleaf = { - extensions = with config.nur.repos.rycee.firefox-addons; [ - cookies-txt - don-t-fuck-with-paste - greasemonkey - keepassxc-browser - libredirect - localcdn - noscript - privacy-pass - protondb-for-steam - return-youtube-dislikes - rust-search-extension - search-by-image - sponsorblock - steam-database - ublock-origin - unpaywall - vimium-c - youtube-shorts-block - ] ++ (with pkgs.firefox-addons; [ - fastforwardteam - middle-mouse-button-scroll - rikaitan - youtube-nonstop - ]); - }; + package = pkgs.wrapFirefox pkgs.librewolf-unwrapped { + inherit (pkgs.librewolf-unwrapped) extraPrefsFiles extraPoliciesFiles; + wmClass = "LibreWolf"; + libName = "librewolf"; + cfg.enableKeePassXC = true; + }; + profiles.chayleaf = { + extensions = with config.nur.repos.rycee.firefox-addons; [ + cookies-txt + don-t-fuck-with-paste + greasemonkey + keepassxc-browser + libredirect + localcdn + noscript + privacy-pass + protondb-for-steam + return-youtube-dislikes + rust-search-extension + search-by-image + sponsorblock + steam-database + ublock-origin + unpaywall + vimium-c + youtube-shorts-block + ] ++ (with pkgs.firefox-addons; [ + fastforwardteam + middle-mouse-button-scroll + rikaitan + youtube-nonstop + ]); }; }; } diff --git a/pkgs/default.nix b/pkgs/default.nix index c656db9..e8d4c89 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -10,6 +10,24 @@ let inherit (pkgs) fetchgit fetchurl fetchFromGitHub dockerTools; }; nixForNixPlugins = pkgs.nixVersions.nix_2_17; + buildCachedFirefox = useSccache: unwrapped: + (unwrapped.override { + buildMozillaMach = x: pkgs'.buildMozillaMach (x // { + extraConfigureFlags = (x.extraConfigureFlags or []) + ++ lib.toList (if useSccache then "--with-ccache=sccache" else "--with-ccache"); + }); + }).overrideAttrs (prev: if useSccache then { + nativeBuildInputs = (prev.nativeBuildInputs or []) ++ [ pkgs'.sccache ]; + SCCACHE_DIR = "/var/cache/sccache"; + SCCACHE_MAX_FRAME_LENGTH = "104857600"; + RUSTC_WRAPPER = "${pkgs'.sccache}/bin/sccache"; + } else { + nativeBuildInputs = (prev.nativeBuildInputs or []) ++ [ pkgs'.ccache ]; + CCACHE_CPP2 = "yes"; + CCACHE_COMPRESS = "1"; + CCACHE_UMASK = "007"; + CCACHE_DIR = "/var/cache/ccache"; + }); in { @@ -62,6 +80,8 @@ in clang-tools_latest = pkgs.clang-tools_16; clang_latest = pkgs.clang_16; + buildFirefoxWithCcache = buildCachedFirefox false; + buildFirefoxWithSccache = buildCachedFirefox true; /*ghidra = pkgs.ghidra.overrideAttrs (old: { patches = old.patches ++ [ ./ghidra-stdcall.patch ]; });*/ diff --git a/system/hosts/server/home.nix b/system/hosts/server/home.nix index 63c513b..d356bb5 100644 --- a/system/hosts/server/home.nix +++ b/system/hosts/server/home.nix @@ -103,6 +103,8 @@ in { "https://github.com/searxng/searxng/" # required for home config (nvfetcher again) "https://api.github.com/repos/FAForever/" + # for nginx CF-Connecting-IP config generation + "https://www.cloudflare.com/ips-" ]; services.nginx.virtualHosts."binarycache.${cfg.domainName}" = { quic = true;