fix nix functional test & add mole to brew, del osgrep bd

This commit is contained in:
Rasyidan Akbar F. 2026-01-05 00:11:13 +07:00
commit d8ad4e916d
11 changed files with 13 additions and 7398 deletions

View file

@ -140,7 +140,7 @@
else else
pkgs.python3; pkgs.python3;
# Custom packages (osgrep, beads, etc.) # Custom packages
customPkgs = import ./packages { inherit pkgs lib llm-agents; }; customPkgs = import ./packages { inherit pkgs lib llm-agents; };
# Common arguments passed to all devshell imports # Common arguments passed to all devshell imports
@ -173,6 +173,6 @@
let let
pkgs = mkPkgs system; pkgs = mkPkgs system;
customPkgs = import ./packages { inherit pkgs lib llm-agents; }; customPkgs = import ./packages { inherit pkgs lib llm-agents; };
in { inherit (customPkgs) osgrep opencode beads; }); in { inherit (customPkgs) opencode; });
}; };
} }

View file

@ -16,7 +16,7 @@ in {
}; };
brews = mkOption { brews = mkOption {
type = types.listOf types.str; type = types.listOf types.str;
default = [ "curl" "yt-dlp" "infisical" ]; default = [ "curl" "yt-dlp" "infisical" "mole" ];
description = "Homebrew formulae to install."; description = "Homebrew formulae to install.";
}; };
casks = mkOption { casks = mkOption {

View file

@ -2,7 +2,7 @@
imports = [ ./homebrew.nix ./devtools.nix ]; imports = [ ./homebrew.nix ./devtools.nix ];
nix = { nix = {
package = pkgs.nix; package = pkgs.nixVersions.nix_2_28;
extraOptions = '' extraOptions = ''
keep-derivations = true keep-derivations = true
keep-outputs = true keep-outputs = true

View file

@ -21,6 +21,7 @@
nil # Nix LSP nil # Nix LSP
pyright pyright
nodePackages.typescript-language-server nodePackages.typescript-language-server
mdx-language-server
rust-analyzer rust-analyzer
gopls gopls
clang-tools # provides clangd clang-tools # provides clangd

View file

@ -26,6 +26,7 @@ return {
jsonc = { "prettierd", "prettier", stop_after_first = true }, jsonc = { "prettierd", "prettier", stop_after_first = true },
yaml = { "prettierd", "prettier", stop_after_first = true }, yaml = { "prettierd", "prettier", stop_after_first = true },
markdown = { "prettierd", "prettier", stop_after_first = true }, markdown = { "prettierd", "prettier", stop_after_first = true },
mdx = { "prettierd", "prettier", stop_after_first = true },
html = { "prettierd", "prettier", stop_after_first = true }, html = { "prettierd", "prettier", stop_after_first = true },
css = { "prettierd", "prettier", stop_after_first = true }, css = { "prettierd", "prettier", stop_after_first = true },
scss = { "prettierd", "prettier", stop_after_first = true }, scss = { "prettierd", "prettier", stop_after_first = true },

View file

@ -101,6 +101,11 @@ return {
lspconfig.clangd.setup({ lspconfig.clangd.setup({
capabilities = capabilities, capabilities = capabilities,
}) })
-- MDX
lspconfig.mdx_analyzer.setup({
capabilities = capabilities,
})
end, end,
}, },
} }

View file

@ -27,6 +27,7 @@ return {
"luap", "luap",
"markdown", "markdown",
"markdown_inline", "markdown_inline",
"mdx",
"nix", "nix",
"norg", "norg",
"printf", "printf",

View file

@ -4,8 +4,5 @@ let
system = pkgs.stdenv.hostPlatform.system; system = pkgs.stdenv.hostPlatform.system;
llmPkgs = llm-agents.packages.${system}; llmPkgs = llm-agents.packages.${system};
in { in {
osgrep = pkgs.callPackage ./osgrep.nix { };
opencode = llmPkgs.opencode; opencode = llmPkgs.opencode;
# Source beads from llm-agents.nix
beads = llmPkgs.beads;
} }

File diff suppressed because it is too large Load diff

View file

@ -1,32 +0,0 @@
{ lib, buildNpmPackage, fetchurl, python3 }:
buildNpmPackage rec {
pname = "osgrep";
version = "0.5.16";
src = fetchurl {
url = "https://registry.npmjs.org/${pname}/-/${pname}-${version}.tgz";
hash = "sha256-V23PNxtMCdRaqr4uDOs0rptmSROUrUO7I9HazoGqUCQ=";
};
sourceRoot = "package";
postPatch = ''
cp ${./osgrep-package-lock.json} package-lock.json
'';
npmDepsHash = "sha256-JDeZ3kcsbcZM//0846i1gsvoAgMpIpN8c160cp7wB5s=";
npmFlags = [ "--legacy-peer-deps" ];
dontNpmBuild = true; # Already built in npm package
nativeBuildInputs = [ python3 ];
meta = {
description = "Semantic grep for AI agents";
homepage = "https://github.com/Ryandonofrio3/osgrep";
license = lib.licenses.asl20;
mainProgram = "osgrep";
};
}

View file

@ -1,56 +1,9 @@
{ pkgs, lib, customPkgs, ... }: { pkgs, lib, customPkgs, ... }:
let pkgs.mkShell {
# Get Beads package from custom packages
beadsPkg = customPkgs.beads;
# Helper script to show Beads project status
beadsStatus = pkgs.writeShellScriptBin "beads-status" ''
if [ ! -d ".beads" ]; then
echo "Not a Beads project (no .beads directory found)"
exit 1
fi
echo "=== Beads Project Status ==="
echo ""
echo "Ready tasks:"
${beadsPkg}/bin/bd ready --json | ${pkgs.jq}/bin/jq -r '.[] | " - [\(.id)] \(.title) (\(.type))"'
echo ""
echo "In Progress:"
${beadsPkg}/bin/bd list --status in-progress --json | ${pkgs.jq}/bin/jq -r '.[] | " - [\(.id)] \(.title)"'
echo ""
echo "For full details, run: bd list --json | jq"
'';
# Helper script to generate full project context for AI agents
beadsContext = pkgs.writeShellScriptBin "beads-context" ''
if [ ! -d ".beads" ]; then
echo "Not a Beads project (no .beads directory found)"
exit 1
fi
echo "=== Beads Project Context ==="
echo ""
echo "All issues:"
${beadsPkg}/bin/bd list --json | ${pkgs.jq}/bin/jq '.'
echo ""
echo "Dependency tree (first ready task):"
ready_id=$(${beadsPkg}/bin/bd ready --json | ${pkgs.jq}/bin/jq -r '.[0].id // empty')
if [ -n "$ready_id" ]; then
${beadsPkg}/bin/bd dep tree "$ready_id"
else
echo "No ready tasks"
fi
'';
in pkgs.mkShell {
name = "ai-agent"; name = "ai-agent";
packages = with pkgs; [ packages = with pkgs; [
# Custom packages
customPkgs.beads
customPkgs.osgrep
# Version control # Version control
git git
jujutsu jujutsu
@ -62,10 +15,6 @@ in pkgs.mkShell {
# JSON processing # JSON processing
jq jq
# Helper scripts
beadsStatus
beadsContext
]; ];
shellHook = '' shellHook = ''
@ -77,22 +26,7 @@ in pkgs.mkShell {
echo "AI Agent development shell loaded" echo "AI Agent development shell loaded"
echo "" echo ""
echo "Available tools:" echo "Available tools:"
echo " bd - Beads CLI (issue tracker)"
echo " beads-status - Show project status summary"
echo " beads-context - Generate full context for AI"
echo " osgrep - Semantic code search"
echo " jj/git - Version control" echo " jj/git - Version control"
echo " rg/ast-grep - Code search" echo " rg/ast-grep - Code search"
echo ""
echo "Quick start:"
echo " bd init - Initialize Beads in current project"
echo " bd create - Create new issue"
echo " bd ready - Show ready tasks"
echo " bd --help - Full command reference"
echo ""
echo "Nushell helpers (if in nushell):"
echo " bd-init - Safe init with git checks"
echo " bd-ready - View ready tasks (structured)"
echo " bd-sync - Sync database with git"
''; '';
} }