Skip to content

Commit 06ed8b5

Browse files
committed
feat: opencode
1 parent b3926ac commit 06ed8b5

File tree

6 files changed

+309
-2
lines changed

6 files changed

+309
-2
lines changed

AGENTS.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Agent Guidelines for Dotfiles Repository
2+
3+
## Build/Test Commands
4+
5+
- `drs` - Apply Nix configuration with darwin-rebuild
6+
7+
## Code Style Guidelines
8+
9+
### Nix Files
10+
11+
- Use 2-space indentation
12+
- Follow attribute set formatting with proper alignment
13+
- Use `with pkgs;` for package lists
14+
- Keep imports at top of file
15+
16+
### Lua Files (Neovim)
17+
18+
- Use 2-space indentation (per stylua.toml)
19+
- 120 character line limit
20+
- Sort requires alphabetically (enabled in stylua.toml)
21+
- Use snake_case for variables and functions
22+
- Use PascalCase for modules/classes
23+
- Return module table at end of files
24+
25+
### General Conventions
26+
27+
- No trailing whitespace
28+
- Unix line endings (LF)
29+
- UTF-8 encoding
30+
- Prefer explicit over implicit configurations

nix/files/AGENTS.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Global Agent Guidelines
2+
3+
## Critical Reminders
4+
5+
### DO NOT
6+
7+
- Start work if git has uncommitted changes
8+
- Make up performance numbers or generic justifications for changes
9+
- Commit secrets, API keys, or sensitive information
10+
- Break existing functionality without proper testing
11+
- Ignore linting or formatting tools when available
12+
13+
### ALWAYS
14+
15+
- Ask before committing code
16+
- Follow project patterns and conventions
17+
- Read relevant documentation before starting tasks
18+
- Test changes thoroughly before committing
19+
- Use version control best practices
20+
- Consider security implications of changes
21+
22+
## Project-Specific Overrides
23+
24+
This file provides universal guidelines. Projects may have their own AGENTS.md file that overrides or extends these guidelines with project-specific requirements.
25+
26+
This file should be updated when major architectural patterns change across multiple projects.

nix/modules/colors.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
blue = "#0026FF";
2525
cyan = "#87FFC1";
2626
green = "#DFFF9E";
27-
magenta = "";
27+
magenta = "#FF00FF";
2828
orange = "#F0BC91";
2929
red = "#990000";
3030
white = "#FDFCF7";

nix/modules/home-manager.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
imports = [
4040
./ghostty.nix
4141
./git.nix
42+
./opencode.nix
4243
./shell.nix
4344
];
4445
programs.bat.enable = true;

nix/modules/opencode.nix

