firefox policy schema patching

This commit is contained in:
Grimmauld 2025-02-24 01:32:21 +01:00
parent 8dde2866ec
commit 8cfd81c825
No known key found for this signature in database
7 changed files with 109 additions and 7 deletions

View file

@ -73,6 +73,55 @@ in
OverrideFirstRunPage = ""; OverrideFirstRunPage = "";
OverridePostUpdatePage = ""; OverridePostUpdatePage = "";
DontCheckDefaultBrowser = true; DontCheckDefaultBrowser = true;
FirefoxHome = {
TopSites = true;
SponsoredTopSites = false;
Pocket = false;
Snippets = false;
Highlights = false;
Locked = true;
};
FirefoxSuggest = {
WebSuggestions = false;
SponsoredSuggestions = false;
ImproveSuggest = false;
Locked = true;
};
SearchEngines = {
# Default = "DuckDuckGo";
Remove = ["Bing" "Amazon.ca" "eBay"];
Add = [
{
Name = "Nix Package Search";
URLTemplate = "https://search.nixos.org/packages?channel=unstable&query={searchTerms}";
IconURL = "https://github.com/NixOS/nixos-artwork/raw/refs/heads/master/logo/nix-snowflake-white.svg";
Alias = "np";
}
{
Name = "NixOS Option Search";
URLTemplate = "https://search.nixos.org/options?channel=unstable&query={searchTerms}";
IconURL = "https://github.com/NixOS/nixos-artwork/raw/refs/heads/master/logo/nix-snowflake-white.svg";
Alias = "no";
}
{
Name = "NixOS Wiki";
URLTemplate = "https://nixos.wiki/index.php?search={searchTerms}";
IconURL = "https://github.com/NixOS/nixos-artwork/raw/refs/heads/master/logo/nix-snowflake-white.svg";
Alias = "nw";
}
{
Name = "Home Manager Option Search";
URLTemplate = "https://mipmip.github.io/home-manager-option-search?query={searchTerms}";
IconURL = "https://github.com/NixOS/nixos-artwork/raw/refs/heads/master/logo/nix-snowflake-white.svg";
Alias = "hm";
}
];
};
Preferences = { Preferences = {
"pdfjs.enableScripting" = false; "pdfjs.enableScripting" = false;
"signon.rememberSignons" = false; "signon.rememberSignons" = false;

View file

@ -16,6 +16,8 @@
nix.package = pkgs.lix; nix.package = pkgs.lix;
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
zramSwap.enable = true;
# zramSwap.memoryPercent = 50;
grimmShared = { grimmShared = {
enable = true; enable = true;

View file

@ -8,7 +8,7 @@ in
type = types.attrsOf ( type = types.attrsOf (
lib.types.submodule { lib.types.submodule {
config.serviceConfig = mkIf (osConfig.specialisation != { }) { config.serviceConfig = mkIf (osConfig.specialisation != { }) {
SystemCallArchitectures = mkDefault "native"; # SystemCallArchitectures = mkDefault "native";
}; };
} }

View file

@ -8,7 +8,6 @@
nscd.serviceConfig = { nscd.serviceConfig = {
MemoryDenyWriteExecute = true; MemoryDenyWriteExecute = true;
NoNewPrivileges = true; NoNewPrivileges = true;
SystemCallArchitectures = "native";
RestrictSUIDSGID = true; RestrictSUIDSGID = true;
RestrictAddressFamilies = [ RestrictAddressFamilies = [
"AF_UNIX" "AF_UNIX"
@ -17,6 +16,7 @@
]; ];
RestrictNamespaces = true; RestrictNamespaces = true;
SystemCallFilter = "@system-service"; SystemCallFilter = "@system-service";
SystemCallArchitectures = "native";
LockPersonality = true; LockPersonality = true;
ProtectControlGroups = true; ProtectControlGroups = true;

View file

@ -6,10 +6,14 @@
... ...
}: }:
{ {
#programs.ccache.packageNames = [ programs.ccache.enable = true;
# "agenix" nix.settings.extra-sandbox-paths = [ config.programs.ccache.cacheDir ];
# "mcontrolcenter" systemd.tmpfiles.rules = [
#]; "d! ${config.programs.ccache.cacheDir} 770 root nixbld"
];
programs.ccache.packageNames = [
# "firefox-unwrapped"
];
nixpkgs.overlays = nixpkgs.overlays =
(map (map
@ -31,10 +35,11 @@
[ [
./lua_update.nix ./lua_update.nix
./matrix-appservice-discord.nix ./matrix-appservice-discord.nix
# ./ccache-wrapper.nix ./ccache-wrapper.nix
./factorio.nix ./factorio.nix
./ranger.nix ./ranger.nix
./vesktop.nix ./vesktop.nix
./firefox-search.nix
# ./grpcio-tools.nix # ./grpcio-tools.nix
] ]
) )

View file

@ -0,0 +1,25 @@
{ prev, final, ... }:
{
# firefox-unwrapped = (prev.firefox-unwrapped.overrideAttrs (old: {
# patches = (old.patches or []) ++ [ ../patches/firefox_search_engines.patch ];
# })).override {
# stdenv = prev.ccacheStdenv;
# overrideCC = stdenv: compiler: let
# env = prev.ccacheStdenv.override { inherit stdenv; };
# in prev.overrideCC env compiler;
# };
firefox = prev.firefox.overrideAttrs (old: {
nativeBuildInputs = (old.nativeBuildInputs or []) ++ (with prev; [ zip unzip gnused ] );
buildCommand = ''
export buildRoot="$(pwd)"
'' + old.buildCommand + ''
cd $buildRoot
unzip $out/lib/firefox/browser/omni.ja -d patched_omni || true
rm $out/lib/firefox/browser/omni.ja
cd patched_omni
sed -i 's/"enterprise_only"\s*:\s*true,//' modules/policies/schema.sys.mjs
zip -0DXqr $out/lib/firefox/browser/omni.ja * # potentially qr9XD
cd $out
'';
});
}

View file

@ -0,0 +1,21 @@
From f1c293daaf7c299b6ee81f76525371bb04516394 Mon Sep 17 00:00:00 2001
From: Ryosuke Asano <ryosukeusuusu@gmail.com>
Date: Thu, 20 Jul 2023 12:21:37 +0900
Subject: [PATCH] [FB] Policies | Allow user can use Search engine policy
---
.../components/enterprisepolicies/schemas/policies-schema.json | 1 -
1 file changed, 1 deletion(-)
diff --git a/browser/components/enterprisepolicies/schemas/policies-schema.json b/browser/components/enterprisepolicies/schemas/policies-schema.json
index 75293fb9b1fb5..bc4b901b34583 100644
--- a/browser/components/enterprisepolicies/schemas/policies-schema.json
+++ b/browser/components/enterprisepolicies/schemas/policies-schema.json
@@ -1228,7 +1228,6 @@
},
"SearchEngines": {
- "enterprise_only": true,
"type": "object",
"properties": {