feat(opencode): integrate rules into default devShell

- Switch agents input to local path for development
- Add default devShell with Opencode rules integration
- Update .gitignore to exclude generated Opencode files
- Upgrade opencode to v1.2.6
This commit is contained in:
m3tm3re
2026-02-17 20:11:14 +01:00
parent 1d3564f360
commit 2e550b91f5
3 changed files with 145 additions and 113 deletions

4
.gitignore vendored
View File

@@ -20,3 +20,7 @@ result-*
# OS # OS
.DS_Store .DS_Store
Thumbs.db Thumbs.db
# Opencode rules
.opencode-rules
opencode.json

31
flake.lock generated
View File

@@ -24,17 +24,14 @@
"agents": { "agents": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1771054446, "lastModified": 1771353501,
"narHash": "sha256-0IispDJYxOtWn1usZh6AR4nF3ouCscXDxBzgwAVjhx0=", "narHash": "sha256-M7m6g10+1cMmJKp41QWy1pMsD1OZUiHjMGIsICvpE1A=",
"ref": "refs/heads/master", "path": "/home/m3tam3re/p/AI/AGENTS",
"rev": "923e2f1eaad96f440bbb76d07bb66ac4f5b4460a", "type": "path"
"revCount": 55,
"type": "git",
"url": "https://code.m3ta.dev/m3tam3re/AGENTS"
}, },
"original": { "original": {
"type": "git", "path": "/home/m3tam3re/p/AI/AGENTS",
"url": "https://code.m3ta.dev/m3tam3re/AGENTS" "type": "path"
} }
}, },
"base16-schemes": { "base16-schemes": {
@@ -245,11 +242,11 @@
"opencode": "opencode" "opencode": "opencode"
}, },
"locked": { "locked": {
"lastModified": 1771121922, "lastModified": 1771351183,
"narHash": "sha256-WjlMXMFH5FvJzDiEkw5FnIL9pJ/qdY271hRPZ7nU24Q=", "narHash": "sha256-dIzUuSreb5AAp0bagYAHOPupJnAY6HL+fwdzchp7roY=",
"ref": "refs/heads/master", "ref": "refs/heads/master",
"rev": "6ebd7b94d50d1526a697f40ac0ebf44542b026fe", "rev": "d43bb33dcb4ae358dd398166a377f00d96e1f03b",
"revCount": 112, "revCount": 118,
"type": "git", "type": "git",
"url": "https://code.m3ta.dev/m3tam3re/nixpkgs" "url": "https://code.m3ta.dev/m3tam3re/nixpkgs"
}, },
@@ -547,16 +544,16 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1771120533, "lastModified": 1771271829,
"narHash": "sha256-FA9RRo4wH+FHXWIm3hm0oPouQ+VKral+Mqbk4g3dPfo=", "narHash": "sha256-43vPMyO7DsAgKrh0Wmt7jLDYCWUsaj30nBITreyYgX8=",
"owner": "anomalyco", "owner": "anomalyco",
"repo": "opencode", "repo": "opencode",
"rev": "d1482e148399bfaf808674549199f5f4aa69a22d", "rev": "d8c25bfeb44771cc3a3ba17bf8de6ad2add9de2c",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "anomalyco", "owner": "anomalyco",
"ref": "v1.2.4", "ref": "v1.2.6",
"repo": "opencode", "repo": "opencode",
"type": "github" "type": "github"
} }

View File

