Compare commits
2 commits
2b8335ffb0
...
298aa410eb
Author | SHA1 | Date | |
---|---|---|---|
298aa410eb | |||
33df89b381 |
2 changed files with 30 additions and 13 deletions
|
@ -42,18 +42,18 @@ in
|
|||
".SynologyDrive/log"
|
||||
".cache/keepassxc"
|
||||
".cache/nvim/luac"
|
||||
".cat_installer" # eduroam
|
||||
".config/JetBrains"
|
||||
".config/Nextcloud"
|
||||
".config/calibre"
|
||||
".config/github-copilot"
|
||||
".config/kdeconnect"
|
||||
".config/keepassxc"
|
||||
".local/share/JetBrains"
|
||||
".local/share/direnv"
|
||||
".local/share/nvim"
|
||||
".local/share/zoxide"
|
||||
".local/share/JetBrains"
|
||||
".config/JetBrains"
|
||||
".config/calibre"
|
||||
".local/state/nvim"
|
||||
".config/kdeconnect"
|
||||
".config/github-copilot"
|
||||
".cat_installer" # eduroam
|
||||
".mozilla"
|
||||
"Documents"
|
||||
"Downloads"
|
||||
|
|
|
@ -29,19 +29,36 @@ in
|
|||
);
|
||||
};
|
||||
};
|
||||
setSearchEngines = mkEnableOption "firefox search engines";
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.firefox;
|
||||
example = pkgs.firefox-esr;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home-manager.users.moritz.programs.firefox = {
|
||||
enable = true;
|
||||
policies = mkIf cfg.setSearchEngines {
|
||||
SearchEngines = {
|
||||
Default = "Kagi";
|
||||
Remove = [ "Google" "Amazon.de" "Bing" ];
|
||||
policies =
|
||||
let
|
||||
removeExtensions = [ "Google" "Amazon.de" "Bing" "Amazon" "Wikipedia (en)" "Wikipedia (de)" ];
|
||||
convertName = name:
|
||||
let
|
||||
lower = toLower name;
|
||||
escaped = replaceStrings [ "." ] [ "dot" ] lower;
|
||||
sanitized = head (splitString " " escaped);
|
||||
in
|
||||
"${sanitized}@search.mozilla.org";
|
||||
in
|
||||
{
|
||||
SearchEngines = mkIf (hasInfix "esr" cfg.package) {
|
||||
Default = "Kagi";
|
||||
Remove = removeExtensions;
|
||||
};
|
||||
ExtensionSettings = genAttrs
|
||||
(map convertName removeExtensions)
|
||||
(_: { installation_mode = "blocked"; });
|
||||
};
|
||||
};
|
||||
package = if cfg.setSearchEngines then pkgs.firefox-esr else pkgs.firefox;
|
||||
profiles."default" = {
|
||||
extraConfig = mkIf cfg.arkenfox.enable ''
|
||||
// Arkenfox user.js
|
||||
|
|
Loading…
Reference in a new issue