Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Nix

on:
push:
branches: [main]
pull_request:

jobs:
build:
name: Build Flake
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v14
- uses: DeterminateSystems/magic-nix-cache-action@v8
- run: nix build .
- run: ./result/bin/contrabass --help
8 changes: 8 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ jobs:
- name: Build embedded dashboard
run: make build-dashboard

- name: Patch flake.nix version
run: |
version="${GITHUB_REF_NAME#v}"
sed -i "s/version = \".*\";/version = \"${version}\";/" flake.nix
sed -i "s/-X main.version=.*\"/-X main.version=${version}\"/" flake.nix
git add flake.nix
git commit -m "chore(release): bump flake.nix to ${GITHUB_REF_NAME}" || true

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
Expand Down
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,29 @@ From a fresh clone, run `bun install` once before using the JS/landing build and
brew install junhoyeo/contrabass/contrabass
```

### Nix

```bash
# Run without installing
nix --extra-experimental-features 'nix-command flakes' run github:junhoyeo/contrabass -- --help

# Install to profile
nix profile install github:junhoyeo/contrabass

# Enter development shell (provides Go, Bun, etc.)
nix develop github:junhoyeo/contrabass
```

For NixOS system-wide installation, add to your configuration:

```nix
{
inputs.contrabass.url = "github:junhoyeo/contrabass";
# ...
environment.systemPackages = [ inputs.contrabass.packages.${system}.default ];
}
```

### Download from GitHub Releases

Pre-built binaries for macOS and Linux (amd64/arm64) are available on the
Expand Down
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 62 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
description = "Contrabass — A project-level orchestrator for AI coding agents";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};

contrabass = pkgs.buildGoModule {
pname = "contrabass";
version = "0.4.1";
src = ./.;

# Empty string disables vendor hash checking
vendorHash = "sha256-9Ky5onabMw3PFjjtmHZzD+65YDxSkQlVwKoQa/V+zw0=";

env = {
CGO_ENABLED = "0";
};

subPackages = [ "cmd/contrabass" ];

ldflags = [
"-s"
"-w"
"-X main.version=0.4.1"
"-X main.commit=${self.shortRev or "dirty"}"
];

meta = with pkgs.lib; {
description = "A project-level orchestrator for AI coding agents";
homepage = "https://github.com/junhoyeo/contrabass";
license = licenses.asl20;
maintainers = [ ];
mainProgram = "contrabass";
};
};
in
{
packages = {
default = contrabass;
contrabass = contrabass;
};

devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
go
gopls
gotools
go-tools
goreleaser
bun
];
};
}
);
}