@@ -17,9 +17,12 @@
}; };
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-25.11"; nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-25.11";
nixpkgs-45570c2.url = "github:nixos/nixpkgs/45570c299dc2b63c8c574c4cd77f0b92f7e2766e"; nixpkgs-45570c2.url =
nixpkgs-locked.url = "github:nixos/nixpkgs/2744d988fa116fc6d46cdfa3d1c936d0abd7d121"; "github:nixos/nixpkgs/45570c299dc2b63c8c574c4cd77f0b92f7e2766e";
nixpkgs-9e58ed7.url = "github:nixos/nixpkgs/9e58ed7ba759d81c98f033b7f5eba21ca68f53b0"; nixpkgs-locked.url =
"github:nixos/nixpkgs/2744d988fa116fc6d46cdfa3d1c936d0abd7d121";
nixpkgs-9e58ed7.url =
"github:nixos/nixpkgs/9e58ed7ba759d81c98f033b7f5eba21ca68f53b0";
nixpkgs-master.url = "github:nixos/nixpkgs/master"; nixpkgs-master.url = "github:nixos/nixpkgs/master";
m3ta-nixpkgs.url = "git+https://code.m3ta.dev/m3tam3re/nixpkgs"; m3ta-nixpkgs.url = "git+https://code.m3ta.dev/m3tam3re/nixpkgs";
@@ -36,30 +39,22 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nixos-generators = { nixos-generators = { url = "github:nix-community/nixos-generators"; };
url = "github:nix-community/nixos-generators";
};
hyprpanel.url = "github:Jas-SinghFSU/HyprPanel"; hyprpanel.url = "github:Jas-SinghFSU/HyprPanel";
rose-pine-hyprcursor.url = "github:ndom91/rose-pine-hyprcursor"; rose-pine-hyprcursor.url = "github:ndom91/rose-pine-hyprcursor";
nix-colors.url = "github:misterio77/nix-colors"; nix-colors.url = "github:misterio77/nix-colors";
agents = { agents = {
# url = "path:/home/m3tam3re/p/AI/AGENTS"; url = "path:/home/m3tam3re/p/AI/AGENTS";
url = "git+https://code.m3ta.dev/m3tam3re/AGENTS"; # url = "git+https://code.m3ta.dev/m3tam3re/AGENTS";
flake = false; flake = false;
}; };
}; };
outputs = { outputs = { self, agenix, home-manager, nixpkgs, m3ta-nixpkgs, nur, agents
self, , ... }@inputs:
agenix, let
home-manager,
nixpkgs,
m3ta-nixpkgs,
nur,
...
} @ inputs: let
inherit (self) outputs; inherit (self) outputs;
systems = [ systems = [
"aarch64-linux" "aarch64-linux"
@@ -72,7 +67,7 @@
in { in {
packages = packages =
forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system}); forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
overlays = import ./overlays {inherit inputs outputs;}; overlays = import ./overlays { inherit inputs outputs; };
homeManagerModules = import ./modules/home-manager; homeManagerModules = import ./modules/home-manager;
nixosConfigurations = { nixosConfigurations = {
@@ -88,7 +83,7 @@
]; ];
}; };
m3-atlas = nixpkgs.lib.nixosSystem { m3-atlas = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;}; specialArgs = { inherit inputs outputs; };
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [
./hosts/m3-atlas ./hosts/m3-atlas
@@ -110,7 +105,7 @@
]; ];
}; };
m3-helios = nixpkgs.lib.nixosSystem { m3-helios = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;}; specialArgs = { inherit inputs outputs; };
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [
./hosts/m3-helios ./hosts/m3-helios
@@ -127,17 +122,13 @@
inherit inputs outputs; inherit inputs outputs;
hostname = "m3-daedalus"; hostname = "m3-daedalus";
}; };
modules = [./home/m3tam3re/m3-daedalus.nix]; modules = [ ./home/m3tam3re/m3-daedalus.nix ];
}; };
}; };
devShells.x86_64-linux.infraShell = let devShells.x86_64-linux.infraShell =
pkgs = nixpkgs.legacyPackages.x86_64-linux; let pkgs = nixpkgs.legacyPackages.x86_64-linux;
in in pkgs.mkShell {
pkgs.mkShell { buildInputs = with pkgs; [ opentofu nixos-anywhere ];
buildInputs = with pkgs; [
opentofu
nixos-anywhere
];
shellHook = '' shellHook = ''
echo "Infrastructure Management Shell" echo "Infrastructure Management Shell"
echo "Commands:" echo "Commands:"
@@ -146,5 +137,45 @@
echo " - tofu apply" echo " - tofu apply"
''; '';
}; };
devShells.x86_64-linux.default = let
pkgs = nixpkgs.legacyPackages.x86_64-linux;
m3taLib = m3ta-nixpkgs.lib.x86_64-linux;
rules = m3taLib.opencode-rules.mkOpencodeRules {
inherit agents;
languages = [ "nix" ];
};
in pkgs.mkShell {
inherit (rules) instructions;
shellHook = ''
${rules.shellHook}
echo "======================================"
echo "Nix Development Shell with Opencode Rules"
echo "======================================"
echo ""
echo "Active rules:"
echo " - Nix language conventions"
echo " - Coding-style best practices"
echo " - Naming conventions"
echo " - Documentation standards"
echo " - Testing guidelines"
echo " - Git workflow patterns"
echo " - Project structure guidelines"
echo ""
echo "Generated files:"
echo " - .opencode-rules/ (symlink to AGENTS repo)"
echo " - opencode.json (configuration file)"
echo ""
echo "Useful commands:"
echo " - cat opencode.json View rules configuration"
echo " - ls .opencode-rules/ Browse available rules"
echo " - nix develop Re-enter this shell"
echo ""
echo "Remember to add to .gitignore:"
echo " .opencode-rules"
echo " opencode.json"
echo "======================================"
'';
};
}; };
} }