-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
50 lines (46 loc) 路 1.73 KB
/
Copy pathflake.nix
File metadata and controls
50 lines (46 loc) 路 1.73 KB
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
{
description = "Parse most changelog formats into common structured data formats like JSON, TOML, and YAML";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs =
{ self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
in
{
packages.${system}.default =
let
baseVersion = (
let
cmdFile = builtins.readFile ./cmd/cmd.go;
m = builtins.match ".*const VERSION = \"([0-9]+\.[0-9]+\.[0-9]+)\".*" cmdFile;
in
if m == null then "0.0.0" else builtins.elemAt m 0
);
shortRev = builtins.substring 0 7 (self.rev or "dev");
in
pkgs.buildGoModule {
pname = "cl-parse";
version = "${baseVersion}-${shortRev}";
src = self;
vendorHash = "sha256-/SL6FE1rX1xkJ6vpVJUms7HUnLNY6qq66jaYUbGWKsM";
goPackagePath = "github.com/scottmckendry/cl-parse";
go = pkgs.go_1_24;
doCheck = true;
nativeBuildInputs = [ pkgs.installShellFiles ];
postInstall = ''
installShellCompletion --cmd cl-parse \
--bash <($out/bin/cl-parse completion bash) \
--zsh <($out/bin/cl-parse completion zsh) \
--fish <($out/bin/cl-parse completion fish)
'';
meta = with pkgs.lib; {
description = "Parse most changelog formats into common structured data formats like JSON, TOML, and YAML";
homepage = "https://github.com/scottmckendry/cl-parse";
license = licenses.mit;
maintainers = [ "scottmckendry" ];
};
};
defaultPackage.${system} = self.packages.${system}.default;
};
}