You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I tried to get a global firefox config to work. Mozilla says here https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Enterprise_deployment_before_60 that a file has to be placed to firefox-unwrapped/lib/firefox/defaults/pref/autoconfig.js or firefox-unwrapped/lib/firefox/defaults/pref/channel-prefs.js and firefox-unwrapped/lib/firefox/mozilla.cfg.
To achieve that I needed to write these files into another derivation and symlink everything else (except firefox-unwrapped/bin/firefox which has been re-wrapped). After successfully doing so it still doesn't load the config files.
{ config, pkgs, ... }:
let
myFirefox = pkgs.runCommand "myfirefox" {
buildInputs = [ pkgs.makeWrapper pkgs.xorg.lndir ];
} ''
mkdir $out
# Link every top-level folder from pkgs.hello to our new target
lndir -silent ${pkgs.firefox-unwrapped} $out
# Except the bin folder
rm -r $out/bin
mkdir $out/bin
makeWrapper $out/lib/firefox/firefox $out/bin/firefox \
--add-flags "-t"
mkdir -p $out/lib/firefox/browser/defaults/preferences
mkdir -p $out/lib/firefox/defaults/pref
mkdir -p $out/bin
# Generate autoconfig.js for firefox v61+
echo '// Any comment. You must start the file with a single-line comment!
pref("general.config.filename", "mozilla.cfg");
pref("general.config.obscure_value", 0);
' > "$out/lib/firefox//browser/defaults/preferences/autoconfig.js"
rm $out/lib/firefox/defaults/pref/channel-prefs.js
# Generate autoconfig.js for firefox v60-
echo '// Any comment. You must start the file with a single-line comment!
pref("general.config.filename", "mozilla.cfg");
pref("general.config.obscure_value", 0);
pref("app.update.channel", "test");
' > "$out/lib/firefox/defaults/pref/channel-prefs.js"
# Generate preference file
echo '// Any comment. You must start the file with a single-line comment!
lockPref("browser.startup.homepage", "https://youtube.com");
' > "$out/lib/firefox/mozilla.cfg"
'';
# firefox_config = pkgs.writeText "auto" ''
# '';
in {
# system.activationScripts.copyConfig = ''
# '';
environment.systemPackages = with pkgs; [
myFirefox
];
}
I think to address this issue there has to be an option in the firefox package that is overridable with the config a user wants that places the config file directly into the firefox derivation.
Or a firefox patch that enable absolute paths for the config.
Metadata
system: "x86_64-linux"
host os: Linux 4.19.64, NixOS, 19.03.173251.56d94c8c69f (Koi)
Describe the bug
I tried to get a global firefox config to work. Mozilla says here https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Enterprise_deployment_before_60 that a file has to be placed to
firefox-unwrapped/lib/firefox/defaults/pref/autoconfig.js
orfirefox-unwrapped/lib/firefox/defaults/pref/channel-prefs.js
andfirefox-unwrapped/lib/firefox/mozilla.cfg
.To achieve that I needed to write these files into another derivation and symlink everything else (except firefox-unwrapped/bin/firefox which has been re-wrapped). After successfully doing so it still doesn't load the config files.
I think to address this issue there has to be an option in the firefox package that is overridable with the config a user wants that places the config file directly into the firefox derivation.
Or a firefox patch that enable absolute paths for the config.
Metadata
"x86_64-linux"
Linux 4.19.64, NixOS, 19.03.173251.56d94c8c69f (Koi)
yes
yes
nix-env (Nix) 2.2.2
"nixos-19.03.173251.56d94c8c69f, nixos-unstable-19.09pre186820.bf39fc17d46"
/nix/var/nix/profiles/per-user/root/channels/nixos
The text was updated successfully, but these errors were encountered: