summary refs log tree commit diff
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2017-06-18 04:29:22 +0200
committeraszlig <aszlig@redmoonstudios.org>2017-06-18 06:19:30 +0200
commit7e10ecb763a1a6ce1de15066bcbfb04ab0c2dda1 (patch)
treef72143fd17312f5a117c211e3f99ef4539b54ac2
parent63b8d659f6ab50871416262307e828191a7c2d0d (diff)
downloadnixlib-7e10ecb763a1a6ce1de15066bcbfb04ab0c2dda1.tar
nixlib-7e10ecb763a1a6ce1de15066bcbfb04ab0c2dda1.tar.gz
nixlib-7e10ecb763a1a6ce1de15066bcbfb04ab0c2dda1.tar.bz2
nixlib-7e10ecb763a1a6ce1de15066bcbfb04ab0c2dda1.tar.lz
nixlib-7e10ecb763a1a6ce1de15066bcbfb04ab0c2dda1.tar.xz
nixlib-7e10ecb763a1a6ce1de15066bcbfb04ab0c2dda1.tar.zst
nixlib-7e10ecb763a1a6ce1de15066bcbfb04ab0c2dda1.zip
chromium: Allow to put extensions in system path
This should allow us to easily add system-wide Chromium extensions via a
NixOS configuration similar to this:

{ pkgs, ... }: {
  environment.pathsToLink = [ "/share/chromium/extensions" ];
  environment.systemPackages = [ pkgs.my-shiny-extension ];
}

For more details about what Chromium expects within that directory, see:

https://developer.chrome.com/extensions/external_extensions

I've introduced this because of a personal desire to gain more control
about which extensions are installed and what they are able to do. All
of the extensions I use are free software, but despite that it's useful
to either easily patch them and also prevent unwanted automatic updates.

Tested this using the NixOS "chromium.stable" test on x86_64-linux.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Cc: @offlinehacker because of #21050
-rw-r--r--pkgs/applications/networking/browsers/chromium/common.nix3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkgs/applications/networking/browsers/chromium/common.nix b/pkgs/applications/networking/browsers/chromium/common.nix
index 4b31983322c9..43b6da6bf34e 100644
--- a/pkgs/applications/networking/browsers/chromium/common.nix
+++ b/pkgs/applications/networking/browsers/chromium/common.nix
@@ -132,6 +132,9 @@ let
         :l; n; bl
       }' gpu/config/gpu_control_list.cc
 
+      # Allow to put extensions into the system-path.
+      sed -i -e 's,/usr,/run/current-system/sw,' chrome/common/chrome_paths.cc
+
       patchShebangs .
       # use our own nodejs
       mkdir -p third_party/node/linux/node-linux-x64/bin