nixos/appflakes/octofriend/README.md
Julian Sutter 00eb03dcd2 Add octofriend configuration to flake
- Embed octofriend.json5 config directly in flake.nix postInstall
- Set OCTOFRIEND_CONFIG_DIR to point to included config
- Add comprehensive README with setup and configuration instructions
- Keep API keys out of repo for security (users must add keys.json5 locally)
2025-12-18 21:12:48 -08:00

64 lines
No EOL
2.1 KiB
Markdown

# Octofriend flake for Nix/NixOS
This flake packages [octofriend](https://github.com/synthetic-lab/octofriend), a CLI coding assistant.
## Building
```bash
nix build .
```
## Running
```bash
nix run .
```
## Installation
Add to your NixOS configuration:
```nix
inputs.octofriend.url = "path:/home/jsutter/src/nixos/appflakes/octofriend";
# Then in your environment.systemPackages or home.packages:
self.inputs.octofriend.packages.${system}.default
```
## Configuration
The octofriend flake includes default configuration files at `/share/octofriend/config/octofriend.json5`. However, API keys should not be stored in the repository for security reasons.
### Default Configuration
The included configuration provides:
- Your name as 'Jules'
- Two model configurations (GLM-4.6 and MiniMax M2) pointing to https://api.synthetic.new
- Specialized models for diff-apply and fix-json operations
### API Keys
To configure API keys, create a `keys.json5` file in your configuration directory:
```json5
{
'https://api.synthetic.new/v1': 'your-api-key-here'
}
```
When using octofriend, you can either:
1. Place your keys in `~/.config/octofriend/keys.json5` (default location)
2. Set the `OCTOFRIEND_CONFIG_DIR` environment variable to a custom directory containing your files
This ensures sensitive API keys are not committed to the repository while still providing functional default configuration.
### Custom Configuration
If you want to override the default configuration, you can create your own `octofriend.json5` file in your config directory. The wrapper script will check for configuration files in the following order:
1. `$OCTOFRIEND_CONFIG_DIR/octofriend.json5` (if OCTOFRIEND_CONFIG_DIR is set)
2. `~/.config/octofriend/octofriend.json5`
3. Fall back to the included default at `$OCTOFRIEND_PACKAGE_DIR/share/octofriend/config/octofriend.json5`
## Security Note
- The `keys.json5` file containing API keys is intentionally NOT included in this flake
- Never commit API keys to any repository
- The included configuration uses placeholder settings and should be customized with your actual model preferences and endpoints