dotfiles/modules/programs/firefox.nix

61 lines
1.3 KiB
Nix
Raw Normal View History

2022-07-15 13:11:54 +02:00
{ config
, lib
, inputs
2023-10-10 11:51:41 +02:00
, pkgs
2022-07-15 13:11:54 +02:00
, ...
}:
with lib;
let
cfg = config.my.programs.firefox;
arkenfox = builtins.readFile "${inputs.arkenfox-userjs}/user.js";
in
{
options.my.programs.firefox = {
2022-10-15 20:00:09 +02:00
enable = mkEnableOption "firefox";
2022-08-31 11:42:43 +02:00
arkenfox = {
enable = mkEnableOption "arkenfox";
overrides = mkOption {
default = { };
type = with types; attrsOf (oneOf [ str bool int ]);
apply = overrides: concatStrings (
mapAttrsToList
(
name: value: ''
user_pref("${name}", ${builtins.toJSON value});
''
)
overrides
);
};
2022-07-15 13:11:54 +02:00
};
};
config = mkIf cfg.enable {
home-manager.users.moritz.programs.firefox = {
enable = true;
2023-10-10 11:51:41 +02:00
profiles."default" = {
extraConfig = mkIf cfg.arkenfox.enable ''
// Arkenfox user.js
${arkenfox}
2022-07-15 13:11:54 +02:00
2023-10-10 11:51:41 +02:00
// Overrides
${cfg.arkenfox.overrides}
'';
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
darkreader
firefox-color
istilldontcareaboutcookies
kagi-search
keepassxc-browser
languagetool
multi-account-containers
ublock-origin
wikiwand-wikipedia-modernized
vimium
];
};
2022-07-15 13:11:54 +02:00
};
};
}