Lines changed: 250 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,250 @@
1+
{ config, ... }:
2+
let
3+
colors = import ./colors.nix;
4+
in
5+
{
6+
xdg.configFile."AGENTS.md".source = config.lib.file.mkOutOfStoreSymlink "${config.home.sessionVariables.DOTFILES_HOME}/nix/files/AGENTS.md";
7+
8+
xdg.configFile."opencode/opencode.json".text = builtins.toJSON {
9+
"$schema" = "https://opencode.ai/config.json";
10+
theme = "tmm";
11+
};
12+
13+
xdg.configFile."opencode/themes/tmm.json".text = builtins.toJSON {
14+
"$schema" = "https://opencode.ai/theme.json";
15+
defs = {
16+
darkBg = "${colors.dark.background}";
17+
darkBgMenu = "#272726";
18+
darkBgSidebar = "#000000";
19+
darkBlue = "${colors.dark.blue}";
20+
darkCursor = "${colors.dark.cursor}";
21+
darkCyan = "${colors.dark.cyan}";
22+
darkFg = "${colors.dark.foreground}";
23+
darkFgBase = "#d1d1d1";
24+
darkGreen = "${colors.dark.green}";
25+
darkMagenta = "${colors.dark.magenta}";
26+
darkOrange = "${colors.dark.orange}";
27+
darkRed = "${colors.dark.red}";
28+
darkUnimportant = "#757575";
29+
darkYellow = "${colors.dark.yellow}";
30+
31+
lightBg = "${colors.bright.background}";
32+
lightBgMenu = "#272726";
33+
lightBgSidebar = "#000000";
34+
lightBlue = "${colors.bright.blue}";
35+
lightCursor = "${colors.dark.cursor}";
36+
lightCyan = "${colors.bright.cyan}";
37+
lightFg = "${colors.bright.foreground}";
38+
lightFgBase = "#d1d1d1";
39+
lightGreen = "${colors.bright.green}";
40+
lightMagenta = "${colors.bright.magenta}";
41+
lightOrange = "${colors.bright.orange}";
42+
lightRed = "${colors.bright.red}";
43+
lightUnimportant = "#757575";
44+
lightYellow = "${colors.bright.yellow}";
45+
};
46+
theme = {
47+
primary = {
48+
dark = "darkOrange";
49+
light = "lightOrange";
50+
};
51+
secondary = {
52+
dark = "darkBlue";
53+
light = "lightBlue";
54+
};
55+
accent = {
56+
dark = "darkCursor";
57+
light = "lightCursor";
58+
};
59+
error = {
60+
dark = "darkRed";
61+
light = "lightRed";
62+
};
63+
warning = {
64+
dark = "darkOrange";
65+
light = "lightOrange";
66+
};
67+
success = {
68+
dark = "darkGreen";
69+
light = "lightGreen";
70+
};
71+
info = {
72+
dark = "darkCyan";
73+
light = "lightCyan";
74+
};
75+
text = {
76+
dark = "darkFgBase";
77+
light = "lightFgBase";
78+
};
79+
textMuted = {
80+
dark = "darkUnimportant";
81+
light = "lightUnimportant";
82+
};
83+
background = {
84+
dark = "darkBgSidebar";
85+
light = "lightBgSidebar";
86+
};
87+
backgroundPanel = {
88+
dark = "darkBg";
89+
light = "lightBg";
90+
};
91+
backgroundElement = {
92+
dark = "darkBgMenu";
93+
light = "lightBgMenu";
94+
};
95+
border = {
96+
dark = "darkUnimportant";
97+
light = "lightUnimportant";
98+
};
99+
borderActive = {
100+
dark = "darkUnimportant";
101+
light = "lightUnimportant";
102+
};
103+
borderSubtle = {
104+
dark = "darkBg";
105+
light = "lightBg";
106+
};
107+
diffAdded = {
108+
dark = "darkFg";
109+
light = "#1e725c";
110+
};
111+
diffRemoved = {
112+
dark = "darkFg";
113+
light = "#c53b53";
114+
};
115+
diffContext = {
116+
dark = "#828bb8";
117+
light = "#7086b5";
118+
};
119+
diffHunkHeader = {
120+
dark = "#828bb8";
121+
light = "#7086b5";
122+
};
123+
diffHighlightAdded = {
124+
dark = "#1d572d";
125+
light = "#4db380";
126+
};
127+
diffHighlightRemoved = {
128+
dark = "#7f302f";
129+
light = "#f52a65";
130+
};
131+
diffAddedBg = {
132+
dark = "#14261d";
133+
light = "#d5e5d5";
134+
};
135+
diffRemovedBg = {
136+
dark = "#301b1e";
137+
light = "#f7d8db";
138+
};
139+
diffContextBg = {
140+
dark = "darkBg";
141+
light = "lightBg";
142+
};
143+
diffLineNumber = {
144+
dark = "darkBg";
145+
light = "lightBg";
146+
};
147+
diffAddedLineNumberBg = {
148+
dark = "#1f4428";
149+
light = "#c5d5c5";
150+
};
151+
diffRemovedLineNumberBg = {
152+
dark = "#552527";
153+
light = "#e7c8cb";
154+
};
155+
markdownText = {
156+
dark = "darkFgBase";
157+
light = "lightFgBase";
158+
};
159+
markdownHeading = {
160+
dark = "darkUnimportant";
161+
light = "lightUnimportant";
162+
};
163+
markdownLink = {
164+
dark = "darkFg";
165+
light = "lightFg";
166+
};
167+
markdownLinkText = {
168+
dark = "darkCyan";
169+
light = "lightCyan";
170+
};
171+
markdownCode = {
172+
dark = "darkGreen";
173+
light = "lightGreen";
174+
};
175+
markdownBlockQuote = {
176+
dark = "darkYellow";
177+
light = "lightYellow";
178+
};
179+
markdownEmph = {
180+
dark = "darkYellow";
181+
light = "lightYellow";
182+
};
183+
markdownStrong = {
184+
dark = "darkOrange";
185+
light = "lightOrange";
186+
};
187+
markdownHorizontalRule = {
188+
dark = "darkUnimportant";
189+
light = "lightUnimportant";
190+
};
191+
markdownListItem = {
192+
dark = "darkFg";
193+
light = "lightFg";
194+
};
195+
markdownListEnumeration = {
196+
dark = "darkCyan";
197+
light = "lightCyan";
198+
};
199+
markdownImage = {
200+
dark = "darkFg";
201+
light = "lightFg";
202+
};
203+
markdownImageText = {
204+
dark = "darkCyan";
205+
light = "lightCyan";
206+
};
207+
markdownCodeBlock = {
208+
dark = "darkFgBase";
209+
light = "lightFgBase";
210+
};
211+
syntaxComment = {
212+
dark = "darkUnimportant";
213+
light = "lightUnimportant";
214+
};
215+
syntaxKeyword = {
216+
dark = "darkBlue";
217+
light = "lightBlue";
218+
};
219+
syntaxFunction = {
220+
dark = "darkFg";
221+
light = "lightFg";
222+
};
223+
syntaxVariable = {
224+
dark = "darkFgBase";
225+
light = "lightRed";
226+
};
227+
syntaxString = {
228+
dark = "darkGreen";
229+
light = "lightGreen";
230+
};
231+
syntaxNumber = {
232+
dark = "darkOrange";
233+
light = "lightOrange";
234+
};
235+
syntaxType = {
236+
dark = "darkYellow";
237+
light = "lightYellow";
238+
};
239+
syntaxOperator = {
240+
dark = "darkOrange";
241+
light = "lightOrange";
242+
};
243+
syntaxPunctuation = {
244+
dark = "darkUnimportant";
245+
light = "lightUnimportant";
246+
};
247+
};
248+
};
249+
}
250+

nix/modules/shell.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@
4444
];
4545
shellAbbrs = {
4646
a = "ambr";
47-
c = "claude";
4847
d = "docker";
4948
de = "delta";
5049
dc = "docker compose";
5150
g = "git";
5251
i = "iex";
5352
lsd = "eza -d .*";
5453
m = "mix";
54+
o = "opencode";
5555
p = "pnpm";
5656
v = "nvim";
5757
};

0 commit comments

Comments
 (0)