forked from aylac.top/nixcfg
this repo has no description

chromium fucking sucks

Changed files
+156 -11
modules
home
programs
chromium
snippets
firefox-based
+137 -11
modules/home/programs/chromium/default.nix
···
+
# https://github.com/isabelroses/dotfiles/blob/ed6d3765ffb7dcfe67540f111f23d51a0d9617d5/modules/home/programs/chromium.nix#L16
{
config,
lib,
pkgs,
...
-
}: {
+
}: let
+
inherit
+
(lib)
+
concatLists
+
concatMapStrings
+
enableFeature
+
;
+
in {
options.myHome.programs.chromium.enable = lib.mkEnableOption "chromium web browser";
config = lib.mkIf config.myHome.programs.chromium.enable {
···
extensions = [
{id = "ddkjiahejlhfcafbddmgiahcphecmpfh";} # ublock origin lite
-
{id = "cjpalhdlnbpafiamejdnhcphjbkeiagm";} # ublock origin
{id = "mdjildafknihdffpkfmmpnpoiajfjnjd";} # consent-o-matic
{id = "clngdbkpkpeebahjckkjfobafhncgmne";} # stylus
{id = "oboonakemofpalcgghocfoadofidjkkk";} # keepassxc
···
}
];
-
package =
-
if pkgs.stdenv.isDarwin
-
then (pkgs.runCommand "chromium-0.0.0" {} "mkdir $out")
-
# else pkgs.chromium;
-
else pkgs.ungoogled-chromium;
+
package = pkgs.chromium.override {
+
enableWideVine = true;
+
+
# https://github.com/secureblue/hardened-chromium
+
# https://github.com/secureblue/secureblue/blob/e500f078efc5748d5033a881bbbcdcd2de95a813/files/system/usr/etc/chromium/chromium.conf.md
+
commandLineArgs = concatLists [
+
# Aesthetics
+
[
+
"--gtk-version=4"
+
]
-
commandLineArgs = lib.mkIf pkgs.stdenv.isLinux [
-
"--enable-features=TouchpadOverscrollHistoryNavigation"
-
"--gtk-version=4"
-
];
+
# Performance
+
[
+
(enableFeature true "gpu-rasterization")
+
(enableFeature true "oop-rasterization")
+
(enableFeature true "zero-copy")
+
"--ignore-gpu-blocklist"
+
]
+
+
# Wayland
+
[
+
"--ozone-platform=wayland"
+
"--enable-features=UseOzonePlatform"
+
]
+
+
# Etc
+
[
+
"--disk-cache=$XDG_RUNTIME_DIR/chromium-cache"
+
(enableFeature false "reading-from-canvas")
+
"--no-first-run"
+
"--disable-wake-on-wifi"
+
"--disable-breakpad"
+
+
# please stop asking me to be the default browser
+
"--no-default-browser-check"
+
+
# I don't need these, thus I disable them
+
(enableFeature false "speech-api")
+
(enableFeature false "speech-synthesis-api")
+
]
+
+
# Security
+
[
+
# Use strict extension verification
+
"--extension-content-verification=enforce_strict"
+
"--extensions-install-verification=enforce_strict"
+
# Disable pings
+
"--no-pings"
+
# Require HTTPS for component updater
+
"--component-updater=require_encryption"
+
# Disable crash upload
+
"--no-crash-upload"
+
# don't run things without asking
+
"--no-service-autorun"
+
# Disable sync
+
"--disable-sync"
+
+
(
+
"--enable-features="
+
+ concatMapStrings (x: x + ",") [
+
# Enable visited link database partitioning
+
"PartitionVisitedLinkDatabase"
+
# Enable prefetch privacy changes
+
"PrefetchPrivacyChanges"
+
# Enable split cache
+
"SplitCacheByNetworkIsolationKey"
+
"SplitCodeCacheByNetworkIsolationKey"
+
# Enable partitioning connections
+
"EnableCrossSiteFlagNetworkIsolationKey"
+
"HttpCacheKeyingExperimentControlGroup"
+
"PartitionConnectionsByNetworkIsolationKey"
+
# Enable strict origin isolation
+
"StrictOriginIsolation"
+
# Enable reduce accept language header
+
"ReduceAcceptLanguage"
+
# Enable content settings partitioning
+
"ContentSettingsPartitioning"
+
# i like moving pages with my touchpad...
+
"TouchpadOverscrollHistoryNavigation"
+
]
+
)
+
+
(
+
"--disable-features="
+
+ concatMapStrings (x: x + ",") [
+
# Disable autofill
+
"AutofillPaymentCardBenefits"
+
"AutofillPaymentCvcStorage"
+
"AutofillPaymentCardBenefits"
+
# Disable third-party cookie deprecation bypasses
+
"TpcdHeuristicsGrants"
+
"TpcdMetadataGrants"
+
# Disable hyperlink auditing
+
"EnableHyperlinkAuditing"
+
# Disable showing popular sites
+
"NTPPopularSitesBakedInContent"
+
"UsePopularSitesSuggestions"
+
# Disable article suggestions
+
"EnableSnippets"
+
"ArticlesListVisible"
+
"EnableSnippetsByDse"
+
# Disable content feed suggestions
+
"InterestFeedV2"
+
# Disable media DRM preprovisioning
+
"MediaDrmPreprovisioning"
+
# Disable autofill server communication
+
"AutofillServerCommunication"
+
# Disable new privacy sandbox features
+
"PrivacySandboxSettings4"
+
"BrowsingTopics"
+
"BrowsingTopicsDocumentAPI"
+
"BrowsingTopicsParameters"
+
# Disable translate button
+
"AdaptiveButtonInTopToolbarTranslate"
+
# Disable detailed language settings
+
"DetailedLanguageSettings"
+
# Disable fetching optimization guides
+
"OptimizationHintsFetching"
+
# Partition third-party storage
+
"DisableThirdPartyStoragePartitioningDeprecationTrial2"
+
+
# Disable media engagement
+
"PreloadMediaEngagementData"
+
"MediaEngagementBypassAutoplayPolicies"
+
]
+
)
+
]
+
];
+
};
};
};
}
+1
modules/home/snippets/firefox-based/default.nix
···
order = [
"Unduck"
+
"Brave"
"Home Manager Options"
"NixOS Wiki"
"nixpkgs"
+18
modules/home/snippets/firefox-based/engines.nix
···
];
};
+
"Brave" = {
+
definedAliases = ["!brave"];
+
icon = "https://cdn.search.brave.com/serp/v2/_app/immutable/assets/brave-search-icon.CsIFM2aN.svg";
+
updateInterval = 24 * 60 * 60 * 1000; # every day
+
+
urls = [
+
{
+
template = "https://search.brave.com/search";
+
params = [
+
{
+
name = "q";
+
value = "{searchTerms}";
+
}
+
];
+
}
+
];
+
};
+
"Home Manager Options" = {
icon = "https://home-manager-options.extranix.com/images/favicon.png";
definedAliases = ["!hm"];