From dc95eb510f5254a2457f6a70ac4a9e2c4f02ae6c Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Fri, 7 Mar 2025 18:43:11 -0500 Subject: [PATCH 1/3] wip: broken build chromium is enabled however --- home/browser.nix | 55 ++++++++++++++++++++++++++++++++++++++++- home/default.nix | 1 + home/packages/linux.nix | 1 + 3 files changed, 56 insertions(+), 1 deletion(-) diff --git a/home/browser.nix b/home/browser.nix index 68dc3dd..ef0b60d 100644 --- a/home/browser.nix +++ b/home/browser.nix @@ -1,5 +1,58 @@ -{pkgs, ...}: { +{ + pkgs, + lib, + ... +}: let + package = pkgs.ungoogled-chromium; + createChromiumExtensionFor = browserVersion: { + id, + sha256, + version, + }: { + inherit id; + crxPath = builtins.fetchurl { + url = "https://clients2.google.com/service/update2/crx?response=redirect&acceptformat=crx2,crx3&prodversion=${browserVersion}&x=id%3D${id}%26installsource%3Dondemand%26uc"; + name = "${id}.crx"; + inherit sha256; + }; + inherit version; + }; + createChromiumExtension = createChromiumExtensionFor (lib.versions.major package.version); + extensions = [ + (createChromiumExtension { + # ublock origin + id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; + sha256 = "sha256-u81DNkZw/LBVyjk5nmrrJEVjdc+GFCay+rQZGpDH3jA="; + version = "1.37.2"; + }) + (createChromiumExtension { + # dark reader + id = "eimadpbcbfnmbkopoojfekhnkhdbieeh"; + sha256 = "sha256-JcM2Ki3cTWdskFEFs2jk6LQUTFOojkBf+6HqO1GPK90="; + version = "4.9.34"; + }) + ]; +in { programs.firefox = { enable = pkgs.stdenv.isLinux; }; + + programs.chromium = { + enable = pkgs.stdenv.isLinux; + package = package; + enableWidevine = true; + inherit extensions; + + extraOpts = { + ExtensionSettings = builtins.listToAttrs (map + (extension: { + name = extension.id; + value = { + installation_mode = "force_installed"; + update_url = "https://clients2.google.com/service/update2/crx"; + }; + }) + extensions); + }; + }; } diff --git a/home/default.nix b/home/default.nix index 851d96f..a455b83 100644 --- a/home/default.nix +++ b/home/default.nix @@ -23,6 +23,7 @@ in { ./direnv.nix ./sway.nix ./terminal.nix + ./browser.nix ]; # Home Manager needs a bit of information about you and the diff --git a/home/packages/linux.nix b/home/packages/linux.nix index a643ade..e26def3 100644 --- a/home/packages/linux.nix +++ b/home/packages/linux.nix @@ -11,5 +11,6 @@ mcrcon xfce.thunar pavucontrol + # ungoogled-chromium ]); } -- 2.47.1 From cf6aab28978f5cba4a67a014c78ae95a5651a48c Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Sat, 8 Mar 2025 20:37:03 -0500 Subject: [PATCH 2/3] working build of chromium --- home/browser.nix | 74 ++++++++++++++++++------------------------------ 1 file changed, 27 insertions(+), 47 deletions(-) diff --git a/home/browser.nix b/home/browser.nix index ef0b60d..90152de 100644 --- a/home/browser.nix +++ b/home/browser.nix @@ -2,57 +2,37 @@ pkgs, lib, ... -}: let - package = pkgs.ungoogled-chromium; - createChromiumExtensionFor = browserVersion: { - id, - sha256, - version, - }: { - inherit id; - crxPath = builtins.fetchurl { - url = "https://clients2.google.com/service/update2/crx?response=redirect&acceptformat=crx2,crx3&prodversion=${browserVersion}&x=id%3D${id}%26installsource%3Dondemand%26uc"; - name = "${id}.crx"; - inherit sha256; - }; - inherit version; - }; - createChromiumExtension = createChromiumExtensionFor (lib.versions.major package.version); - extensions = [ - (createChromiumExtension { - # ublock origin - id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; - sha256 = "sha256-u81DNkZw/LBVyjk5nmrrJEVjdc+GFCay+rQZGpDH3jA="; - version = "1.37.2"; - }) - (createChromiumExtension { - # dark reader - id = "eimadpbcbfnmbkopoojfekhnkhdbieeh"; - sha256 = "sha256-JcM2Ki3cTWdskFEFs2jk6LQUTFOojkBf+6HqO1GPK90="; - version = "4.9.34"; - }) - ]; -in { +}: { programs.firefox = { - enable = pkgs.stdenv.isLinux; + # please see Mozilla's TOU and privacy policy please i implore you + enable = false; }; programs.chromium = { enable = pkgs.stdenv.isLinux; - package = package; - enableWidevine = true; - inherit extensions; - - extraOpts = { - ExtensionSettings = builtins.listToAttrs (map - (extension: { - name = extension.id; - value = { - installation_mode = "force_installed"; - update_url = "https://clients2.google.com/service/update2/crx"; - }; - }) - extensions); - }; + package = pkgs.ungoogled-chromium; + extensions = let + createChromiumExtensionFor = browserVersion: { + id, + sha256, + version, + }: { + inherit id; + crxPath = builtins.fetchurl { + url = "https://clients2.google.com/service/update2/crx?response=redirect&acceptformat=crx2,crx3&prodversion=${browserVersion}&x=id%3D${id}%26installsource%3Dondemand%26uc"; + name = "${id}.crx"; + inherit sha256; + }; + inherit version; + }; + createChromiumExtension = createChromiumExtensionFor (lib.versions.major pkgs.ungoogled-chromium.version); + in [ + (createChromiumExtension { + # ublock origin + id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; + sha256 = "sha256:0ycnkna72n969crgxfy2lc1qbndjqrj46b9gr5l9b7pgfxi5q0ll"; + version = "1.62.0"; + }) + ]; }; } -- 2.47.1 From 31970f4a712d8a3568b0adea51d6ef6e0ab5a8b4 Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Sat, 8 Mar 2025 23:27:58 -0500 Subject: [PATCH 3/3] added environment variable, added extra brower flags --- home/browser.nix | 10 +++++++++- home/default.nix | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/home/browser.nix b/home/browser.nix index 90152de..649b903 100644 --- a/home/browser.nix +++ b/home/browser.nix @@ -10,7 +10,15 @@ programs.chromium = { enable = pkgs.stdenv.isLinux; - package = pkgs.ungoogled-chromium; + package = pkgs.ungoogled-chromium.override { + enableWideVine = true; + commandLineArgs = [ + "--enable-features=AcceleratedVideoEncoder,VaapiVideoDecodeLinuxGL,VaapiVideoEncoder,Vulkan,VulkanFromANGLE,DefaultANGLEVulkan,VaapiIgnoreDriverChecks,VaapiVideoDecoder,PlatformHEVCDecoderSupport,UseMultiPlaneFormatForHardwareVideo" + "--ignore-gpu-blocklist" + "--force-dark-mode" + "--enable-zero-copy" + ]; + }; extensions = let createChromiumExtensionFor = browserVersion: { id, diff --git a/home/default.nix b/home/default.nix index a455b83..872f13f 100644 --- a/home/default.nix +++ b/home/default.nix @@ -42,6 +42,7 @@ in { XDG_CACHE_HOME = "$HOME/.cache"; XDG_DATA_HOME = "$HOME/.local/share"; XDG_STATE_HOME = "$HOME/.local/state"; + NIXOS_OZONE_WL = "1"; }; pointerCursor = lib.mkIf pkgs.stdenv.isLinux { -- 2.47.1