on main help sign in
crush/flake.nix
75 lines 1.8 kB history raw
1{
2 description = "Crush development environment";
4 inputs = {
5 nixpkgs.url = "github:NixOS/nixpkgs";
6 flake-utils.url = "github:numtide/flake-utils";
7 };
9 outputs = {
10 self,
11 nixpkgs,
12 flake-utils,
13 }:
14 flake-utils.lib.eachDefaultSystem (
15 system: let
16 pkgs = nixpkgs.legacyPackages.${system};
17 version = "devel";
18 in {
19 packages.default = pkgs.buildGoModule {
20 pname = "crush";
21 inherit version;
23 src = ./.;
25 vendorHash = null;
27 # Match the Go toolchain used in the dev shell.
28 go = pkgs.go_1_26;
30 env.CGO_ENABLED = 0;
32 ldflags = [
33 "-s"
34 "-w"
35 "-X github.com/charmbracelet/crush/internal/version.Version=${version}"
36 ];
38 # The test suite requires network access and external tools.
39 doCheck = false;
41 meta = {
42 description = "Terminal-based AI coding assistant";
43 homepage = "https://github.com/charmbracelet/crush";
44 license = pkgs.lib.licenses.mit;
45 mainProgram = "crush";
46 };
47 };
49 devShells.default = pkgs.mkShell {
50 buildInputs = with pkgs; [
51 # Go toolchain
52 go_1_26
54 # Development tools
55 gopls # Go language server
56 golangci-lint # Linter
57 gofumpt # Formatter (stricter than gofmt)
58 go-task # Task runner
59 delve # Go debugger
61 # Additional tools
62 git # Version control
63 gh # GitHub CLI
64 svu # Semantic version utility
65 sqlc # SQL code generator
66 ];
68 shellHook = ''
69 # Set Go environment variables
70 export CGO_ENABLED=0
71 '';
72 };
73 }
74 );