Skip to content

Commit 7efcc93

Browse files
chore: adds nix and nixflakes environment
1 parent bce2ec5 commit 7efcc93

File tree

4 files changed

+131
-0
lines changed

4 files changed

+131
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,5 @@ Thumbs.db
4343

4444
.opencode/
4545

46+
# Nix specific files when running 'nix build'
47+
result

default.nix

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{ pkgs ? import <nixpkgs> {} }:
2+
let
3+
lib = pkgs.lib;
4+
in
5+
pkgs.buildGoModule rec {
6+
name = "opencode";
7+
version = "0.0.34";
8+
9+
src = pkgs.fetchFromGitHub {
10+
owner = "opencode-ai";
11+
repo = "opencode";
12+
tag = "v${version}";
13+
hash = "sha256-EaspkL0TEBJEUU3f75EhZ4BOIvbneUKnTNeNGhJdjYE=";
14+
};
15+
16+
vendorHash = "sha256-cFzkMunPkGQDFhQ4NQZixc5z7JCGNI7eXBn826rWEvk=";
17+
18+
checkFlags =
19+
let
20+
skippedTests = [
21+
# permission denied
22+
"TestBashTool_Run"
23+
"TestSourcegraphTool_Run"
24+
"TestLsTool_Run"
25+
];
26+
in
27+
[ "-skip=^${lib.concatStringsSep "$|^" skippedTests}$" ];
28+
29+
meta = with lib; {
30+
description = "A powerful terminal-based AI assistant for developers, providing intelligent coding assistance directly in your terminal.";
31+
homepage = "https://github.com/opencode-ai/opencode";
32+
mainProgram = "opencode";
33+
license = licenses.mit;
34+
maintainers = with maintainers; [
35+
zestsystem
36+
];
37+
};
38+
}

flake.lock

Lines changed: 60 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
description = "Opencode's nix flake";
3+
4+
inputs = {
5+
nixpkgs.url = "github:NixOS/nixpkgs";
6+
utils.url = "github:numtide/flake-utils";
7+
};
8+
9+
outputs = { nixpkgs, utils, ... }:
10+
utils.lib.eachDefaultSystem (system:
11+
let
12+
pkgs = import nixpkgs { inherit system; };
13+
defaultPkg = pkgs.callPackage ./default.nix {
14+
inherit pkgs;
15+
};
16+
in {
17+
devShells.default = pkgs.mkShell {
18+
packages = with pkgs; [
19+
# Development tools
20+
go
21+
22+
# Aux tools
23+
goreleaser
24+
];
25+
};
26+
27+
packages = {
28+
default = defaultPkg;
29+
};
30+
});
31+
}

0 commit comments

Comments
 (0)