aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortilpner2020-03-05 16:45:36 +0100
committertilpner2020-03-05 16:45:36 +0100
commitedd25555261c17f74580245b8305cf7edefa4267 (patch)
tree796138422abba300105ac8634fa3fe68bd30252a
downloadfirefox-profiles-edd25555261c17f74580245b8305cf7edefa4267.tar.gz
firefox-profiles-edd25555261c17f74580245b8305cf7edefa4267.tar.xz
firefox-profiles-edd25555261c17f74580245b8305cf7edefa4267.zip
Initial commit
-rw-r--r--examples/policies.json77
-rw-r--r--examples/search-with-qj.json168
-rw-r--r--examples/search-with-qj.json.mozlz4bin0 -> 1457 bytes
-rw-r--r--examples/search.json169
-rw-r--r--examples/search.json.mozlz4bin0 -> 3026 bytes
-rw-r--r--nix/default.nix234
-rw-r--r--nix/lib.nix77
-rw-r--r--nix/mozlz4.nix24
-rw-r--r--nix/search.nix28
-rw-r--r--ublock-config.json84
10 files changed, 861 insertions, 0 deletions
diff --git a/examples/policies.json b/examples/policies.json
new file mode 100644
index 0000000..c0bf28a
--- /dev/null
+++ b/examples/policies.json
@@ -0,0 +1,77 @@
+{
+ "policies": {
+ "CaptivePortal": false,
+ "DisableAppUpdate": true,
+ "DisableFeedbackCommands": true,
+ "DisableFirefoxAccounts": true,
+ "DisableFirefoxStudies": true,
+ "DisableMasterPasswordCreation": true,
+ "DisablePocket": true,
+ "DisableProfileImport": true,
+ "DisableProfileRefresh": true,
+ "DisableSetDesktopBackground": true,
+ "DisableSystemAddonUpdate": true,
+ "DisableTelemetry": true,
+ "DontCheckDefaultBrowser": true,
+ "EnableTrackingProtection": {
+ "Cryptomining": true,
+ "Fingerprinting": true,
+ "Value": true
+ },
+ "ExtensionSettings": {
+ "*": {
+ "installation_mode": "blocked"
+ },
+ "ublock-origin": {
+ "installation_mode": "force_installed"
+ }
+ },
+ "ExtensionUpdate": false,
+ "FirefoxHome": {
+ "Highlights": false,
+ "Pocket": false,
+ "Search": true,
+ "Snippets": false,
+ "TopSites": false
+ },
+ "FlashPlugin": {
+ "Default": false
+ },
+ "NewTabPage": false,
+ "NoDefaultBookmarks": true,
+ "OfferToSaveLogins": false,
+ "PasswordManagerEnabled": false,
+ "Permissions": {
+ "Location": {
+ "BlockNewRequests": true,
+ "Locked": true
+ }
+ },
+ "Preferences": {
+ "browser.cache.disk.enable": false,
+ "browser.search.update": false,
+ "browser.urlbar.suggest.history": true,
+ "browser.urlbar.suggest.openpage": true,
+ "media.gmp-gmpopenh264.enabled": false,
+ "media.gmp-widevinecdm.enabled": false,
+ "network.IDN_show_punycode": false,
+ "places.history.enabled": false,
+ "security.ssl.errorReporting.enabled": false
+ },
+ "RequestedLocales": [
+ "de-DE"
+ ],
+ "SanitizeOnShutdown": {
+ "Cache": true,
+ "Cookies": true,
+ "Downloads": true,
+ "FormData": true,
+ "History": true,
+ "OfflineApps": true,
+ "Sessions": true,
+ "SiteSettings": true
+ },
+ "SearchBar": "separate",
+ "SearchSuggestEnabled": false
+ }
+} \ No newline at end of file
diff --git a/examples/search-with-qj.json b/examples/search-with-qj.json
new file mode 100644
index 0000000..4d7f944
--- /dev/null
+++ b/examples/search-with-qj.json
@@ -0,0 +1,168 @@
+{
+ "version": 1,
+ "buildID": "20200218152453",
+ "appVersion": "73.0.1",
+ "locale": "und",
+ "visibleDefaultEngines": [
+ "{842c8222-5b6d-47bf-b7c8-8a1bc2da3426}",
+ "ddg",
+ "wikipedia"
+ ],
+ "metaData": {
+ "current": "Qwant Junior",
+ "hash": "h6sprAeyxlX/pB7whMweqO2gTV4Yl46SEnp5yf2aDqo="
+ },
+ "engines": [
+ {
+ "_name": "Qwant Junior",
+ "_shortName": "{842c8222-5b6d-47bf-b7c8-8a1bc2da3426}",
+ "_loadPath": "[other]addEngineWithDetails:{842c8222-5b6d-47bf-b7c8-8a1bc2da3426}",
+ "description": "Qwant Junior Extension define qwantjunior.com as your default homepage and search engine.",
+ "__searchForm": "https://www.qwantjunior.com",
+ "_iconURL": "",
+ "_iconMapObj": {
+ "{}": "moz-extension://b858e739-dd41-4b57-b053-5062bf8c4527/favicon.ico"
+ },
+ "_metaData": {
+ "alias": "qj",
+ "order": 4,
+ "loadPathHash": "jTHiliDTnSB+DRoU/4LtqdxF3eLwtoHZLl2s6waAkmw="
+ },
+ "_urls": [
+ {
+ "params": [],
+ "rels": [],
+ "resultDomain": "www.qwantjunior.com",
+ "template": "https://www.qwantjunior.com/?q={searchTerms}&client=ext-firefox-sb"
+ },
+ {
+ "params": [],
+ "rels": [],
+ "resultDomain": "api.qwant.com",
+ "template": "https://api.qwant.com/egp/suggest/?q={searchTerms}&client=opensearch&lang=en_us",
+ "type": "application/x-suggestions+json"
+ }
+ ],
+ "_isBuiltin": true,
+ "queryCharset": "UTF-8",
+ "extensionID": "{842c8222-5b6d-47bf-b7c8-8a1bc2da3426}",
+ "extensionLocale": "default"
+ },
+ {
+ "_name": "DuckDuckGo",
+ "_shortName": "ddg",
+ "_loadPath": "[other]addEngineWithDetails:ddg@search.mozilla.org",
+ "description": "Search DuckDuckGo",
+ "__searchForm": "https://duckduckgo.com/?q={searchTerms}",
+ "_iconURL": "moz-extension://b858e739-dd41-4b57-b053-5062bf8c4527/favicon.ico",
+ "_iconMapObj": {
+ "{}": "moz-extension://b858e739-dd41-4b57-b053-5062bf8c4527/favicon.ico"
+ },
+ "_metaData": {
+ "alias": null,
+ "order": 5
+ },
+ "_urls": [
+ {
+ "params": [
+ {
+ "name": "t",
+ "value": "ffcm",
+ "purpose": "contextmenu"
+ },
+ {
+ "name": "t",
+ "value": "ffab",
+ "purpose": "keyword"
+ },
+ {
+ "name": "t",
+ "value": "ffsb",
+ "purpose": "searchbar"
+ },
+ {
+ "name": "t",
+ "value": "ffhp",
+ "purpose": "homepage"
+ },
+ {
+ "name": "t",
+ "value": "ffnt",
+ "purpose": "newtab"
+ },
+ {
+ "name": "q",
+ "value": "{searchTerms}"
+ }
+ ],
+ "rels": [],
+ "resultDomain": "duckduckgo.com",
+ "template": "https://duckduckgo.com/"
+ },
+ {
+ "params": [
+ {
+ "name": "q",
+ "value": "{searchTerms}"
+ },
+ {
+ "name": "type",
+ "value": "list"
+ }
+ ],
+ "rels": [],
+ "resultDomain": "ac.duckduckgo.com",
+ "template": "https://ac.duckduckgo.com/ac/",
+ "type": "application/x-suggestions+json"
+ }
+ ],
+ "_isBuiltin": true,
+ "queryCharset": "UTF-8",
+ "extensionID": "ddg@search.mozilla.org",
+ "extensionLocale": "default"
+ },
+ {
+ "_name": "Wikipedia (en)",
+ "_shortName": "wikipedia",
+ "_loadPath": "[other]addEngineWithDetails:wikipedia@search.mozilla.org",
+ "description": "Wikipedia, the Free Encyclopedia",
+ "__searchForm": "https://en.wikipedia.org/wiki/Special:Search?search={searchTerms}&sourceid=Mozilla-search",
+ "_iconURL": "moz-extension://00924149-f180-48b5-99ca-1105a254463e/favicon.ico",
+ "_iconMapObj": {
+ "{}": "moz-extension://00924149-f180-48b5-99ca-1105a254463e/favicon.ico"
+ },
+ "_metaData": {
+ "alias": null,
+ "order": 8
+ },
+ "_urls": [
+ {
+ "params": [
+ {
+ "name": "search",
+ "value": "{searchTerms}"
+ },
+ {
+ "name": "sourceid",
+ "value": "Mozilla-search"
+ }
+ ],
+ "rels": [],
+ "resultDomain": "en.wikipedia.org",
+ "template": "https://en.wikipedia.org/wiki/Special:Search"
+ },
+ {
+ "params": [],
+ "rels": [],
+ "resultDomain": "en.wikipedia.org",
+ "template": "https://en.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}",
+ "type": "application/x-suggestions+json"
+ }
+ ],
+ "_isBuiltin": true,
+ "queryCharset": "UTF-8",
+ "extensionID": "wikipedia@search.mozilla.org",
+ "extensionLocale": "default"
+ }
+ ]
+}
diff --git a/examples/search-with-qj.json.mozlz4 b/examples/search-with-qj.json.mozlz4
new file mode 100644
index 0000000..4721b40
--- /dev/null
+++ b/examples/search-with-qj.json.mozlz4
Binary files differ
diff --git a/examples/search.json b/examples/search.json
new file mode 100644
index 0000000..49cd01e
--- /dev/null
+++ b/examples/search.json
@@ -0,0 +1,169 @@
+{
+ "version": 1,
+ "buildID": "20200218152453",
+ "appVersion": "73.0.1",
+ "locale": "und",
+ "visibleDefaultEngines": [
+ "{842c8222-5b6d-47bf-b7c8-8a1bc2da3426}",
+ "ddg",
+ "wikipedia"
+ ],
+ "metaData": {
+ "current": "Qwant Junior",
+ "hash": "h6sprAeyxlX/pB7whMweqO2gTV4Yl46SEnp5yf2aDqo="
+ },
+ "engines": [
+ {
+ "_name": "Qwant Junior",
+ "_shortName": "{842c8222-5b6d-47bf-b7c8-8a1bc2da3426}",
+ "_loadPath": "[other]addEngineWithDetails:{842c8222-5b6d-47bf-b7c8-8a1bc2da3426}",
+ "description": "Qwant Junior Extension define qwantjunior.com as your default homepage and search engine.",
+ "__searchForm": "https://www.qwantjunior.com",
+ "_iconURL": "",
+ "_iconMapObj": {
+ "{}": "moz-extension://36d50491-93ae-4f47-ba46-3d6e00c098e9/img/icon128.png"
+ },
+ "_metaData": {
+ "alias": "qj",
+ "order": 4,
+ "loadPathHash": "jTHiliDTnSB+DRoU/4LtqdxF3eLwtoHZLl2s6waAkmw="
+ },
+ "_urls": [
+ {
+ "params": [],
+ "rels": [],
+ "resultDomain": "www.qwantjunior.com",
+ "template": "https://www.qwantjunior.com/?q={searchTerms}&client=ext-firefox-sb"
+ },
+ {
+ "params": [],
+ "rels": [],
+ "resultDomain": "api.qwant.com",
+ "template": "https://api.qwant.com/egp/suggest/?q={searchTerms}&client=opensearch&lang=en_us",
+ "type": "application/x-suggestions+json"
+ }
+ ],
+ "_isBuiltin": false,
+ "queryCharset": "UTF-8",
+ "_readOnly": false,
+ "extensionID": "{842c8222-5b6d-47bf-b7c8-8a1bc2da3426}",
+ "extensionLocale": "default"
+ },
+ {
+ "_name": "DuckDuckGo",
+ "_shortName": "ddg",
+ "_loadPath": "[other]addEngineWithDetails:ddg@search.mozilla.org",
+ "description": "Search DuckDuckGo",
+ "__searchForm": "https://duckduckgo.com/?q={searchTerms}",
+ "_iconURL": "moz-extension://b858e739-dd41-4b57-b053-5062bf8c4527/favicon.ico",
+ "_iconMapObj": {
+ "{}": "moz-extension://b858e739-dd41-4b57-b053-5062bf8c4527/favicon.ico"
+ },
+ "_metaData": {
+ "alias": null,
+ "order": 5
+ },
+ "_urls": [
+ {
+ "params": [
+ {
+ "name": "t",
+ "value": "ffcm",
+ "purpose": "contextmenu"
+ },
+ {
+ "name": "t",
+ "value": "ffab",
+ "purpose": "keyword"
+ },
+ {
+ "name": "t",
+ "value": "ffsb",
+ "purpose": "searchbar"
+ },
+ {
+ "name": "t",
+ "value": "ffhp",
+ "purpose": "homepage"
+ },
+ {
+ "name": "t",
+ "value": "ffnt",
+ "purpose": "newtab"
+ },
+ {
+ "name": "q",
+ "value": "{searchTerms}"
+ }
+ ],
+ "rels": [],
+ "resultDomain": "duckduckgo.com",
+ "template": "https://duckduckgo.com/"
+ },
+ {
+ "params": [
+ {
+ "name": "q",
+ "value": "{searchTerms}"
+ },
+ {
+ "name": "type",
+ "value": "list"
+ }
+ ],
+ "rels": [],
+ "resultDomain": "ac.duckduckgo.com",
+ "template": "https://ac.duckduckgo.com/ac/",
+ "type": "application/x-suggestions+json"
+ }
+ ],
+ "_isBuiltin": true,
+ "queryCharset": "UTF-8",
+ "extensionID": "ddg@search.mozilla.org",
+ "extensionLocale": "default"
+ },
+ {
+ "_name": "Wikipedia (en)",
+ "_shortName": "wikipedia",
+ "_loadPath": "[other]addEngineWithDetails:wikipedia@search.mozilla.org",
+ "description": "Wikipedia, the Free Encyclopedia",
+ "__searchForm": "https://en.wikipedia.org/wiki/Special:Search?search={searchTerms}&sourceid=Mozilla-search",
+ "_iconURL": "moz-extension://00924149-f180-48b5-99ca-1105a254463e/favicon.ico",
+ "_iconMapObj": {
+ "{}": "moz-extension://00924149-f180-48b5-99ca-1105a254463e/favicon.ico"
+ },
+ "_metaData": {
+ "alias": null,
+ "order": 8
+ },
+ "_urls": [
+ {
+ "params": [
+ {
+ "name": "search",
+ "value": "{searchTerms}"
+ },
+ {
+ "name": "sourceid",
+ "value": "Mozilla-search"
+ }
+ ],
+ "rels": [],
+ "resultDomain": "en.wikipedia.org",
+ "template": "https://en.wikipedia.org/wiki/Special:Search"
+ },
+ {
+ "params": [],
+ "rels": [],
+ "resultDomain": "en.wikipedia.org",
+ "template": "https://en.wikipedia.org/w/api.php?action=opensearch&search={searchTerms}",
+ "type": "application/x-suggestions+json"
+ }
+ ],
+ "_isBuiltin": true,
+ "queryCharset": "UTF-8",
+ "extensionID": "wikipedia@search.mozilla.org",
+ "extensionLocale": "default"
+ }
+ ]
+}
diff --git a/examples/search.json.mozlz4 b/examples/search.json.mozlz4
new file mode 100644
index 0000000..d0da3b0
--- /dev/null
+++ b/examples/search.json.mozlz4
Binary files differ
diff --git a/nix/default.nix b/nix/default.nix
new file mode 100644
index 0000000..b3ac1c2
--- /dev/null
+++ b/nix/default.nix
@@ -0,0 +1,234 @@
+with import <nixpkgs> {};
+
+# http://kb.mozillazine.org/About:config_entries
+# https://www.privacy-handbuch.de/download/moderat/user.js
+
+rec {
+ profiles = callPackage ./lib.nix {};
+ search = callPackage ./search.nix {};
+
+ # Normandy enables Mozilla to push changes to the default settings
+ disableNormandy = {
+ app.normandy = {
+ enabled = false;
+ api_url = "";
+ };
+ };
+
+ disableTelemetry = {
+ toolkit.telemetry = {
+ enabled = false;
+ server = "";
+ unified = false;
+ archive.enabled = false;
+
+ newProfilePing.enabled = false;
+ firstShutdownPing.enabled = false;
+ shutdownPing.enabled = false;
+ updatePing.enabled = false;
+ };
+ };
+
+ disableErrorReporting = {
+ breakpad.reportUrl = "";
+ };
+
+ basic = {
+ network.captive-portal-service.enabled = false;
+
+ # don't update search engines
+ browser.search = {
+ update = false;
+ geoSpecificDefaults = false;
+ "geoSpecificDefaults.url" = "";
+ geoip.url = "";
+ suggest.enabled = false;
+ reset.enabled = false;
+ reset.whitelist = "";
+ };
+
+ # disable studies
+ # https://blog.mozilla.org/firefox/update-looking-glass-add/
+ # https://mozilla.github.io/normandy/user/end_user_interaction.html#opt-out-preference
+ app.shield.optoutstudies.enabled = false;
+
+ # disable pocket
+ extensions.pocket.enabled = false;
+ };
+
+ profile = profiles.profile {
+ preferences = basic;
+ search = search.mkSearchConfig {
+ engines = [ search.engines.qwantjunior ];
+ };
+ };
+
+ bundle = profiles.bundle {
+ # https://github.com/mozilla/policy-templates, about:policies#documentation
+ policies = {
+ BlockAboutAddons = false;
+ BlockAboutConfig = false;
+ BlockAboutProfiles = true;
+
+ CaptivePortal = false;
+
+ DisableMasterPasswordCreation = true;
+ DisableAppUpdate = true;
+ DisableFeedbackCommands = true;
+ DisableFirefoxAccounts = true;
+ DisableFirefoxStudies = true;
+ DisableFormHistory = true;
+ DisablePasswordReveal = true;
+ DisablePocket = true;
+ DisableProfileImport = true;
+ DisableProfileRefresh = true;
+
+ DisableSecurityBypass = {
+ InvalidCertificate = true;
+ SafeBrowsing = false;
+ };
+
+ DisableSystemAddonUpdate = true;
+ DisableTelemetry = true;
+
+ DNSOverHTTPS = {
+ Enabled = false;
+ Locked = true;
+ };
+
+ DontCheckDefaultBrowser = true;
+
+ EnableTrackingProtection = {
+ Cryptomining = true;
+ Fingerprinting = true;
+ Value = true;
+ };
+
+ "3rdparty".Extensions = {
+ # uBlock Origin
+ "uBlock0@raymondhill.net".adminSettings = builtins.readFile ../ublock-config.json;
+ # Privacy Badger
+ "jid1-MnnxcxisBPnSXQ@jetpack" = {
+ showIntroPage = false;
+ };
+ };
+
+ ExtensionSettings =
+ let
+ fetchAddon = args: "file://${pkgs.fetchurl args}";
+ addon = args: {
+ installation_mode = "force_installed";
+ install_url = fetchAddon args;
+ };
+ in {
+ "*" = {
+ blocked_install_message = "Installation von Erweiterungen ist nicht zugelassen.";
+ install_sources = ["https://addons.mozilla.org/"];
+ installation_mode = "blocked";
+ allowed_types = ["extension"];
+ };
+ # Extension IDs as keys, .applications.gecko.id in manifest.json
+ # uBlock Origin
+ "uBlock0@raymondhill.net" = addon {
+ url = "https://addons.mozilla.org/firefox/downloads/file/3509800/ublock_origin-1.25.0-an+fx.xpi";
+ sha256 = "0pyna4c2b2ffh8ifjj4c8ga9b73g37pk432nyinf8majyb1fq6rc";
+ };
+ # Privacy Badger
+ "jid1-MnnxcxisBPnSXQ@jetpack" = addon {
+ url = "https://addons.mozilla.org/firefox/downloads/file/3509922/privacy_badger-2020.2.19-an+fx.xpi";
+ sha256 = "1issggv5wl5x3a4p3q8hrhbkhgsdx9f2qzbscg6y6f75yazswc20";
+ };
+ # NoScript
+ "{73a6fe31-595d-460b-a920-fcc0f8843232}" = addon {
+ url = "https://addons.mozilla.org/firefox/downloads/file/3517653/noscript_security_suite-11.0.15-an+fx.xpi";
+ sha256 = "0gb0a6pp0rj9jpg1094arqvcwxh1rd2m47ijawlidybm29qmyyay";
+ };
+ };
+ ExtensionUpdate = false;
+
+ FlashPlugin.Default = false;
+
+ FirefoxHome = {
+ Search = true;
+ TopSites = false;
+ Highlights = false;
+ Pocket = false;
+ Snippets = false;
+ Locked = true;
+ };
+
+ Homepage.StartPage = "none";
+
+ NewTabPage = false;
+ NoDefaultBookmarks = true;
+ NetworkPrediction = false;
+
+ OfferToSaveLogins = false;
+ OverrideFirstRunPage = "";
+ OverridePostUpdatePage = "";
+
+ PasswordManagerEnabled = false;
+
+ Permissions.Location = {
+ BlockNewRequests = true;
+ Locked = true;
+ };
+
+ Preferences = profiles.flattenAttrs {
+ app.update.auto = false;
+
+ browser = {
+ cache.disk.enable = false;
+ fixup.dns_first_for_single_words = true;
+
+ safebrowsing = {
+ phishing.enabled = false;
+ malware.enabled = false;
+ };
+
+ search.update = false;
+ slowStartup.notificationDisabled = true;
+ };
+
+ dom.event.contextmenu.enabled = false;
+
+ extensions = {
+ blocklist.enabled = false;
+ getAddons.showPane = false;
+ htmlaboutaddons.recommendations.enabled = false;
+ };
+
+ geo.enabled = false;
+
+ media = {
+ eme.enabled = false;
+ gmp-gmpopenh264.enabled = false;
+ gmp-widevinecdm.enabled = false;
+ peerconnection.enabled = false;
+ };
+
+ network.IDN_show_punycode = true;
+
+ security.ssl.errorReporting.enabled = false;
+ };
+
+ Proxy = {
+ Mode = "none";
+ Locked = true;
+ };
+
+ RequestedLocales = [ "de-DE" "en-US" ];
+
+ SanitizeOnShutdown = true;
+
+ SearchBar = "separate";
+ SearchSuggestEnabled = false;
+
+ SearchEngines = {
+ Remove = [ "twitter" "bing" ];
+ };
+ };
+ };
+
+ launcher = profiles.launcher bundle;
+}
diff --git a/nix/lib.nix b/nix/lib.nix
new file mode 100644
index 0000000..df1097f
--- /dev/null
+++ b/nix/lib.nix
@@ -0,0 +1,77 @@
+{ pkgs, lib }:
+
+with lib;
+rec {
+ mozlz4 = pkgs.callPackage ./mozlz4.nix {};
+
+ flattenAttrs = set:
+ let recurse = k: v:
+ if isAttrs v
+ then mapAttrsToList (k': recurse "${k}.${k'}") v
+ else nameValuePair k v;
+ in listToAttrs (flatten (mapAttrsToList recurse set));
+
+ mkValueString = v:
+ if isInt v then toString v
+ else if isString v then "\"${v}\""
+ else if true == v then "true"
+ else if false == v then "false"
+ else abort "unsupported value type: ${builtins.typeOf v}";
+
+ toUserPrefs = settings: pkgs.writeText "user.js"
+ (lib.concatStringsSep "\n"
+ (lib.mapAttrsToList (k: v: "user_pref(\"${k}\", ${mkValueString v});")
+ (flattenAttrs settings)));
+
+ toSearchConfig = settings: pkgs.runCommand "search.json.mozlz4" {} ''
+ ${mozlz4.compress} < ${pkgs.writeText "search.json" (builtins.toJSON settings)} > $out
+ '';
+
+ profile = { preferences, search }: pkgs.runCommand "profile" {} ''
+ mkdir $out
+ ln -s ${toUserPrefs preferences} $out/user.js
+ # ln -s ${toSearchConfig search} $out/search.json.mozlz4
+ cp ${../search-with-qj.json.mozlz4} $out/search.json.mozlz4
+ '';
+
+ mkPolicies = policies: pkgs.writeText "policies.json" (builtins.toJSON {
+ inherit policies;
+ });
+
+ bundle = { policies }:
+ let
+ firefox = pkgs.firefox-unwrapped;
+ patched = pkgs.runCommand "firefox-bundle" {
+ nativeBuildInputs = [ pkgs.nix ];
+ disallowedReferences = [ firefox ];
+ } ''
+ cp -r ${firefox} $out
+ chmod -R +w $out
+ substituteInPlace $out/bin/firefox \
+ --replace ${firefox} $out
+
+ mkdir $out/lib/firefox/distribution
+ cp ${mkPolicies policies} $out/lib/firefox/distribution/policies.json
+ '';
+ wrapped = pkgs.wrapFirefox patched {
+ browserName = "firefox";
+ version = "custom";
+ };
+ in wrapped;
+
+ launcher = firefox: pkgs.writeShellScriptBin "firefox" ''
+ # FF doesn't accept ro profiles, tries to create lockfile
+ TMP_PROFILE="$(mktemp -d)"
+ function finish() {
+ echo deleting profile
+ # rm -rv "$TMP_PROFILE"
+ }
+ trap finish EXIT
+ # cp -r ''${profile} "$TMP_PROFILE"
+ chmod u+rwx -R "$TMP_PROFILE"
+
+ ${firefox}/bin/firefox \
+ --no-remote \
+ --profile "$TMP_PROFILE"
+ '';
+}
diff --git a/nix/mozlz4.nix b/nix/mozlz4.nix
new file mode 100644
index 0000000..1fa0497
--- /dev/null
+++ b/nix/mozlz4.nix
@@ -0,0 +1,24 @@
+{ pkgs, lib }:
+
+let
+ inherit (pkgs.writers) writePython3;
+ inherit (pkgs.python3Packages) lz4;
+in rec {
+ compress = writePython3 "compress.py" { libraries = [ lz4 ]; } ''
+ import sys
+ import lz4.block
+
+ data = lz4.block.compress(sys.stdin.buffer.read())
+ data = b'mozLz40\0' + data
+
+ sys.stdout.buffer.write(data)
+ '';
+
+ decompress = writePython3 "decompress.py" { libraries = [ lz4 ]; } ''
+ import sys
+ import lz4.block
+
+ sys.stdin.buffer.read(8)
+ sys.stdout.buffer.write(lz4.block.decompress(sys.stdin.buffer.read()))
+ '';
+}
diff --git a/nix/search.nix b/nix/search.nix
new file mode 100644
index 0000000..516463a
--- /dev/null
+++ b/nix/search.nix
@@ -0,0 +1,28 @@
+# This tries to create a good-enough search.json.mozlz4 file, but that
+# is unsupported, undocumented, and probably going to break every other release.
+
+{ pkgs, lib }:
+
+with lib;
+rec {
+ mkSearchConfig = engines: {
+ version = 1;
+ buildID = "20200202170918";
+ appVersion = "72.0.2";
+ locale = "und"; # undetermined (?)
+ visibleDefaultEngines = [ "qwant-junior" ];
+
+ metaData.searchDefaultExpir = 1581600883568;
+
+ inherit engines;
+ };
+
+ engines = {
+ qwantjunior = {
+ _name = "Qwant Junior";
+ _shortName = "qwant-junior";
+ _loadPath = "[other]addEngineWithDetails:qwantjunior@search.mozilla.org";
+ description = "Qwant Junior";
+ };
+ };
+}
diff --git a/ublock-config.json b/ublock-config.json
new file mode 100644
index 0000000..67ba236
--- /dev/null
+++ b/ublock-config.json
@@ -0,0 +1,84 @@
+{
+ "timeStamp": 1583409728051,
+ "version": "1.25.0",
+ "userSettings": {
+ "advancedUserEnabled": true,
+ "alwaysDetachLogger": true,
+ "autoUpdate": true,
+ "cloudStorageEnabled": false,
+ "collapseBlocked": true,
+ "colorBlindFriendly": false,
+ "contextMenuEnabled": true,
+ "dynamicFilteringEnabled": true,
+ "externalLists": "",
+ "firewallPaneMinimized": true,
+ "hyperlinkAuditingDisabled": true,
+ "ignoreGenericCosmeticFilters": false,
+ "largeMediaSize": 50,
+ "parseAllABPHideFilters": true,
+ "prefetchingDisabled": true,
+ "requestLogMaxEntries": 1000,
+ "showIconBadge": true,
+ "tooltipsDisabled": false,
+ "webrtcIPAddressHidden": false
+ },
+ "selectedFilterLists": [
+ "user-filters",
+ "easylist",
+ "easyprivacy",
+ "malware-0",
+ "malware-1",
+ "plowe-0"
+ ],
+ "hiddenSettings": {
+ "allowGenericProceduralFilters": false,
+ "assetFetchTimeout": 30,
+ "autoCommentFilterTemplate": "{{date}} {{origin}}",
+ "autoUpdateAssetFetchPeriod": 120,
+ "autoUpdateDelayAfterLaunch": 180,
+ "autoUpdatePeriod": 7,
+ "blockingProfiles": "11111/#F00 11011/#C0F 11001/#00F 00001",
+ "cacheStorageAPI": "unset",
+ "cacheStorageCompression": true,
+ "cacheControlForFirefox1376932": "no-cache, no-store, must-revalidate",
+ "cnameIgnoreList": "unset",
+ "cnameIgnore1stParty": true,
+ "cnameIgnoreExceptions": true,
+ "cnameIgnoreRootDocument": true,
+ "cnameMaxTTL": 120,
+ "cnameReplayFullURL": false,
+ "cnameUncloak": true,
+ "consoleLogLevel": "unset",
+ "debugScriptlets": false,
+ "debugScriptletInjector": false,
+ "disableWebAssembly": false,
+ "extensionUpdateForceReload": false,
+ "ignoreRedirectFilters": false,
+ "ignoreScriptInjectFilters": false,
+ "filterAuthorMode": false,
+ "loggerPopupType": "popup",
+ "manualUpdateAssetFetchPeriod": 500,
+ "popupFontSize": "unset",
+ "requestJournalProcessPeriod": 1000,
+ "selfieAfter": 3,
+ "strictBlockingBypassDuration": 120,
+ "suspendTabsUntilReady": "unset",
+ "uiFlavor": "unset",
+ "updateAssetBypassBrowserCache": false,
+ "userResourcesLocation": "unset"
+ },
+ "whitelist": [
+ "about-scheme",
+ "chrome-extension-scheme",
+ "chrome-scheme",
+ "moz-extension-scheme",
+ "opera-scheme",
+ "vivaldi-scheme",
+ "wyciwyg-scheme"
+ ],
+ "netWhitelist": "about-scheme\nchrome-extension-scheme\nchrome-scheme\nmoz-extension-scheme\nopera-scheme\nvivaldi-scheme\nwyciwyg-scheme",
+ "dynamicFilteringString": "behind-the-scene * * noop\nbehind-the-scene * inline-script noop\nbehind-the-scene * 1p-script noop\nbehind-the-scene * 3p-script noop\nbehind-the-scene * 3p-frame noop\nbehind-the-scene * image noop\nbehind-the-scene * 3p noop",
+ "urlFilteringString": "",
+ "hostnameSwitchesString": "no-large-media: behind-the-scene false",
+ "userFilters": ""
+} \ No newline at end of file