dotfiles/modules/programs/firefox.nix

51 lines
1.0 KiB
Nix
Raw Normal View History

2022-07-15 13:11:54 +02:00
{ config
, lib
, pkgs
, inputs
, ...
}:
with lib;
let
cfg = config.my.programs.firefox;
arkenfox = builtins.readFile "${inputs.arkenfox-userjs}/user.js";
in
{
options.my.programs.firefox = {
enable = mkOption {
default = false;
type = types.bool;
example = true;
};
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;
2022-08-31 11:42:43 +02:00
profiles."default".extraConfig = mkIf cfg.arkenfox.enable ''
2022-07-15 13:11:54 +02:00
// Arkenfox user.js
${arkenfox}
// Overrides
2022-08-31 11:42:43 +02:00
${cfg.arkenfox.overrides}
2022-07-15 13:11:54 +02:00
'';
};
};
}