dotfiles/modules/programs/firefox.nix

47 lines
967 B
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 = {
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;
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
'';
};
};
}