diff --git a/home/config/chromium/default.nix b/home/config/chromium/default.nix index f512d6e..b945b10 100644 --- a/home/config/chromium/default.nix +++ b/home/config/chromium/default.nix @@ -63,26 +63,27 @@ default_fixed_font_size = 14; default_font_size = 17; minimum_font_size = 16; - fonts = let - mono = config.style.font.monospace.name; - sans = config.style.font.sansSerif.name; - in - { - fixed.Zyyy = mono; - sansserif.Zyyy = sans; - serif.Zyyy = sans; - standard.Zyyy = sans; - }; + fonts = + let + mono = config.style.font.monospace.name; + sans = config.style.font.sansSerif.name; + in + { + fixed.Zyyy = mono; + sansserif.Zyyy = sans; + serif.Zyyy = sans; + standard.Zyyy = sans; + }; }; }; }; localState = (pkgs.formats.json { }).generate "ChromiumLocalState" { browser = { - enabled_labs_experiments = [ - "smooth-scrolling@2" - ]; + enabled_labs_experiments = [ "smooth-scrolling@2" ]; first_run_finished = true; }; }; + + policy = (pkgs.formats.json { }).generate "ChromiumPolicy" { URLBlocklist = [ "darkreader.org" ]; }; } diff --git a/home/program/chromium/default.nix b/home/program/chromium/default.nix index cfea026..9252ba2 100644 --- a/home/program/chromium/default.nix +++ b/home/program/chromium/default.nix @@ -2,58 +2,70 @@ let package = pkgs.ungoogled-chromium; browserVersion = lib.versions.major package.version; - extensions = let - fetchFromStore = { id, sha256, version }: - { - inherit id version; - crxPath = pkgs.fetchurl { - inherit sha256; - 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"; + extensions = + let + fetchFromStore = + { + id, + sha256, + version, + }: + { + inherit id version; + crxPath = pkgs.fetchurl { + inherit sha256; + 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"; + }; }; - }; - fetchFromUrl = { id, url, sha256, version }: - { - inherit id version; - crxPath = pkgs.fetchurl { - inherit sha256 url; - name = "${id}.crx"; + fetchFromUrl = + { + id, + url, + sha256, + version, + }: + { + inherit id version; + crxPath = pkgs.fetchurl { + inherit sha256 url; + name = "${id}.crx"; + }; }; - }; - in - [ - (fetchFromStore { - # uBlock Origin dev. - id = "cgbcahbpdhpcegmbfconppldiemgcoii"; - sha256 = "sha256-sTE96l7/B3n4rJHYC0p4hCVmXUMYj/6O6+596DFIK58="; - version = "1.60.1.16"; - }) - (fetchFromStore { - # Dark reader. - id = "eimadpbcbfnmbkopoojfekhnkhdbieeh"; - sha256 = "sha256-98sGCo2dG+XYMzBeLR+10Ic5DLjDXhSh1DzatLOCyQQ="; - version = "4.9.95"; - }) - (fetchFromStore { - # Foxy Proxy. - id = "gcknhkkoolaabfmlnjonogaaifnjlfnp"; - sha256 = "sha256-Zm7x/467CaGcEN+cYwf8XowpaZRJQIzIEY/F6NhJ3pA="; - version = "8.9"; - }) - (fetchFromStore { - # Vimium. - id = "dbepggeogbaibhgnhhndojpepiihcmeb"; - sha256 = "sha256-DaEM1NyMX8RMBvWoIVOhmfY/ae66HCNfRFnwAuLUHVU="; - version = "2.1.2"; - }) - # (fetchFromUrl rec { - # # Ext updater. - # id = "ocaahdebbfolfmndjeplogmgcagdmblk"; - # url = "https://github.com/NeverDecaf/chromium-web-store/releases/download/v${version}/Chromium.Web.Store.crx"; - # sha256 = "sha256-gKAcrvnxLh9gMraTFX4zRsUua4OI+lak51gpII29d8g="; - # version = "1.5.4.3"; - # }) - ]; + in + [ + (fetchFromStore { + # uBlock Origin dev. + id = "cgbcahbpdhpcegmbfconppldiemgcoii"; + sha256 = "sha256-sTE96l7/B3n4rJHYC0p4hCVmXUMYj/6O6+596DFIK58="; + version = "1.60.1.16"; + }) + (fetchFromStore { + # Dark reader. + id = "eimadpbcbfnmbkopoojfekhnkhdbieeh"; + sha256 = "sha256-98sGCo2dG+XYMzBeLR+10Ic5DLjDXhSh1DzatLOCyQQ="; + version = "4.9.95"; + }) + (fetchFromStore { + # Foxy Proxy. + id = "gcknhkkoolaabfmlnjonogaaifnjlfnp"; + sha256 = "sha256-Zm7x/467CaGcEN+cYwf8XowpaZRJQIzIEY/F6NhJ3pA="; + version = "8.9"; + }) + (fetchFromStore { + # Vimium. + id = "dbepggeogbaibhgnhhndojpepiihcmeb"; + sha256 = "sha256-DaEM1NyMX8RMBvWoIVOhmfY/ae66HCNfRFnwAuLUHVU="; + version = "2.1.2"; + }) + # (fetchFromUrl rec { + # # Ext updater. + # id = "ocaahdebbfolfmndjeplogmgcagdmblk"; + # url = "https://github.com/NeverDecaf/chromium-web-store/releases/download/v${version}/Chromium.Web.Store.crx"; + # sha256 = "sha256-gKAcrvnxLh9gMraTFX4zRsUua4OI+lak51gpII29d8g="; + # version = "1.5.4.3"; + # }) + ]; in { enable = true; diff --git a/module/Package.nix b/module/Package.nix index 63cb71f..9e2af76 100644 --- a/module/Package.nix +++ b/module/Package.nix @@ -57,6 +57,16 @@ in }; services.gvfs.enable = true; + + # Chromium config. + environment.etc = + let + chromium = import args; + in + { + "chromium/initial_preferences".source = lib.mkForce chromium.preferences; + "chromium/policies/managed/extra.json".source = lib.mkForce chromium.policy; + }; }) # Desktop apps. diff --git a/package/default.nix b/package/default.nix index c310a3f..88edbbb 100644 --- a/package/default.nix +++ b/package/default.nix @@ -123,7 +123,7 @@ ]; creative = with pkgs; [ - aseprite # Pixel Art draw app. WARNING: Always builds from source. + libresprite # Pixel Art draw app. blender-hip # Blender with HiP support. krita # Draw! ];