-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
71 lines (64 loc) · 1.95 KB
/
flake.nix
File metadata and controls
71 lines (64 loc) · 1.95 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
71
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-25.05-darwin";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
nixpkgs,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShell = pkgs.mkShellNoCC {
packages = with pkgs; [
bun
eslint_d
prettierd
typescript-language-server
emmet-language-server
(pkgs.writeShellApplication {
name = "pick-op";
text = ''
jj op log --no-graph --no-pager \
-T 'separate(" ", id.short(8), time.start().ago()) ++ "\n"' \
| fzf --ansi -d' ' --preview='jj op show --color=always --no-pager -p {1}' \
| cut -d' ' -f1
'';
})
(pkgs.writeShellApplication {
name = "implement-empty-change";
runtimeInputs = [
pkgs.jujutsu
pkgs.moreutils
];
text = ''
if ! jj status --no-pager >/dev/null 2>&1; then
echo "Not a jujutsu repository"
exit 1
fi
if ! jj log -r '@ & empty()' --no-pager >/dev/null 2>&1 | ifne false; then
echo "Current change is not empty"
exit 1
fi
dir=$(mktemp -d)
trap 'rm -rf $dir' EXIT
f="$dir/desc.txt"
jj show --no-patch --no-pager --template description > "$f"
claude --permission-mode=acceptEdits -p "Implement the following change.\n\n$(cat "$f")" | tee "$f".out
cp "$f".out response.md
'';
})
];
shellHook = ''
export ESLINT_USE_FLAT_CONFIG=1
'';
};
}
);
}