-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
70 lines (63 loc) · 1.94 KB
/
Copy pathflake.nix
File metadata and controls
70 lines (63 loc) · 1.94 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{
description = "git-ai development shell";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
nixpkgs,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
runtimeDeps = with pkgs; [
gum
jq
];
in
{
packages.default = pkgs.stdenv.mkDerivation {
pname = "git-ai";
version = pkgs.lib.removeSuffix "\n" (builtins.readFile ./version.txt);
src = ./.;
nativeBuildInputs = [ pkgs.makeWrapper ];
installPhase = ''
mkdir -p $out/share/git-ai $out/bin
cp git-ai $out/share/git-ai/
cp -r scripts templates $out/share/git-ai/
chmod +x $out/share/git-ai/git-ai
makeWrapper $out/share/git-ai/git-ai $out/bin/git-ai \
--prefix PATH : ${pkgs.lib.makeBinPath runtimeDeps}
'';
meta = with pkgs.lib; {
description = "AI-powered git commit message generator";
homepage = "https://github.com/git-extensions/git-ai";
license = licenses.mit;
maintainers = [ ];
mainProgram = "git-ai";
platforms = platforms.unix;
};
};
devShells.default = pkgs.mkShell {
name = "git-ai";
packages = with pkgs; [
bash
gum
jq
bats
shellcheck
];
shellHook = ''
if ! command -v claude &>/dev/null && ! command -v codex &>/dev/null && ! command -v gemini &>/dev/null; then
echo "warning: no supported AI agent found — install Claude Code, Codex, or Gemini CLI" >&2
echo " you may need: nix run github:numtide/llm-agents.nix" >&2
fi
'';
};
}
);
}