{ pkgs, spicetify-nix, ... }: let localFastModel = "qwen2.5-coder-num_ctx"; localReasoningModel = "deepseek-r1-num_ctx"; remoteFastModel = "deepseek/deepseek-chat-v3-0324:free"; # "qwen/qwen-2.5-coder-32b-instruct:free"; remoteReasoningModel = "deepseek/deepseek-r1-0528:free"; in { home = { stateVersion = "23.11"; packages = with pkgs; [ htop curl coreutils appcleaner nil grandperspective iterm2 nerd-fonts.jetbrains-mono signal-desktop-bin the-unarchiver bitwarden-desktop zoom-us teams-for-linux ncdu ]; shell = { enableNushellIntegration = true; enableZshIntegration = true; enableFishIntegration = true; }; }; programs = { helix = { enable = true; defaultEditor = true; settings = { editor.soft-wrap = { enable = true; }; }; }; nushell = { enable = true; settings = { completions = { algorithm = "fuzzy"; external.enable = true; }; }; shellAliases = { aichat_reasoning_remote = "aichat --model openrouter:${remoteReasoningModel}"; aichat_reasoning_local = "aichat --model ollama:${localReasoningModel}"; aichat_fast_remote = "aichat --model openrouter:${remoteFastModel}"; aichat_fast_local = "aichat --model ollama:${localFastModel}"; codex_remote = "codex --provider openrouter --model ${remoteFastModel}"; codex_local = "codex --provider ollama --model ${localFastModel}"; }; }; starship = { enable = true; }; carapace = { enable = true; }; git = { enable = true; delta = { enable = true; }; signing = { format = "openpgp"; signByDefault = true; }; userEmail = "contact@ethanreece.com"; userName = "Ethan Reece"; }; nix-your-shell = { enable = true; }; codex = { enable = true; custom-instructions = '' ## 10. Applying Patch Files with patch When the built-in `apply_patch` tool or `git apply` fails to apply a diff/patch file (especially if the file being patched contains special characters that might confuse simpler patch tools), the standard `patch` utility can be a more robust alternative. - **Patch File Format**: Ensure your patch file is in a standard unified diff format. Typically, these patches are generated with `git diff > my_feature.patch` or manually crafted. If the patch refers to files with `a/` and `b/` prefixes (e.g., `--- a/file.txt`, `+++ b/file.txt`), you'll use the `-p1` option. - **Creating the Patch File**: You can create a patch file using shell redirection, for example: ```bash` cat <<'EOF' > fix_descriptive_name.patch --- a/path/to/your/file.ext +++ b/path/to/your/file.ext @@ -line_num,num_lines +line_num,num_lines @@ context_or_change -old_line_content +new_line_content EOF ``` *Important*: Ensure the `EOF` marker is on its own line with no trailing spaces. - **Applying the Patch**: Use the `patch` command via the `shell` tool. The `-p1` option strips the leading component from file paths in the patch file (`a/`, `b/`). ``` # Example: Apply a patch file default_api.shell(command=["sh", "-c", "patch -p1 < fix_descriptive_name.patch"]) ``` - **Verification**: After applying, always verify that the target file has been changed as expected (e.g., using `cat` or `git diff`). - **Cleanup**: Remove the patch file if it's no longer needed: ``` default_api.shell(command=["rm", "fix_descriptive_name.patch"]) ``` ''; settings = { model = "${localFastModel}"; provider = "ollama"; providers = { ollama = { name = "Ollama"; baseURL = "http://localhost:11434/v1"; envKey = "OLLAMA_API_KEY"; }; openrouter = { name = "OpenRouter"; baseURL = "https://openrouter.ai/api/v1"; envKey = "OPENROUTER_API_KEY"; }; }; }; }; aichat = { enable = true; settings = { model = "ollama:${localFastModel}"; clients = [ { type = "openai-compatible"; name = "ollama"; api_base = "http://localhost:11434/v1"; models = [ { name = "${localFastModel}"; supports_function_calling = true; supports_vision = true; } { name = "${localReasoningModel}"; supports_function_calling = true; supports_vision = true; } ]; } { type = "openai-compatible"; name = "openrouter"; api_base = "https://openrouter.ai/api/v1"; models = [ { name = "${remoteFastModel}"; supports_function_calling = true; supports_vision = true; } { name = "${remoteReasoningModel}"; supports_function_calling = true; supports_vision = true; } ]; } ]; }; }; rbw = { enable = true; settings = { base_url = "vault.sudoer777.dev"; email = "vaultwarden@sudoer777.dev"; }; }; direnv = { enable = true; mise.enable = true; nix-direnv.enable = true; }; spicetify = let spicePkgs = spicetify-nix.legacyPackages.${pkgs.system}; in { enable = true; enabledExtensions = with spicePkgs.extensions; [ adblock hidePodcasts shuffle ]; theme = spicePkgs.themes.catppuccin; colorScheme = "mocha"; }; }; services = { gpg-agent = { enable = true; }; }; }