61 lines
1.3 KiB
Nix
61 lines
1.3 KiB
Nix
{ config
|
|
, lib
|
|
, inputs
|
|
, pkgs
|
|
, ...
|
|
}:
|
|
|
|
with lib;
|
|
let
|
|
cfg = config.my.programs.firefox;
|
|
arkenfox = builtins.readFile "${inputs.arkenfox-userjs}/user.js";
|
|
in
|
|
{
|
|
options.my.programs.firefox = {
|
|
enable = mkEnableOption "firefox";
|
|
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
|
|
);
|
|
};
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
home-manager.users.moritz.programs.firefox = {
|
|
enable = true;
|
|
profiles."default" = {
|
|
extraConfig = mkIf cfg.arkenfox.enable ''
|
|
// Arkenfox user.js
|
|
${arkenfox}
|
|
|
|
// 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
|
|
];
|
|
};
|
|
};
|
|
};
|
|
}
|