home-manager/programs/neovide: improve the conditional for settings file

This commit is contained in:
Gabriel Arazas 2024-03-06 16:29:24 +08:00
parent fd6d903108
commit f6d6a4acae
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC

View File

@ -40,12 +40,14 @@ in
};
};
config = lib.mkIf cfg.enable {
home.packages = [ cfg.package ];
config = lib.mkIf cfg.enable (lib.mkMerge [
{
home.packages = [ cfg.package ];
}
xdg.configFile."neovide/config.toml".source =
lib.mkIf
(cfg.settings != { })
(settingsFormat.generate "home-manager-neovide-settings" cfg.settings);
};
(lib.mkIf (cfg.settings != { }) {
xdg.configFile."neovide/config.toml".source =
settingsFormat.generate "home-manager-neovide-settings" cfg.settings;
})
]);
}