You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.7 KiB
58 lines
1.7 KiB
2 years ago
|
{ pkgs, user, ... }:
|
||
2 years ago
|
|
||
|
let
|
||
2 years ago
|
startpageDir = import ../startpage/dir.nix;
|
||
2 years ago
|
startpage = "file:///home/${user}/${startpageDir}/index.html";
|
||
2 years ago
|
firefox-csshacks = pkgs.fetchFromGitHub {
|
||
|
owner = "MrOtherGuy";
|
||
|
repo = "firefox-csshacks";
|
||
|
rev = "76867a5f570319d1bfd8cd396c92c876450328da";
|
||
|
sha256 = "pGDnT1aRsu/06dlYtsHLkaNakfvXmQQ/SAplClyS/2c=";
|
||
|
};
|
||
2 years ago
|
in
|
||
|
{
|
||
|
nixpkgs = {
|
||
|
config.allowUnfree = true;
|
||
|
overlays = [
|
||
|
(self: super: {
|
||
|
firefox = super.firefox.overrideAttrs (oa: {
|
||
|
buildCommand = oa.buildCommand + ''
|
||
|
cd lib/firefox
|
||
|
mkdir -p defaults/pref
|
||
|
cat > defaults/pref/autoconfig.js << 'EOL'
|
||
|
//
|
||
|
pref("general.config.filename", "autoconfig.cfg");
|
||
|
pref("general.config.obscure_value", 0);
|
||
|
pref("general.config.sandbox_enabled", false);
|
||
|
EOL
|
||
|
cat > autoconfig.cfg << 'EOL'
|
||
|
//
|
||
|
var {classes:Cc,interfaces:Ci,utils:Cu} = Components;
|
||
|
|
||
|
/* set new tab page */
|
||
|
try {
|
||
|
Cu.import("resource:///modules/AboutNewTab.jsm");
|
||
|
var newTabURL = "${startpage}";
|
||
|
AboutNewTab.newTabURL = newTabURL;
|
||
|
} catch(e){Cu.reportError(e);} // report errors in the Browser Console
|
||
|
EOL
|
||
|
'';
|
||
|
});
|
||
|
})
|
||
|
];
|
||
|
};
|
||
|
|
||
|
programs.firefox = {
|
||
|
enable = true;
|
||
|
profiles.${user} = {
|
||
|
isDefault = true;
|
||
|
settings = {
|
||
|
"browser.startup.homepage" = "${startpage}";
|
||
2 years ago
|
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
|
||
2 years ago
|
"browser.backspace_action" = 0;
|
||
2 years ago
|
};
|
||
2 years ago
|
userChrome = builtins.readFile "${firefox-csshacks}/chrome/autohide_toolbox.css";
|
||
2 years ago
|
};
|
||
|
};
|
||
|
}
|