git-cliff: add module
This commit is contained in:
parent
3f3fa731ad
commit
983f8a1bb9
8 changed files with 93 additions and 0 deletions
45
modules/programs/git-cliff.nix
Normal file
45
modules/programs/git-cliff.nix
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
{ 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";
|
||||
|
||||
package = mkPackageOption pkgs "git-cliff" { };
|
||||
|
||||
settings = mkOption {
|
||||
type = tomlFormat.type;
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
{
|
||||
header = "Changelog";
|
||||
trim = true;
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
Configuration written to
|
||||
<filename>$XDG_CONFIG_HOME/git-cliff/cliff.toml</filename>. See
|
||||
<link xlink:href="https://git-cliff.org/docs/configuration" />
|
||||
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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue