2023-01-12 19:34:30 +00:00
|
|
|
# TODO: maybe throw if base.graphics is not enabled?
|
|
|
|
# Though, headless chromium might be possible
|
2022-12-28 02:08:07 +00:00
|
|
|
{
|
2023-06-18 00:46:31 +00:00
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
cfg = config.base.private_chromium;
|
|
|
|
in {
|
2022-12-28 02:08:07 +00:00
|
|
|
options.base.private_chromium = {
|
|
|
|
enable = lib.mkOption {
|
|
|
|
type = lib.types.bool;
|
|
|
|
default = true;
|
|
|
|
example = false;
|
|
|
|
description = ''
|
|
|
|
Enable extremely lightweight chromium with vimium plugin
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
2023-02-04 21:48:08 +00:00
|
|
|
config = lib.mkIf (cfg.enable) {
|
2022-12-28 02:08:07 +00:00
|
|
|
# home.packages = [pkgs.ungoogled-chromium];
|
|
|
|
programs.chromium = {
|
|
|
|
enable = true;
|
|
|
|
package = pkgs.ungoogled-chromium;
|
2023-06-18 00:46:31 +00:00
|
|
|
extensions = let
|
|
|
|
# TODO: how about a chrome extension registry?
|
|
|
|
mkChromiumExtForVersion = browserVersion: {
|
|
|
|
id,
|
|
|
|
sha256,
|
|
|
|
extVersion,
|
|
|
|
...
|
|
|
|
}: {
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
version = extVersion;
|
|
|
|
};
|
|
|
|
mkChromiumExt = mkChromiumExtForVersion (lib.versions.major pkgs.ungoogled-chromium.version);
|
|
|
|
in [
|
|
|
|
# vimium
|
|
|
|
(mkChromiumExt {
|
|
|
|
id = "dbepggeogbaibhgnhhndojpepiihcmeb";
|
|
|
|
sha256 = "00qhbs41gx71q026xaflgwzzridfw1sx3i9yah45cyawv8q7ziic";
|
|
|
|
extVersion = "1.67.4";
|
|
|
|
})
|
|
|
|
];
|
2022-12-28 02:08:07 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|