]> git.ekhem.eu.org Git - guix.git/commitdiff
[home] Extract claude-code package to its own module.
authorJakub Czajka <jakub@ekhem.eu.org>
Thu, 9 Jul 2026 13:04:33 +0000 (15:04 +0200)
committerJakub Czajka <jakub@ekhem.eu.org>
Thu, 9 Jul 2026 14:01:17 +0000 (16:01 +0200)
Co-Authored-By: Claude <noreply@anthropic.com>
conf/home/claude-code.scm [deleted file]
conf/home/claude.scm

diff --git a/conf/home/claude-code.scm b/conf/home/claude-code.scm
deleted file mode 100644 (file)
index edcac1b..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-;; Copyright (c) 2026 Jakub Czajka <jakub@ekhem.eu.org>
-;; License: GPL-3.0 or later.
-;;
-;; claude-code.scm - package definition for Claude Code.
-;;
-;; The upstream binary is prebuilt for systems with Filesystem Hierarchy
-;; Standard and expects a standard linker path. GNU Guix uses non-standard store
-;; paths, so we wrap the binary in a shell script that sets LD_LIBRARY_PATH to
-;; the store locations of its dependencies and invokes it through ld-linux.
-
-(define-module (conf home claude-code)
-  #:use-module (guix packages)
-  #:use-module (guix download)
-  #:use-module (guix gexp)
-  #:use-module (guix build-system trivial)
-  #:use-module (gnu packages base)
-  #:use-module (gnu packages gcc)
-  #:use-module (gnu packages tls)
-  #:use-module (gnu packages compression)
-  #:use-module (gnu packages bash)
-  #:export (claude-code))
-
-(define claude-code
-  (package
-    (name "claude-code")
-    (version "2.1.185")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (string-append "https://downloads.claude.ai/claude-code-releases/"
-             version "/linux-x64/claude"))
-       (sha256
-        (base32 "0lir62y47bbdkkkbs505issbm86p9rnkzvkxc87fw14zd4w66971"))))
-    (build-system trivial-build-system)
-    (arguments
-     (list
-      #:modules '((guix build utils))
-      #:builder
-      #~(begin
-          (use-modules (guix build utils))
-          (let* ((out #$output)
-                 (bin (string-append out "/bin"))
-                 (internal-bin (string-append out "/libexec"))
-                 (real-binary (string-append internal-bin "/claude"))
-                 (wrapper (string-append bin "/claude"))
-                 (bash (string-append #$bash-minimal "/bin/bash"))
-                 (ld-linux (string-append #$glibc "/lib/ld-linux-x86-64.so.2"))
-                 ;; Define runtime library path for the wrapper.
-                 (lib-path (string-append #$glibc
-                                          "/lib:"
-                                          #$gcc:lib
-                                          "/lib:"
-                                          #$gcc:lib
-                                          "/lib64:"
-                                          #$openssl
-                                          "/lib:"
-                                          #$zlib
-                                          "/lib")))
-            ;; 1. Copy the raw binary into an isolated internal path.
-            (mkdir-p internal-bin)
-            (copy-file #$source real-binary)
-            (chmod real-binary #o755)
-            ;; 2. Generate a shell wrapper that invokes the binary
-            ;; using Guix's linker.
-            (mkdir-p bin)
-            (with-output-to-file wrapper
-              (lambda ()
-                (format #t "#!~a~%" bash)
-                (format #t "export LD_LIBRARY_PATH=\"~a:" lib-path)
-                (format #t "$LD_LIBRARY_PATH\"~%")
-                ;; Invoke the explicit linker, passing CLI args.
-                (format #t "exec ~a ~a \"$@\"~%" ld-linux real-binary)))
-            (chmod wrapper #o755)))))
-    (inputs (list glibc
-                  `(,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.")
-    ;; Claude Code is proprietary software, not end-user redistributable.
-    (license #f)))
index 47f0183674901b903bf3ef3379aa4541131a0b4e..d68c1221abc4355f64fd0d82da4d64fb6732a534 100644 (file)
@@ -1,13 +1,85 @@
 ;; Copyright (c) 2026 Jakub Czajka <jakub@ekhem.eu.org>
 ;; License: GPL-3.0 or later.
 ;;
-;; claude.scm - Claude Code home service with dotfiles.
+;; claude.scm - Claude Code package and home service with dotfiles.
+;;
+;; The upstream binary is prebuilt for systems with Filesystem Hierarchy
+;; Standard and expects a standard linker path. GNU Guix uses non-standard store
+;; paths, so we wrap the binary in a shell script that sets LD_LIBRARY_PATH to
+;; the store locations of its dependencies and invokes it through ld-linux.
 
 (define-module (conf home claude)
-  #:use-module (conf home claude-code)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix gexp)
+  #:use-module (guix build-system trivial)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages gcc)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages bash)
   #:use-module (conf home program)
   #:use-module (gnu services)
-  #:export (claude-service))
+  #:export (claude-code claude-service))
+
+(define claude-code
+  (package
+    (name "claude-code")
+    (version "2.1.185")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://downloads.claude.ai/claude-code-releases/"
+             version "/linux-x64/claude"))
+       (sha256
+        (base32 "0lir62y47bbdkkkbs505issbm86p9rnkzvkxc87fw14zd4w66971"))))
+    (build-system trivial-build-system)
+    (arguments
+     (list
+      #:modules '((guix build utils))
+      #:builder
+      #~(begin
+          (use-modules (guix build utils))
+          (let* ((out #$output)
+                 (bin (string-append out "/bin"))
+                 (internal-bin (string-append out "/libexec"))
+                 (real-binary (string-append internal-bin "/claude"))
+                 (wrapper (string-append bin "/claude"))
+                 (bash (string-append #$bash-minimal "/bin/bash"))
+                 (ld-linux (string-append #$glibc "/lib/ld-linux-x86-64.so.2"))
+                 ;; Define runtime library path for the wrapper.
+                 (lib-path (string-append #$glibc
+                                          "/lib:"
+                                          #$gcc:lib
+                                          "/lib:"
+                                          #$gcc:lib
+                                          "/lib64:"
+                                          #$openssl
+                                          "/lib:"
+                                          #$zlib
+                                          "/lib")))
+            ;; 1. Copy the raw binary into an isolated internal path.
+            (mkdir-p internal-bin)
+            (copy-file #$source real-binary)
+            (chmod real-binary #o755)
+            ;; 2. Generate a shell wrapper that invokes the binary
+            ;; using Guix's linker.
+            (mkdir-p bin)
+            (with-output-to-file wrapper
+              (lambda ()
+                (format #t "#!~a~%" bash)
+                (format #t "export LD_LIBRARY_PATH=\"~a:" lib-path)
+                (format #t "$LD_LIBRARY_PATH\"~%")
+                ;; Invoke the explicit linker, passing CLI args.
+                (format #t "exec ~a ~a \"$@\"~%" ld-linux real-binary)))
+            (chmod wrapper #o755)))))
+    (inputs (list glibc
+                  `(,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.")
+    ;; Claude Code is proprietary software, not end-user redistributable.
+    (license #f)))
 
 (define claude-dotfiles
   (list "claude/.config/claude/settings.json"