Want to contribute? Fork me on Codeberg.org!
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.

49 lines
1.3 KiB

2 years ago
{ user, ... }:
let
startpageDir = import ./startpage/dir.nix;
startpage = "file:///home/${user}/${startpageDir}/index.html";
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}";
};
};
};
}