Chromium: Use policies.

This commit is contained in:
Dmitry Voronin 2024-10-29 00:15:58 +03:00
parent d3618b3320
commit 3df3e1ebbf
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
4 changed files with 87 additions and 64 deletions

View file

@ -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" ]; };
}

View file

@ -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;

View file

@ -57,6 +57,16 @@ in
};
services.gvfs.enable = true;
# Chromium config.
environment.etc =
let
chromium = import <home/config/chromium> args;
in
{
"chromium/initial_preferences".source = lib.mkForce chromium.preferences;
"chromium/policies/managed/extra.json".source = lib.mkForce chromium.policy;
};
})
# Desktop apps.

View file

@ -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!
];