diff --git a/home/config/chromium/default.nix b/home/config/chromium/default.nix new file mode 100644 index 00000000..14e2d355 --- /dev/null +++ b/home/config/chromium/default.nix @@ -0,0 +1,79 @@ +{ pkgs, ... }: +{ + file = (pkgs.formats.json { }).generate "ChromiumConfig" { + bookmark_bar.show_on_all_tabs = false; + browser.show_home_button = false; + default_apps_install_state = 2; + default_search_provider = { + guid = "5761b040-db50-4f8e-9d00-c9ad985779a4"; + synced_guid = "5761b040-db50-4f8e-9d00-c9ad985779a4"; + }; + default_search_provider_data = { + template_url_data = { + id = 11; + is_active = 1; + keyword = "s"; + short_name = "SearX"; + synced_guid = "5761b040-db50-4f8e-9d00-c9ad985779a4"; + url = "https://search.voronind.com/search?q={searchTerms}"; + }; + }; + download.prompt_for_download = false; + download_bubble.partial_view_enabled = false; + extensions = { + alerts.initialized = false; + commands = { + "linux:Alt+Shift+L" = { + command_name = "addSite"; + extension = "eimadpbcbfnmbkopoojfekhnkhdbieeh"; + global = false; + }; + "linux:Alt+Shift+B" = { + command_name = "_execute_browser_action"; + extension = "cgbcahbpdhpcegmbfconppldiemgcoii"; + global = false; + }; + "linux:Alt+Shift+K" = { + command_name = "launch-element-zapper"; + extension = "cgbcahbpdhpcegmbfconppldiemgcoii"; + global = false; + }; + "linux:Alt+Shift+J" = { + command_name = "toggle-javascript"; + extension = "cgbcahbpdhpcegmbfconppldiemgcoii"; + global = false; + }; + "linux:Alt+Shift+P" = { + command_name = "_execute_action"; + extension = "gcknhkkoolaabfmlnjonogaaifnjlfnp"; + global = false; + }; + }; + }; + intl.selected_languages = "en-US,en"; + password_manager = { + autofillable_credentials_account_store_login_database = false; + autofillable_credentials_profile_store_login_database = false; + }; + name = "Work"; + session.restore_on_startup = 1; + side_panel.is_right_aligned = false; + webkit = { + webprefs = { + default_fixed_font_size = 14; + default_font_size = 17; + minimum_font_size = 16; + fonts = let + mono = "Terminess Nerd Font Mono"; + sans = "SF Pro"; + in + { + fixed.Zyyy = mono; + sansserif.Zyyy = sans; + serif.Zyyy = sans; + standard.Zyyy = sans; + }; + }; + }; + }; +} diff --git a/home/config/default.nix b/home/config/default.nix index 8b835796..e6e963fa 100644 --- a/home/config/default.nix +++ b/home/config/default.nix @@ -6,6 +6,7 @@ }@args: let btop = import ./btop args; + chromium = import ./chromium args; editor = import ./editorconfig args; foot = import ./foot args; fuzzel = import ./fuzzel args; @@ -28,6 +29,7 @@ in ".config/MangoHud/MangoHud.conf".source = mangohud.config; ".config/MangoHud/presets.conf".source = mangohud.presets; ".config/btop/btop.conf".text = btop.text; + ".config/chromium/Default/Preferences".source = chromium.file; ".config/foot/foot.ini".source = foot.file; ".config/fuzzel/fuzzel.ini".source = fuzzel.file; ".config/gtk-3.0/bookmarks".text = gtk3.bookmarks; @@ -48,10 +50,10 @@ in ".ideavimrc".text = jetbrains.ideavimrc; ".nix".source = self; ".nixpkgs".source = inputs.nixpkgs; - # TODO: Add after migrating to stable. - # ".nixpkgs_unstable".source = inputs.nixpkgs; - # ".nixpkgs_master".source = inputs.nixpkgs; ".parallel/will-cite".text = ""; ".ssh/config".text = ssh.text; ".template".source = ./template; + # ".nixpkgs_master".source = inputs.nixpkgs; + # ".nixpkgs_unstable".source = inputs.nixpkgs; + # TODO: Add after migrating to stable. } diff --git a/home/config/keyd/module/Chromium.nix b/home/config/keyd/module/Chromium.nix new file mode 100644 index 00000000..bbee7352 --- /dev/null +++ b/home/config/keyd/module/Chromium.nix @@ -0,0 +1,29 @@ +{ pkgs, ... }: +{ + file = (pkgs.formats.ini { }).generate "KeydChromiumConfig" { + "chromium-browser" = { + "alt.capslock" = "C-t"; # New tab. + "alt.x" = "C-w"; # Close tab. + "alt.u" = "C-S-t"; # Restore closed tab. + "alt.q" = "C-pageup"; # Prev tab. + "alt.e" = "C-pagedown"; # Next tab. + "alt.Q" = "C-S-pageup"; # Move tab left. + "alt.E" = "C-S-pagedown"; # Move tab right. + "alt.a" = "A-left"; # Go back. + "alt.d" = "A-right"; # Go forward. + "alt.s" = "down"; # Scroll down. + "alt.w" = "up"; # Scroll up. + "alt.f" = "C-f"; # Find text. + "alt.N" = "S-f3"; # Find prev. + "alt.n" = "f3"; # Find next. + "alt.space" = "f6"; # Focus address bar. + "alt.r" = "C-f5"; # Full refresh. + "alt.l" = "A-S-l"; # Toggle dark mode. + "alt.enter" = "C-S-l"; # Fill password. + "alt.p" = "A-S-p"; # Toggle proxy. + "alt.j" = "A-S-j"; # Toggle js. + "alt.k" = "A-S-k"; # Block element. + "alt.b" = "A-S-b"; # Show uBlock. + }; + }; +} diff --git a/home/config/keyd/module/Firefox.nix b/home/config/keyd/module/Firefox.nix index edb8217e..92fb38ec 100644 --- a/home/config/keyd/module/Firefox.nix +++ b/home/config/keyd/module/Firefox.nix @@ -19,7 +19,7 @@ "alt.space" = "f6"; # Focus address bar. "alt.r" = "C-f5"; # Full refresh. "alt.l" = "A-S-a"; # Toggle dark mode. - "alt.p" = "C-S-l"; # Fill password. + "alt.enter" = "C-S-l"; # Fill password. }; }; } diff --git a/home/program/chromium/default.nix b/home/program/chromium/default.nix new file mode 100644 index 00000000..cfea0262 --- /dev/null +++ b/home/program/chromium/default.nix @@ -0,0 +1,67 @@ +{ pkgs, lib, ... }: +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"; + }; + }; + 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 +{ + enable = true; + inherit extensions package; + dictionaries = with pkgs.hunspellDictsChromium; [ en_US ]; + commandLineArgs = [ + # Disable animations. + "--wm-window-animations-disabled" + "--animation-duration-scale=0" + ]; +} diff --git a/home/program/default.nix b/home/program/default.nix index a3937cdf..713aa259 100644 --- a/home/program/default.nix +++ b/home/program/default.nix @@ -28,6 +28,7 @@ in }; desktop = { + chromium = import ./chromium args; firefox = import ./firefox args; }; } diff --git a/package/default.nix b/package/default.nix index 7615f7e2..c310a3f4 100644 --- a/package/default.nix +++ b/package/default.nix @@ -98,7 +98,6 @@ common = with pkgs; [ evince # Document viewer. - ungoogled-chromium # Just in case I ever need it. gimp # Image manipulation program. gnome-calculator # Calculator. gparted # GUI disk utility just in case.