# SPDX-FileCopyrightText: 2025 Ethan Reece # # SPDX-License-Identifier: MIT { config, inputs, pkgs, username, homeDirectory, ... }: let llm = { local = { key = "ollama"; name = "ollama"; url = "http://localhost:11434/v1"; env = "OLLAMA_API_KEY"; models = { fast = { key = "qwen2.5-coder-num_ctx"; name = "Qwen 2.5 Coder"; tools = true; tool_call = true; reasoning = false; temperature = true; vision = true; }; reasoning = { key = "deepseek-r1-num_ctx"; name = "R1"; tools = true; tool_call = true; reasoning = true; temperature = true; vision = true; }; }; }; }; in { imports = [ inputs.spicetify-nix.homeManagerModules.spicetify ../base.nix ]; sops.age.keyFile = "${homeDirectory}/Library/Application Support/sops/age/keys.txt"; home = { inherit username homeDirectory; packages = [ config.stylix.fonts.monospace.package pkgs.appcleaner pkgs.bitwarden-desktop pkgs.grandperspective pkgs.iproute2mac pkgs.iterm2 pkgs.julia-bin pkgs.signal-desktop-bin pkgs.teams-for-linux pkgs.the-unarchiver pkgs.zoom-us ]; }; programs = { nushell.shellAliases = { aichat_reasoning_local = "${pkgs.aichat}/bin/aichat --model ${llm.local.key}:${llm.local.models.reasoning.key}"; aichat_fast_local = "${pkgs.aichat}/bin/aichat --model ${llm.local.key}:${llm.local.models.fast.key}"; codex_local = "${pkgs.codex}/bin/codex --profile fast_local"; }; spicetify = let spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system}; in { enable = true; enabledExtensions = with spicePkgs.extensions; [ adblock hidePodcasts shuffle ]; }; codex = { settings = { model_providers = { ${llm.local.key} = { name = llm.local.name; base_url = llm.local.url; }; }; profiles = { fast_local = { model = llm.local.models.fast.key; model_provider = llm.local.key; }; reasoning_local = { model = llm.local.models.reasoning.key; model_provider = llm.local.key; }; }; }; }; opencode = { settings = { provider = { ${llm.local.key} = { npm = "@ai-sdk/openai-compatible"; name = llm.local.name; options = { baseURL = llm.local.url; }; models = { ${llm.local.models.fast.key} = ( let model = llm.local.models.fast; in { id = model.key; name = model.name; options = { tools = model.tools; }; tool_call = model.tool_call; reasoning = model.reasoning; temperature = model.temperature; } ); ${llm.local.models.reasoning.key} = ( let model = llm.local.models.reasoning; in { id = model.key; name = model.name; options = { tools = model.tools; }; tool_call = model.tool_call; reasoning = model.reasoning; temperature = model.temperature; } ); }; }; }; }; }; aichat = { settings = { clients = [ { type = "openai-compatible"; name = llm.local.key; api_base = llm.local.url; models = [ ( let model = llm.local.models.fast; in { name = model.key; supports_function_calling = model.tools; supports_vision = model.vision; } ) ( let model = llm.local.models.reasoning; in { name = model.key; supports_function_calling = model.tools; supports_vision = model.vision; } ) ]; } ]; }; }; }; catppuccin = { gtk.icon.enable = false; }; }