1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2024-12-14 11:57:55 +00:00
home-manager/modules/programs/git-cliff.nix

46 lines
984 B
Nix
Raw Normal View History

2023-05-05 17:25:28 +00:00
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.git-cliff;
tomlFormat = pkgs.formats.toml { };
in {
meta.maintainers = [ hm.maintainers.NateCox ];
options.programs.git-cliff = {
enable = mkEnableOption "git-cliff changelog generator";
2023-05-05 17:25:28 +00:00
package = mkPackageOption pkgs "git-cliff" { };
2023-05-05 17:25:28 +00:00
settings = mkOption {
type = tomlFormat.type;
default = { };
example = literalExpression ''
{
header = "Changelog";
trim = true;
}
'';
description = ''
2023-05-05 17:25:28 +00:00
Configuration written to
{file}`$XDG_CONFIG_HOME/git-cliff/cliff.toml`. See
<https://git-cliff.org/docs/configuration>
2023-05-05 17:25:28 +00:00
for the documentation.
'';
};
};
config = mkIf cfg.enable {
home.packages = [ cfg.package ];
xdg.configFile = {
"git-cliff/cliff.toml" = mkIf (cfg.settings != { }) {
source = tomlFormat.generate "git-cliff-config" cfg.settings;
};
};
};
}