summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitch Taylor <mitch@mitchtaylor.xyz>2026-03-21 18:05:52 -0300
committerMitch Taylor <mitch@mitchtaylor.xyz>2026-03-21 18:05:52 -0300
commite47ce35075754570df3bca6173229d5285d63ebb (patch)
tree67702d2fd27598805bf7aaa0d8dff07d3ed8378e
parentc2a96b0c2be52d5fe2c052e710a7ad1711dd6e25 (diff)
use tgz instead of go-git because i got filtered
-rw-r--r--mitch/tailscale.scm134
1 files changed, 24 insertions, 110 deletions
diff --git a/mitch/tailscale.scm b/mitch/tailscale.scm
index e000ac8..b6a5265 100644
--- a/mitch/tailscale.scm
+++ b/mitch/tailscale.scm
@@ -4,8 +4,7 @@
#:use-module (guix gexp)
#:use-module (guix download)
#:use-module (guix packages)
- #:use-module (guix build-system go)
- #:use-module (gnu packages golang)
+ #:use-module (guix build-system copy)
#:use-module (guix records)
#:use-module (ice-9 match)
#:use-module (guix git-download)
@@ -13,117 +12,32 @@
#:use-module (gnu packages compression)
#:use-module (gnu packages base)
#:use-module (gnu)
- #:use-module (gnu services shepherd))
-
-(define-record-type* <go-git-reference>
- go-git-reference make-go-git-reference
- go-git-reference?
- (url go-git-reference-url)
- (commit go-git-reference-commit)
- (sha go-git-reference-sha256))
-
-(define-record-type* <go-url-reference>
- go-url-reference make-go-url-reference
- go-url-reference?
- (url go-url-reference-url)
- (sha go-url-reference-sha))
-
-(define* (go-fetch-vendored uri hash-algorithm hash-value name #:key system)
- (let ((src
- (match uri
- (($ <go-git-reference> url commit sha)
- (origin
- (method git-fetch)
- (uri (git-reference
- (url url)
- (commit commit)))
- (sha256 sha)))
- (($ <go-url-reference> url commit sha)
- (origin
- (method url-fetch)
- (uri url)
- (sha256 sha)))))
- (name (or name "go-git-checkout")))
- (gexp->derivation
- (string-append name "-vendored.tar.gz")
- (with-imported-modules '((guix build utils))
- #~(begin
- (use-modules (guix build utils))
- (let ((inputs (list
- #+go-1.23
- #+tar
- #+bzip2
- #+gzip)))
- (set-path-environment-variable "PATH" '("/bin") inputs))
- (mkdir "source")
- (chdir "source")
- (if (file-is-directory? #$src) ;; this is taken (lightly edited) from unpack in gnu-build-system.scm
- (begin
- ;; Preserve timestamps (set to the Epoch) on the copied tree so that
- ;; things work deterministically.
- (copy-recursively #$src "."
- #:keep-mtime? #t)
- ;; Make the source checkout files writable, for convenience.
- (for-each (lambda (f)
- (false-if-exception (make-file-writable f)))
- (find-files ".")))
- (begin
- (cond
- ((string-suffix? ".zip" #$src)
- (invoke "unzip" #$src))
- ((tarball? #$src)
- (invoke "tar" "xvf" #$src))
- (else
- (let ((name (strip-store-file-name #$src))
- (command (compressor #$src)))
- (copy-file #$src name)
- (when command
- (invoke command "--decompress" name)))))))
-
- (setenv "GOCACHE" "/tmp/gc")
- (setenv "GOMODCACHE" "/tmp/gmc")
- (setenv "SSL_CERT_DIR" #+(file-append nss-certs "/etc/ssl/certs/"))
-
- (invoke "go" "mod" "vendor")
-
- (invoke "tar" "czvf" #$output
- ;; Avoid non-determinism in the archive.
- "--mtime=@0"
- "--owner=root:0"
- "--group=root:0"
- "--sort=name"
- "--hard-dereference"
- ".")))
- #:hash hash-value
- #:hash-algo hash-algorithm)))
+ #:use-module (gnu services shepherd)
+ #:use-module (gnu packages linux))
(define-public tailscale
- (let ((version "1.96.3"))
+ (let ((version "1.96.2"))
(package
- (name "tailscale")
- (version version)
- (source (origin
- (method go-fetch-vendored)
- (uri (go-git-reference
- (url "https://github.com/tailscale/tailscale")
- (commit "v1.96.3")
- (sha (base32 "16i18j2v1qbwlnwbh8vxalrxjn69h3cdrlvvjvn10dqzga3d2ifc"))))
- (sha256
- (base32
- "19sv3q0hgb1h5v75c8hrkna4xgbgrs0ym2kvq16rbn9kr0hjjr1j"))))
- (build-system go-build-system)
- (arguments
- `(#:import-path "tailscale.com/cmd/tailscale"
- #:unpack-path "tailscale.com"
- #:install-source? #f
- #:phases
- (modify-phases %standard-phases
- (delete 'check))
- #:go ,go-1.23))
- (home-page "https://tailscale.com")
- (synopsis "Tailscale client")
- (description "Tailscale client")
- (license license:bsd-3))))
+ (name "tailscale")
+ (version version)
+ (source (origin
+ (method url-fetch/tarbomb)
+ (uri (string-append "https://pkgs.tailscale.com/stable/tailscale_" version
+ "_amd64.tgz"))
+ (sha256
+ (base32
+ "00blgy5j5x0zp45xvy421mpkg5bdvzf2gnbywil3rnspxhysz8na"))))
+ (build-system copy-build-system)
+ (arguments
+ (list
+ #:install-plan
+ #~`((,(string-append "tailscale_" #$version "_amd64/") "/bin/"))))
+ (propagated-inputs ; iptables is required for setting up routing
+ (list iptables))
+ (home-page "https://tailscale.com")
+ (synopsis "Tailscale client")
+ (description "Tailscale client")
+ (license license:bsd-3))))
(define-public tailscaled
(let ((import-path "tailscale.com/cmd/tailscaled"))