1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-22 10:19:39 +01:00
home-manager/modules/programs/numbat.nix
Austin Horstman 86402a17b6 treewide: flatten single file modules
Some files don't need nesting and can be root level again to reduce
conflicts with other PRs.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-06-23 16:20:26 -05:00

50 lines
1.1 KiB
Nix

{
lib,
config,
pkgs,
...
}:
let
inherit (lib) mkIf;
cfg = config.programs.numbat;
tomlFormat = pkgs.formats.toml { };
configDir =
if pkgs.stdenv.hostPlatform.isDarwin then
"Library/Application Support/numbat"
else
"${config.xdg.configHome}/numbat";
in
{
meta.maintainers = with lib.hm.maintainers; [
Aehmlo
];
options.programs.numbat = {
enable = lib.mkEnableOption "Numbat";
package = lib.mkPackageOption pkgs "numbat" { nullable = true; };
settings = lib.mkOption {
type = tomlFormat.type;
default = { };
example = {
intro-banner = "short";
prompt = "> ";
exchange-rates.fetching-policy = "on-first-use";
};
description = ''
Options to add to {file}`config.toml`. See
<https://numbat.dev/doc/cli-customization.html#configuration> for options.
'';
};
};
config = mkIf cfg.enable {
home.packages = mkIf (cfg.package != null) [ cfg.package ];
home.file."${configDir}/config.toml" = mkIf (cfg.settings != { }) {
source = tomlFormat.generate "numbat-config" cfg.settings;
};
};
}