-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
53 lines (50 loc) · 1.29 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{
inputs,
flake-parts-lib,
...
}: {
imports = [
inputs.flake-parts.flakeModules.flakeModules
];
flake.flakeModules.integrations = {
options.perSystem = flake-parts-lib.mkPerSystemOption ({
lib,
pkgs,
config,
...
}: let
inherit (lib) types mkOption mkIf;
inherit (import ../utils.nix {inherit lib;}) mkIntegration;
cfg = config.snow-blower.integrations.convco;
in {
options.snow-blower.integrations.convco = mkIntegration {
name = "Convco";
package = pkgs.convco;
settings = {
file-name = mkOption {
type = types.str;
description = lib.mdDoc "The name of the file to output the chaneglog to.";
default = "CHANGELOG.md";
};
};
};
config.snow-blower = mkIf cfg.enable {
packages = [
cfg.package
];
just.recipes.convco = {
enable = lib.mkDefault true;
justfile = let
binPath = lib.getExe cfg.package;
fileName = cfg.settings.file-name;
in
lib.mkDefault ''
# Generate ${fileName} using recent commits
changelog:
${binPath} changelog -p "" > ${fileName}
'';
};
};
});
};
}