mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
claude-code: added memories (claude.md) generation
This commit is contained in:
parent
17a1004948
commit
343e555657
6 changed files with 90 additions and 0 deletions
|
|
@ -14,9 +14,16 @@
|
|||
];
|
||||
};
|
||||
};
|
||||
|
||||
# assert fail: cannot set text and source at the same time.
|
||||
memory = {
|
||||
text = "Some text content";
|
||||
source = ./expected-memory.md;
|
||||
};
|
||||
};
|
||||
|
||||
test.asserts.assertions.expected = [
|
||||
"`programs.claude-code.package` cannot be null when `mcpServers` is configured"
|
||||
"Cannot specify both `programs.claude-code.memory.text` and `programs.claude-code.memory.source`"
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,4 +3,6 @@
|
|||
claude-code-full-config = ./full-config.nix;
|
||||
claude-code-mcp = ./mcp.nix;
|
||||
claude-code-assertion = ./assertion.nix;
|
||||
claude-code-memory-management = ./memory-management.nix;
|
||||
claude-code-memory-from-source = ./memory-from-source.nix;
|
||||
}
|
||||
|
|
|
|||
8
tests/modules/programs/claude-code/expected-memory.md
Normal file
8
tests/modules/programs/claude-code/expected-memory.md
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
# Project Memory
|
||||
|
||||
## Current Task
|
||||
Test implementation of memory management.
|
||||
|
||||
## Key Context
|
||||
- This is a test configuration
|
||||
- Memory should be created at ~/.claude/CLAUDE.md
|
||||
13
tests/modules/programs/claude-code/memory-from-source.nix
Normal file
13
tests/modules/programs/claude-code/memory-from-source.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
programs.claude-code = {
|
||||
enable = true;
|
||||
memory = {
|
||||
source = ./expected-memory.md;
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.claude/CLAUDE.md
|
||||
assertFileContent home-files/.claude/CLAUDE.md ${./expected-memory.md}
|
||||
'';
|
||||
}
|
||||
22
tests/modules/programs/claude-code/memory-management.nix
Normal file
22
tests/modules/programs/claude-code/memory-management.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
programs.claude-code = {
|
||||
enable = true;
|
||||
memory = {
|
||||
text = ''
|
||||
# Project Memory
|
||||
|
||||
## Current Task
|
||||
Test implementation of memory management.
|
||||
|
||||
## Key Context
|
||||
- This is a test configuration
|
||||
- Memory should be created at ~/.claude/CLAUDE.md
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.claude/CLAUDE.md
|
||||
assertFileContent home-files/.claude/CLAUDE.md ${./expected-memory.md}
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue