From: Jakub Czajka Date: Sat, 20 Jun 2026 22:39:24 +0000 (+0200) Subject: [home] Introduce Claude Code settings.json installed via Guix home. X-Git-Url: https://git.ekhem.eu.org/?a=commitdiff_plain;h=d38abb94727c8039b1d269fb79ea1632cef50dd6;p=guix.git [home] Introduce Claude Code settings.json installed via Guix home. - Add claude/.config/claude/settings.json with model overrides, max - effort and apiKeyHelper wired to pass. - Add conf/home/claude.scm service module bundling the claude-code package with its dotfile. - Wire claude-service into home.scm, replacing the raw claude-code package. Co-Authored-By: Claude Opus 4.8 --- diff --git a/claude/.config/claude/settings.json b/claude/.config/claude/settings.json new file mode 100644 index 0000000..5cd0677 --- /dev/null +++ b/claude/.config/claude/settings.json @@ -0,0 +1,12 @@ +{ + "env": { + "ANTHROPIC_BASE_URL": "https://api.deepseek.com/anthropic", + "ANTHROPIC_MODEL": "deepseek-v4-pro[1m]", + "ANTHROPIC_DEFAULT_OPUS_MODEL": "deepseek-v4-pro[1m]", + "ANTHROPIC_DEFAULT_SONNET_MODEL": "deepseek-v4-pro[1m]", + "ANTHROPIC_DEFAULT_HAIKU_MODEL": "deepseek-v4-flash", + "CLAUDE_CODE_SUBAGENT_MODEL": "deepseek-v4-flash", + "CLAUDE_CODE_EFFORT_LEVEL": "max" + }, + "apiKeyHelper": "${HOME}/.local/bin/get-api-key" +} diff --git a/claude/.local/bin/get-api-key b/claude/.local/bin/get-api-key new file mode 100755 index 0000000..c42ed7d --- /dev/null +++ b/claude/.local/bin/get-api-key @@ -0,0 +1,20 @@ +#!/bin/sh +# Copyright (c) 2026 Jakub Czajka +# License: GPL-3.0 or later. +# +# Cache the API key in a per-session tmpfs so pass(1) only prompts for the GPG +# password once per login session. + +set -o errexit + +GUIX_BIN="/run/current-system/profile/bin" +CACHE="${XDG_RUNTIME_DIR:-/tmp}/claude-apikey" + +if [ -f "${CACHE}" ]; then + "${GUIX_BIN}/cat" "${CACHE}" +else + (umask 077; pass show platforms/deepseek \ + | "${GUIX_BIN}/sed" --quiet 's/^api-key: //p' \ + > "${CACHE}") + "${GUIX_BIN}/cat" "${CACHE}" +fi diff --git a/conf/home/claude.scm b/conf/home/claude.scm new file mode 100644 index 0000000..5598093 --- /dev/null +++ b/conf/home/claude.scm @@ -0,0 +1,19 @@ +;; Copyright (c) 2026 Jakub Czajka +;; License: GPL-3.0 or later. +;; +;; claude.scm - Claude Code home service with dotfiles. + +(define-module (conf home claude) + #:use-module (conf home claude-code) + #:use-module (conf home program) + #:use-module (gnu services) + #:export (claude-service)) + +(define claude-dotfiles + (list "claude/.config/claude/settings.json" + "claude/.local/bin/get-api-key")) + +(define claude-service + (service home-program-service-type + (home-program-configuration (packages (list claude-code)) + (dotfiles claude-dotfiles)))) diff --git a/home.scm b/home.scm index ddc4b94..a344388 100644 --- a/home.scm +++ b/home.scm @@ -9,7 +9,7 @@ (use-modules (gnu home) (conf home bash) - (conf home claude-code) + (conf home claude) (conf home emoji) (conf home desktop) (conf home emacs) @@ -23,15 +23,15 @@ (home-environment (packages (case profile ((nonfree) - (list claude-code firefox select-emoji st-libxft-bgra)) + (list firefox select-emoji st-libxft-bgra)) ((libre) (list icecat-minimal select-emoji st-libxft-bgra)))) (services (case profile ((nonfree) - (append (list autorandr-service channels-service notify-service - screenshot-service) bash-services desktop-services - emacs-services)) + (append (list autorandr-service channels-service claude-service + notify-service screenshot-service) bash-services + desktop-services emacs-services)) ((libre) (append (list autorandr-service notify-service screenshot-service) bash-services desktop-services emacs-services))))))