in conf/home/pi.scm.
* When Claude Code supports separating config from runtime state (e.g.
- separate CLAUDE_STATE_DIR env var), remove the symlink and --settings
- flag from the claude-code wrapper; point CLAUDE_CONFIG_DIR directly
- to $out/etc.
+ separate CLAUDE_STATE_DIR env var), remove the first-run seeding logic
+ from the claude-code wrapper and point CLAUDE_CONFIG_DIR directly to
+ $out/etc for truly immutable config. State would live in
+ CLAUDE_STATE_DIR (~/.local/state/claude) while config stays read-only
+ from the store.
* When Paseo triggers Claude Code from mobile, get-api-key runs pass(1) which
prompts for a GPG passphrase on a headless terminal — the session hangs.
currently spawn subshells or cd manually to operate in the right
directory. SetCwd would let them change the harness working
directory directly, eliminating the subshell overhead.
+
+* Remove claude-proxy once DeepSeek supports the Messages
+ API natively. Tracked at:
+ https://github.com/deepseek-ai/awesome-deepseek-agent/issues/284
{
+ "theme": "dark",
"env": {
"ANTHROPIC_BASE_URL": "https://api.deepseek.com/anthropic",
"ANTHROPIC_MODEL": "deepseek-v4-pro[1m]",
#:use-module (gnu packages tls)
#:use-module (gnu packages compression)
#:use-module (gnu packages bash)
- #:use-module (gnu packages elf)
#:export (claude-code))
(define settings-file
(let* ((out #$output)
(bin (string-append out "/bin"))
(etc (string-append out "/etc"))
- (binary (string-append bin "/claude"))
+ (libexec (string-append out "/libexec"))
+ (real-binary (string-append libexec "/claude"))
+ (wrapper (string-append bin "/claude"))
(api-helper (string-append etc "/get-api-key"))
- (patchelf #$(file-append patchelf "/bin/patchelf"))
+ (bash #$(file-append bash-minimal "/bin/bash"))
(ld-so #$(file-append glibc "/lib/ld-linux-x86-64.so.2"))
- (rpath (string-append #$glibc
- "/lib:"
- #$gcc:lib
- "/lib:"
- #$gcc:lib
- "/lib64:"
- #$openssl
- "/lib:"
- #$zlib
- "/lib")))
- ;; 1. Copy the binary and patch its ELF.
- (mkdir-p bin)
- (copy-file #$source binary)
- (chmod binary #o755)
- (invoke patchelf "--set-interpreter" ld-so binary)
- (invoke patchelf "--set-rpath" rpath binary)
- ;; 2. Copy and patch configuration files.
+ (lib-path (string-append (string-append #$glibc "/lib:")
+ (string-append #$gcc:lib "/lib:")
+ (string-append #$gcc:lib "/lib64:")
+ (string-append #$openssl "/lib:")
+ (string-append #$zlib "/lib"))))
+ ;; 1. Install the real binary in libexec.
+ (mkdir-p libexec)
+ (copy-file #$source real-binary)
+ (chmod real-binary #o755)
+ ;; 2. Copy and patch configuration.
(mkdir-p etc)
(copy-file #$instructions-file
(string-append etc "/CLAUDE.md"))
;; 3. Copy the API key helper.
(copy-file #$api-key-file api-helper)
(chmod api-helper #o755)
- ;; 4. Wrap the binary to set CLAUDE_CONFIG_DIR.
- ;; wrap-program needs bash in PATH for the shebang.
- (setenv "PATH"
- (string-append #$bash-minimal "/bin"))
- (wrap-program binary
- `("CLAUDE_CONFIG_DIR" =
- (,etc)))))))
+ ;; 4. Generate a wrapper that seeds a writable
+ ;; config directory in $HOME on first run,
+ ;; then invokes the binary through ld-linux.
+ (mkdir-p bin)
+ (with-output-to-file wrapper
+ (lambda ()
+ (format #t "#!~a~%" bash)
+ (format #t ": \"${HOME:=/root}\"~%")
+ (format #t "CONFIG_DIR=\"${HOME}/.config/claude\"~%")
+ (format #t "STORE_ETC=\"~a\"~%" etc)
+ (format #t "if [ ! -d \"${CONFIG_DIR}\" ]; then~%")
+ (format #t " mkdir -p \"${CONFIG_DIR}\"~%")
+ (format #t " cp \"${STORE_ETC}/settings.json\"")
+ (format #t " \"${CONFIG_DIR}/\"~%")
+ (format #t " cp \"${STORE_ETC}/CLAUDE.md\"")
+ (format #t " \"${CONFIG_DIR}/\"~%")
+ (format #t "fi~%")
+ (format #t "export CLAUDE_CONFIG_DIR=\"${CONFIG_DIR}\"~%")
+ (format #t "export LD_LIBRARY_PATH=\"~a:" lib-path)
+ (format #t "$LD_LIBRARY_PATH\"~%")
+ (format #t "exec ~a ~a \"$@\"~%" ld-so real-binary)))
+ (chmod wrapper #o755)))))
(inputs (list glibc
- `(,gcc "lib")
- openssl
- zlib
- bash-minimal
- patchelf))
+ `(,gcc "lib") openssl zlib bash-minimal))
(home-page "https://claude.ai")
(synopsis "Agentic coding tool that lives in your terminal")
- (description "Claude Code is a CLI tool that understands your codebase.")
+ (description "Claude Code is a CLI tool that understands your
+codebase.")
;; Claude Code is proprietary software, not end-user redistributable.
(license #f)))
(node #$(file-append node-lts "/bin/node"))
(bash #$(file-append bash-minimal
"/bin/bash"))
- (claude-etc #$(file-append claude-code
- "/etc"))
+ (config-dir "${HOME}/.config/claude")
(wrapper (string-append bin "/paseo")))
(mkdir-p bin)
(with-output-to-file wrapper
(format #t "#!~a~%" bash)
(format #t
"export CLAUDE_CONFIG_DIR=\"~a\"~%"
- claude-etc)
+ config-dir)
(format #t "exec ~a \"~a\" \"$@\"~%" node
entry-path)))
(chmod wrapper #o755))))))
(define-module (tests vps-home)
#:use-module (gnu packages admin)
#:use-module (gnu packages base)
- #:use-module (conf home claude)
- #:use-module (conf home paseo)
#:use-module (guix gexp)
#:use-module (tests vps-system)
#:use-module (vps-home)
(define %activate
(file-append vps-home-environment "/activate"))
+(define %herd
+ (file-append vps-home-environment "/profile/bin/herd"))
(define %timeout
(file-append coreutils "/bin/timeout"))
read-string)))
(car result)))
+(define (home-herd-body service)
+ `(let ((status (run (string-append ,%herd " status "
+ ,service))))
+ (and (car status)
+ (string-contains (cadr status) "It is running") #t)))
+
(define (assert-home marionette label body)
#~(test-assert #$label
(let ((result (marionette-eval '#$body
(format (current-error-port) "~a: ~s~%"
#$label result) #f)))))
-(define %paseo-timeout-body
- (let ((bin (file-append paseo "/bin/paseo"))
- (timeout (file-append coreutils "/bin/timeout")))
- `(let* ((st (system* ,timeout
- "5"
- ,bin
- "daemon"
- "start"
- "--foreground"))
- (rc (status:exit-val st)))
- (= rc 124))))
-
(define (vps-home-test-cases marionette)
#~(begin
(marionette-eval '#$%home-prelude
#$marionette)
#$(assert-home marionette "home: vps-home activates"
%home-activation-body)
- (test-assert "home: dak user exists"
- (marionette-eval '(file-exists? "/home/dak")
- #$marionette))
- (test-assert "home: claude binary exists"
- (marionette-eval '(file-exists? (string-append #$claude-code
- "/bin/claude"))
- #$marionette))
- (test-assert "home: paseo binary exists"
- (marionette-eval '(file-exists? (string-append #$paseo
- "/bin/paseo"))
- #$marionette))
- (test-assert "home: .guile exists"
- (marionette-eval '(file-exists? "/home/dak/.guile")
- #$marionette))
- (test-assert "paseo: daemon starts"
- (marionette-eval '#$%paseo-timeout-body
- #$marionette))))
+ #$(assert-home marionette "home: paseo-daemon is running"
+ (home-herd-body "paseo-daemon"))))