diff --git a/modules/home/home-browser-helium-sidechery.ulu.nix b/modules/home/home-browser-helium-sidechery.ulu.nix new file mode 100644 index 0000000..6989341 --- /dev/null +++ b/modules/home/home-browser-helium-sidechery.ulu.nix @@ -0,0 +1,100 @@ +{ ... }: +{ + # sidechery "sidebery" ported to chromium for helium built from source and side-loaded. + flake.homeModules.home-browser-helium-sidechery = + { + config, + lib, + pkgs, + inputs, + ... + }: + let + sidechery = pkgs.stdenv.mkDerivation (finalAttrs: { + pname = "sidechery"; + version = (builtins.fromJSON (builtins.readFile "${inputs.sidechery}/package.json")).version; + src = inputs.sidechery; + + pnpmDeps = pkgs.fetchPnpmDeps { + inherit (finalAttrs) pname version src; + pnpm = pkgs.pnpm_10; + fetcherVersion = 4; + hash = "sha256-c05e5Wchb3mq45cHcjjiUCAzi9RrhtKWunYJ7QK30wM="; + }; + + nativeBuildInputs = [ + pkgs.nodejs + pkgs.pnpm_10 + pkgs.pnpmConfigHook + ]; + + buildPhase = '' + runHook preBuild + pnpm run build:chrome + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + cp -r .output/chrome-mv3 $out + runHook postInstall + ''; + }); + + panelColors = [ + "red" + "orange" + "yellow" + "green" + "cyan" + "purple" + "pink" + ]; + + sidechery-styled = pkgs.runCommand "sidechery-styled" { } '' + cp -r ${sidechery} $out + chmod -R u+w $out + cat ${pkgs.writeText "sidechery-extra.css" config.elars.sidechery.extraCss} >> $out/styles/sidebar.css + ''; + in + { + options.elars.sidechery.extraCss = lib.mkOption { + type = lib.types.lines; + default = ""; + description = '' + CSS appended to sidechery's sidebar stylesheet at build time, so + styling doesn't depend on the in-extension styles editor. + ''; + }; + config.xdg.configFile."sidechery/panels.json".text = builtins.toJSON { + ver = sidechery.version; + sidebar = { + panels = lib.genAttrs panelColors (color: { + type = 2; # PanelType.tabs + id = color; + name = color; + inherit color; + iconSVG = "icon_circle"; + }); + nav = panelColors ++ [ + "collapse" + "settings" + "create_snapshot" + ]; + }; + }; + + config.programs.helium = { + extraFlags = [ "--load-extension=${sidechery-styled}" ]; + + preferences = { + helium.browser.layout = 2; + extensions.commands."linux:Ctrl+S" = { + command_name = "_execute_action"; + extension = "napehjbogfncaoogcckddbidjgcapclg"; + global = false; + }; + }; + }; + }; +} diff --git a/modules/home/home-browser-helium.ulu.nix b/modules/home/home-browser-helium.ulu.nix index 1266b7c..aea4656 100644 --- a/modules/home/home-browser-helium.ulu.nix +++ b/modules/home/home-browser-helium.ulu.nix @@ -11,6 +11,10 @@ package = inputs.helium.packages.${system}.helium-widevine; extensions = [ + { + id = "clngdbkpkpeebahjckkjfobafhncgmne"; + hash = "sha256-82toCWp5v/Crf35et50ISOw2Q66ZhJrCx59rhDVTRPk="; + } { id = "dkdnancajokhfclpjpplkhlkbhaeejob"; hash = "sha256-hkEGW2JVQzeRmTpoPrWFoVG3sbCgHohnsr2b12rfeMg="; @@ -57,7 +61,6 @@ preferences = { helium.browser = { - layout = 2; zen_mode = true; zen_mode_sidebar_pinned = true; zen_mode_top_chrome_pinned = true; @@ -65,7 +68,6 @@ minimal_location_bar = true; rounded_frame = false; new_tab_next_to_active = false; - vertical_right_aligned = false; show_back_button = true; show_extensions_button = true; show_media_button = true;