1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00
home-manager/modules/programs/firefox/default.nix
Austin Horstman 4fca600cb1 treewide: implement auto importing for modules
Reduce maintenance burden and increase efficiency by automatically
importing modules following a specific convention.

Co-authored-by: awwpotato <awwpotato@voidq.com>
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-06-22 23:58:37 -05:00

64 lines
1.6 KiB
Nix

{ lib, config, ... }:
let
inherit (lib) mkRemovedOptionModule;
cfg = config.programs.firefox;
modulePath = [
"programs"
"firefox"
];
moduleName = lib.concatStringsSep "." modulePath;
mkFirefoxModule = import ./mkFirefoxModule.nix;
in
{
meta.maintainers = [
lib.maintainers.rycee
lib.hm.maintainers.bricked
lib.hm.maintainers.HPsaucii
];
imports = [
(mkFirefoxModule {
inherit modulePath;
name = "Firefox";
wrappedPackageName = "firefox";
unwrappedPackageName = "firefox-unwrapped";
visible = true;
platforms.linux = {
configPath = ".mozilla/firefox";
};
platforms.darwin = {
configPath = "Library/Application Support/Firefox";
};
})
(mkRemovedOptionModule (modulePath ++ [ "extensions" ]) ''
Extensions are now managed per-profile. That is, change from
${moduleName}.extensions = [ foo bar ];
to
${moduleName}.profiles.myprofile.extensions.packages = [ foo bar ];'')
(mkRemovedOptionModule (
modulePath ++ [ "enableAdobeFlash" ]
) "Support for this option has been removed.")
(mkRemovedOptionModule (
modulePath ++ [ "enableGoogleTalk" ]
) "Support for this option has been removed.")
(mkRemovedOptionModule (
modulePath ++ [ "enableIcedTea" ]
) "Support for this option has been removed.")
];
config = lib.mkIf cfg.enable {
mozilla.firefoxNativeMessagingHosts =
cfg.nativeMessagingHosts
# package configured native messaging hosts (entire browser actually)
++ (lib.optional (cfg.finalPackage != null) cfg.finalPackage);
};
}