Update firefox.nix

This commit is contained in:
Chris Kruining 2025-03-19 12:15:54 +00:00 committed by GitHub
parent 84f13b8648
commit 6e01d90f3c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -33,21 +33,6 @@ in {
}) })
(mkIf cfg.enable { (mkIf cfg.enable {
home-manager.users.${user}.home.packages = let
inherit (pkgs) makeDesktopItem;
inherit (inputs.firefox.packages.${pkgs.system}) firefox-nightly-bin;
in [
firefox-nightly-bin
(makeDesktopItem {
name = "firefox-nightly-private";
desktopName = "Firefox Nightly (Private)";
genericName = "Launch a private Firefox Nightly instance";
icon = "firefox-nightly";
exec = "${lib.getExe firefox-nightly-bin} --private-window";
categories = ["Network" "WebBrowser"];
})
];
modules.${user}.desktop.browsers.firefox.settings = { modules.${user}.desktop.browsers.firefox.settings = {
# TAB cycle URL's, not buttons.. # TAB cycle URL's, not buttons..
"browser.toolbars.keyboard_navigation" = false; "browser.toolbars.keyboard_navigation" = false;
@ -181,43 +166,60 @@ in {
}; };
# Use a stable profile name so we can target it in themes # Use a stable profile name so we can target it in themes
home-manager.users.${user}.home.file = let home-manager.users.${user}.home = {
cfgPath = ".mozilla/firefox"; packages = let
in { inherit (pkgs) makeDesktopItem;
firefox-profiles = { inherit (inputs.firefox.packages.${pkgs.system}) firefox-nightly-bin;
target = "${cfgPath}/profiles.ini"; in [
text = '' firefox-nightly-bin
[Profile0] (makeDesktopItem {
Name=default name = "firefox-nightly-private";
IsRelative=1 desktopName = "Firefox Nightly (Private)";
Path=${cfg.profileName}.default genericName = "Launch a private Firefox Nightly instance";
Default=1 icon = "firefox-nightly";
exec = "${lib.getExe firefox-nightly-bin} --private-window";
categories = ["Network" "WebBrowser"];
})
];
[General] file = let
StartWithLastProfile=1 cfgPath = ".mozilla/firefox";
Version=2 in {
''; firefox-profiles = {
}; target = "${cfgPath}/profiles.ini";
text = ''
[Profile0]
Name=default
IsRelative=1
Path=${cfg.profileName}.default
Default=1
user-js = mkIf (cfg.settings != {} || cfg.extraConfig != "") { [General]
target = "${cfgPath}/${cfg.profileName}.default/user.js"; StartWithLastProfile=1
text = '' Version=2
${concatStrings (mapAttrsToList (name: value: '' '';
user_pref("${name}", ${toJSON value}); };
'')
cfg.settings)}
${cfg.extraConfig}
'';
};
user-chrome = mkIf (cfg.userChrome != "") { user-js = mkIf (cfg.settings != {} || cfg.extraConfig != "") {
target = "${cfgPath}/${cfg.profileName}.default/chrome/userChrome.css"; target = "${cfgPath}/${cfg.profileName}.default/user.js";
text = cfg.userChrome; text = ''
}; ${concatStrings (mapAttrsToList (name: value: ''
user_pref("${name}", ${toJSON value});
'')
cfg.settings)}
${cfg.extraConfig}
'';
};
user-content = mkIf (cfg.userContent != "") { user-chrome = mkIf (cfg.userChrome != "") {
target = "${cfgPath}/${cfg.profileName}.default/chrome/userContent.css"; target = "${cfgPath}/${cfg.profileName}.default/chrome/userChrome.css";
text = cfg.userContent; text = cfg.userChrome;
};
user-content = mkIf (cfg.userContent != "") {
target = "${cfgPath}/${cfg.profileName}.default/chrome/userContent.css";
text = cfg.userContent;
};
}; };
}; };
}) })