diff --git a/home/browser.nix b/home/browser.nix index 68dc3dd..649b903 100644 --- a/home/browser.nix +++ b/home/browser.nix @@ -1,5 +1,46 @@ -{pkgs, ...}: { +{ + pkgs, + lib, + ... +}: { programs.firefox = { + # please see Mozilla's TOU and privacy policy please i implore you + enable = false; + }; + + programs.chromium = { enable = pkgs.stdenv.isLinux; + 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, + 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"; + }) + ]; }; } diff --git a/home/default.nix b/home/default.nix index 851d96f..872f13f 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 @@ -41,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 { 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 ]); }