refactor(desktop): use optional instead of mkIf in firefox and media-player modules

This commit is contained in:
Mohammad Rafiq 2025-06-14 15:16:04 +08:00
parent 88f0db3425
commit 4a50de5eed
No known key found for this signature in database
2 changed files with 7 additions and 17 deletions

View file

@ -2,7 +2,7 @@
let
inherit (lib)
mkEnableOption
mkIf
optional
singleton
;
cfg = config.desktop.browser.firefox;
@ -10,11 +10,9 @@ in
{
options.desktop.browser.firefox.enable = mkEnableOption "";
config = mkIf cfg.enable {
home-manager.sharedModules = singleton {
persistDirs = singleton ".mozilla/firefox";
programs.firefox.enable = true;
stylix.targets.firefox.colorTheme.enable = true;
};
config.home-manager.sharedModules = optional cfg.enable {
persistDirs = singleton ".mozilla/firefox";
programs.firefox.enable = true;
stylix.targets.firefox.colorTheme.enable = true;
};
}