Files
home-manager/modules/programs/git-cliff.nix
Austin Horstman 355734d876 treewide: remove literalExpression where unneeded
`literalExpression` is intended just to signify code that needs to stay
a string that gets represented exactly as-is for docs. It has been
misused heavily and people get confused repeatedly on when or not to use
it because of the rampant misuse.
2026-05-17 21:43:25 -05:00

45 lines
1009 B
Nix

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