2023-05-05 19:25:28 +02: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 = {
|
2023-07-01 01:30:13 +02:00
|
|
|
enable = mkEnableOption (lib.mdDoc "git-cliff changelog generator");
|
2023-05-05 19:25:28 +02:00
|
|
|
|
2023-07-01 11:41:32 +02:00
|
|
|
package = mkPackageOptionMD pkgs "git-cliff" { };
|
2023-05-05 19:25:28 +02:00
|
|
|
|
|
|
|
settings = mkOption {
|
|
|
|
type = tomlFormat.type;
|
|
|
|
default = { };
|
|
|
|
example = literalExpression ''
|
|
|
|
{
|
|
|
|
header = "Changelog";
|
|
|
|
trim = true;
|
|
|
|
}
|
|
|
|
'';
|
2023-07-01 01:30:13 +02:00
|
|
|
description = lib.mdDoc ''
|
2023-05-05 19:25:28 +02:00
|
|
|
Configuration written to
|
2023-07-01 01:30:13 +02:00
|
|
|
{file}`$XDG_CONFIG_HOME/git-cliff/cliff.toml`. See
|
|
|
|
<https://git-cliff.org/docs/configuration>
|
2023-05-05 19:25:28 +02: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;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|