summaryrefslogtreecommitdiffstats
path: root/lass/2configs/firefoxPatched.nix
diff options
context:
space:
mode:
authortv <tv@shackspace.de>2015-10-01 17:19:26 +0200
committertv <tv@shackspace.de>2015-10-01 17:19:26 +0200
commit39d07cad033cf611d6cede6a6e13bdeaf9a6bd74 (patch)
treeb6ecd7f54577a1a422f3b9d96e4e7c645c71a276 /lass/2configs/firefoxPatched.nix
parentcd61f94ba02c485327547ace8cd28a22e38bfe0f (diff)
parente97401da8a402698411b77e88b4a32d388c2ab6f (diff)
Merge remote-tracking branch 'mors/master'
Diffstat (limited to 'lass/2configs/firefoxPatched.nix')
-rw-r--r--lass/2configs/firefoxPatched.nix58
1 files changed, 58 insertions, 0 deletions
diff --git a/lass/2configs/firefoxPatched.nix b/lass/2configs/firefoxPatched.nix
new file mode 100644
index 000000000..daf8a28be
--- /dev/null
+++ b/lass/2configs/firefoxPatched.nix
@@ -0,0 +1,58 @@
+{ config, lib, pkgs, ... }:
+
+let
+ lpkgs = import ../5pkgs { inherit pkgs; };
+
+ inherit (lib)
+ concatMapStrings
+ ;
+
+ plugins = with lpkgs.firefoxPlugins; [
+ noscript
+ ublock
+ vimperator
+ ];
+
+ copyXpi = plugin:
+ "cp ${plugin}/*.xpi $out/usr/lib/firefox-*/browser/extensions/";
+
+ preferences = pkgs.writeText "autoload.js" ''
+ pref('general.config.filename', 'firefox.cfg');
+ pref('general.config.obscure_value', 0);
+ '';
+
+ config = pkgs.writeText "firefox.cfg" ''
+ //
+ lockPref("app.update.enabled", false);
+ lockPref("extensions.update.enabled", false);
+ lockPref("autoadmin.global_config_url", "");
+ lockPref("extensions.checkUpdateSecurity", false);
+ lockPref("services.sync.enabled", false);
+ lockPref("browser.shell.checkDefaultBrowser", false);
+ lockPref("layout.spellcheckDefault", 0);
+ lockPref("app.update.auto", false);
+ lockPref("browser.newtabpage.enabled", false);
+ lockPref("noscript.firstRunRedirection", false);
+ lockPref("noscript.hoverUI", false);
+ lockPref("noscript.notify", false);
+ defaultPref("extensions.newAddons", false);
+ defaultPref("extensions.autoDisableScopes", 0);
+ defaultPref("plugin.scan.plid.all", false);
+ '';
+
+in {
+ environment.systemPackages = [
+ (pkgs.lib.overrideDerivation pkgs.firefox-bin (original : {
+ installPhase = ''
+ ${original.installPhase}
+ find $out/usr/lib
+ ${concatMapStrings copyXpi plugins}
+ cd $out/usr/lib/firefox-*/
+ mkdir -p browser/defaults/preferences
+ cp ${preferences} browser/defaults/preferences/autoload.js
+ cp ${config} ./firefox.cfg
+ '';
+ }))
+ ];
+}
+