title: Export project config as environment variable

description: Export project configuration as home.sessionVariables (similar to zellij-ps pattern). Use JSON format for the env var since projects now have structured data (path + args).

status: closed

issue_type: task

close_reason: Added home.sessionVariables.ROFI_PROJECT_OPENER_CONFIG with JSON config

depends_on_id: nixpkgs-hrh

type: parent-child


title: Update rofi-project-opener script to pass args to opencode

description: Modify pkgs/rofi-project-opener script to read the new config format and launch opencode with: 'opencode <directory> <arguments>' instead of just 'opencode' in the directory.

close_reason: Script updated to read JSON config and pass args to opencode

depends_on_id: nixpkgs-sys

type: blocks


title: Update documentation to reflect latest changes

close_reason: Documentation updated: Added stt-ptt language support docs, rofi-project-opener module docs, and updated zellij-ps docs


title: Change projectDirs from list to attrset with path and args

description:
Change projectDirs option type from 'types.listOf types.str' to an attrset like:

projectDirs = {
  nixpkgs = { path = "~/p/NIX/nixpkgs"; args = "--agent Planner-Sisyphus"; };
  myproject = { path = "~/dev/myproject"; };  # args optional
};

Must maintain backward compatibility consideration.

close_reason: Changed projectDirs from listOf str to attrsOf submodule with path+args


title: Ensure docs are staged and committed

close_reason: Documentation staged and ready for commit


title: projectDirs on rofi-project-switcher should be exported to users home-manager environment

issue_type: feature

close_reason: Feature complete: config exported as ROFI_PROJECT_OPENER_CONFIG env var

issue_id: nixpkgs-hrh


title: feat: Add auto-language detection support to stt-ptt package

description:
## Current State
- **Package**: `/home/m3tam3re/p/NIX/nixpkgs/pkgs/stt-ptt/default.nix`
- **Module**: `/home/m3tam3re/p/NIX/nixpkgs/modules/home-manager/cli/stt-ptt.nix`
- **Current whisper-cli call** (line 55): `"$WHISPER" -m "$STT_MODEL" -f "$AUDIO" -np -nt 2>/dev/null`
- **Missing**: Language configuration option and auto-detection

## Required Changes

### 1. Update Package (`pkgs/stt-ptt/default.nix`)
Add support for language configuration:
- Add `STT_LANGUAGE` environment variable (default: "auto" for auto-detection)
- Modify whisper-cli call to use `-l "$STT_LANGUAGE"` flag
- Support the special value "auto" for automatic language detection
- Update help text to document the new environment variable

### 2. Update Home Manager Module (`modules/home-manager/cli/stt-ptt.nix`)
Add new `language` option:
- Add `language` option with type `types.enum ["auto" "en" "es" "fr" "de" "it" "pt" "ru" "zh" "ja" "ko" ...]`
- Default should be "auto" (auto-detect)
- Set `STT_LANGUAGE` environment variable in `home.sessionVariables`
- Add documentation describing available languages and auto-detection behavior
- Consider using `types.nullOr(types.str)` with "auto" as default for more flexibility

### 3. Technical Details
From whisper.cpp CLI documentation:
- `-l LANG, --language LANG [en] spoken language ('auto' for auto-detect)`
- Auto-detection analyzes audio to determine spoken language automatically
- Specifying a language can improve accuracy if you know the language
- Language codes follow ISO 639-1 standard (2-letter codes)

## Implementation Plan

### Package Changes:
```nix
# Add to environment variables section:
STT_LANGUAGE="${STT_LANGUAGE:-auto}"

# Modify whisper call:
"$WHISPER" -m "$STT_MODEL" -f "$AUDIO" -l "$STT_LANGUAGE" -np -nt 2>/dev/null

# Update help text:
echo "  STT_LANGUAGE       - Language code or 'auto' for auto-detection (default: auto)"
```

### Module Changes:
```nix
language = mkOption {
  type = types.enum ["auto" "en" "es" "fr" "de" "it" "pt" "ru" "zh" "ja" "ko"];
  default = "auto";
  description = ''
    Language for speech recognition. Use "auto" for automatic language detection,
    or specify a language code (e.g., "en", "es", "fr") for better accuracy.
    Auto-detection analyzes the audio to determine the spoken language.
  '';
};

home.sessionVariables = {
  STT_LANGUAGE = cfg.language;
  # ... existing variables
};
```

## Benefits
- **Multilingual support**: Users can speak in any language
- **Convenience**: Auto-detection eliminates need to specify language
- **Accuracy**: Explicit language selection improves transcription accuracy
- **Backward compatible**: Default behavior (auto) matches current functionality

## Testing Considerations
1. Test auto-detection with multiple languages
2. Test explicit language selection
3. Test fallback behavior when auto-detection fails
4. Test with different Whisper models

## Related
- whisper.cpp supports 100+ languages
- Language codes follow ISO 639-1 standard
- Auto-detection adds slight processing overhead

close_reason: Implemented auto-language detection support: Added STT_LANGUAGE environment variable to package, modified whisper-cli call to use -l flag, updated help text, and added language option to HM module with enum support for 23 common languages plus 'auto'.


title: Update config file format to include args per project

description: Update the config file at ~/.config/rofi-project-opener/config to support per-project args. Change from PROJECT_DIRS to a format that encodes both path and args, e.g. JSON or structured text.

close_reason: Config file now writes JSON (projects.json) with per-project path and args

issue_id: nixpkgs-sys


title: projectDirs should support args, for example --agent <agentname>

description: This means project directories need to be an attribute set and we also need to change the launch command to "opencode <directory name> <arguments>".

close_reason: Feature complete: projectDirs now supports args per directory