feat: comprehensive NixOS and home-manager configuration updates

This commit includes significant updates to the Nix configuration including:
- Added common NixOS module with system packages
- Updated home-manager configurations for various systems
- Enhanced terminal programs including Claude Code integration
- Updated LLM server configurations with new models
- Improved btop configuration with custom package
- Added opencode support with permission settings
- Updated tmux and nvim configurations

The changes introduce new features, update existing configurations, and improve the overall system setup.
This commit is contained in:
2025-12-14 16:24:11 -05:00
parent 80033fd2ae
commit e947e13a02
11 changed files with 182 additions and 29 deletions

View File

@@ -1,4 +1,9 @@
{ lib, config, namespace, ... }:
{ lib
, pkgs
, config
, namespace
, ...
}:
let
inherit (lib) mkIf;
cfg = config.${namespace}.programs.terminal.btop;
@@ -9,10 +14,12 @@ in
};
config = mkIf cfg.enable {
programs.btop.enable = true;
programs.btop = {
enable = true;
package = pkgs.btop-cuda;
};
home.file.".config/btop/btop.conf".text =
builtins.readFile ./config/btop.conf;
home.file.".config/btop/btop.conf".text = builtins.readFile ./config/btop.conf;
home.file.".config/btop/themes/catppuccin_mocha.theme".text =
builtins.readFile ./config/catppuccin_mocha.theme;
};

View File

@@ -0,0 +1,81 @@
{ lib
, pkgs
, config
, namespace
, ...
}:
let
inherit (lib) mkIf;
cfg = config.${namespace}.programs.terminal.claude-code;
in
{
options.${namespace}.programs.terminal.claude-code = {
enable = lib.mkEnableOption "enable claude-code";
};
config = mkIf cfg.enable {
programs.claude-code = {
enable = true;
mcpServers = {
gopls = {
type = "stdio";
command = "gopls";
args = [ "mcp" ];
};
};
};
programs.bash = lib.mkIf config.programs.bash.enable {
shellAliases = {
claude = "default_claude_custom";
};
initExtra =
let
baseUrl = "https://llm-api.va.reichard.io";
authToken = "placeholder";
in
''
default_claude_custom() {
local model_id=""
while [[ $# -gt 0 ]]; do
case $1 in
-m|--model)
model_id="$2"
shift 2
;;
*)
shift
;;
esac
done
if [ -z "$model_id" ]; then
echo "Error: Model ID is required. Usage: claude --model <model-id>"
return 1
fi
ANTHROPIC_BASE_URL="${baseUrl}" \
ANTHROPIC_AUTH_TOKEN="${authToken}" \
ANTHROPIC_MODEL="$model_id" \
ANTHROPIC_SMALL_FAST_MODEL="$model_id" \
${lib.getExe pkgs.claude-code}
}
# Completion Function
_complete_claude_custom() {
local cur=''${COMP_WORDS[COMP_CWORD]}
local prev=''${COMP_WORDS[COMP_CWORD-1]}
if [[ "$prev" == "-m" || "$prev" == "--model" ]]; then
local models=( $(${pkgs.curl}/bin/curl -s -H "Authorization: Bearer ${authToken}" "${baseUrl}/v1/models" | ${pkgs.jq}/bin/jq -r '.data[].id' 2>/dev/null) )
COMPREPLY=( $(compgen -W "''${models[*]}" -- "$cur") )
fi
}
# Register Completion
complete -F _complete_claude_custom claude
'';
};
};
}

View File

@@ -1,6 +1,9 @@
local llm_endpoint = "https://llm-api.va.reichard.io"
local llm_assistant_model = "gpt-oss-20b-thinking"
local llm_infill_model = "qwen2.5-coder-3b-instruct"
-- local llm_assistant_model = "gpt-oss-20b-thinking"
-- local llm_infill_model = "qwen2.5-coder-3b-instruct"
local llm_assistant_model = "qwen3-30b-2507-instruct"
local llm_infill_model = llm_assistant_model
-- Default Llama - Toggle Llama & Copilot
-- vim.g.copilot_filetypes = { ["*"] = false }

View File

@@ -1,4 +1,5 @@
{ lib
, pkgs
, config
, namespace
, ...
@@ -18,6 +19,22 @@ in
enableMcpIntegration = true;
settings = {
theme = "catppuccin";
permission = {
edit = "allow";
bash = "ask";
webfetch = "ask";
doom_loop = "ask";
external_directory = "ask";
};
lsp = {
nil = {
command = [
"${pkgs.nil}/bin/nil"
"--stdio"
];
extensions = [ ".nix" ];
};
};
provider = {
"llama-swap" = {
npm = "@ai-sdk/openai-compatible";

View File

@@ -1,4 +1,9 @@
{ lib, pkgs, config, namespace, ... }:
{ lib
, pkgs
, config
, namespace
, ...
}:
let
inherit (lib) mkIf;
cfg = config.${namespace}.programs.terminal.tmux;

View File

@@ -0,0 +1,6 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
wget
];
}