fix(ci): resolve nix-update workflow issues
- Remove --use-update-script flag that breaks with flake-only repos (nix-update-script expects default.nix at repo root) - Fix GitHub API jq filter for detecting prereleases - Fix Summary step bash syntax for handling input variables - Format lib/ files that were failing formatting check
This commit is contained in:
@@ -3,10 +3,10 @@
|
||||
# let
|
||||
# m3taLib = inputs.m3ta-nixpkgs.lib.${system};
|
||||
# in ...
|
||||
{ lib }: {
|
||||
{lib}: {
|
||||
# Port management utilities
|
||||
ports = import ./ports.nix { inherit lib; };
|
||||
ports = import ./ports.nix {inherit lib;};
|
||||
|
||||
# OpenCode rules injection utilities
|
||||
opencode-rules = import ./opencode-rules.nix { inherit lib; };
|
||||
opencode-rules = import ./opencode-rules.nix {inherit lib;};
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#
|
||||
# The instructions list contains paths relative to the project root, all prefixed
|
||||
# with `.opencode-rules/`, making them portable across different project locations.
|
||||
{ lib }: {
|
||||
{lib}: {
|
||||
# Create Opencode rules configuration from AGENTS repository
|
||||
#
|
||||
# Args:
|
||||
@@ -69,42 +69,48 @@
|
||||
# # ".opencode-rules/frameworks/fastapi.md"
|
||||
# # ];
|
||||
# # }
|
||||
mkOpencodeRules = { agents, languages ? [ ], concerns ? [
|
||||
"coding-style"
|
||||
"naming"
|
||||
"documentation"
|
||||
"testing"
|
||||
"git-workflow"
|
||||
"project-structure"
|
||||
], frameworks ? [ ], extraInstructions ? [ ] }:
|
||||
let
|
||||
rulesDir = ".opencode-rules";
|
||||
mkOpencodeRules = {
|
||||
agents,
|
||||
languages ? [],
|
||||
concerns ? [
|
||||
"coding-style"
|
||||
"naming"
|
||||
"documentation"
|
||||
"testing"
|
||||
"git-workflow"
|
||||
"project-structure"
|
||||
],
|
||||
frameworks ? [],
|
||||
extraInstructions ? [],
|
||||
}: let
|
||||
rulesDir = ".opencode-rules";
|
||||
|
||||
# Build instructions list by mapping concerns, languages, frameworks to their file paths
|
||||
# All paths are relative to project root via the rulesDir symlink
|
||||
instructions = (map (c: "${rulesDir}/concerns/${c}.md") concerns)
|
||||
++ (map (l: "${rulesDir}/languages/${l}.md") languages)
|
||||
++ (map (f: "${rulesDir}/frameworks/${f}.md") frameworks)
|
||||
++ extraInstructions;
|
||||
# Build instructions list by mapping concerns, languages, frameworks to their file paths
|
||||
# All paths are relative to project root via the rulesDir symlink
|
||||
instructions =
|
||||
(map (c: "${rulesDir}/concerns/${c}.md") concerns)
|
||||
++ (map (l: "${rulesDir}/languages/${l}.md") languages)
|
||||
++ (map (f: "${rulesDir}/frameworks/${f}.md") frameworks)
|
||||
++ extraInstructions;
|
||||
|
||||
# Generate JSON configuration for Opencode
|
||||
opencodeConfig = {
|
||||
"$schema" = "https://opencode.ai/config.json";
|
||||
inherit instructions;
|
||||
};
|
||||
in {
|
||||
# Generate JSON configuration for Opencode
|
||||
opencodeConfig = {
|
||||
"$schema" = "https://opencode.ai/config.json";
|
||||
inherit instructions;
|
||||
|
||||
# Shell hook to set up rules in the project
|
||||
# Creates a symlink to the AGENTS rules directory and generates opencode.json
|
||||
shellHook = ''
|
||||
# Create/update symlink to AGENTS rules directory
|
||||
ln -sfn ${agents}/rules ${rulesDir}
|
||||
|
||||
# Generate opencode.json configuration file
|
||||
cat > opencode.json <<'OPENCODE_EOF'
|
||||
${builtins.toJSON opencodeConfig}
|
||||
OPENCODE_EOF
|
||||
'';
|
||||
};
|
||||
in {
|
||||
inherit instructions;
|
||||
|
||||
# Shell hook to set up rules in the project
|
||||
# Creates a symlink to the AGENTS rules directory and generates opencode.json
|
||||
shellHook = ''
|
||||
# Create/update symlink to AGENTS rules directory
|
||||
ln -sfn ${agents}/rules ${rulesDir}
|
||||
|
||||
# Generate opencode.json configuration file
|
||||
cat > opencode.json <<'OPENCODE_EOF'
|
||||
${builtins.toJSON opencodeConfig}
|
||||
OPENCODE_EOF
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user