summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2024-08-23 19:14:52 -0300
committerEuAndreh <eu@euandre.org>2024-08-23 19:14:52 -0300
commitce4193929de3d1b854e289e630b517ecfb33a035 (patch)
treea1a1d1716259eb20a6a57664fcc9e249b149e110
parentsystem.scm: Simple reorder of pkg:syskeep-service-type (diff)
downloadasami-ce4193929de3d1b854e289e630b517ecfb33a035.tar.gz
asami-ce4193929de3d1b854e289e630b517ecfb33a035.tar.xz
system.scm: Greatly simplify go-latest by using (options->transformation ...)
-rw-r--r--src/guix/system.scm40
1 files changed, 10 insertions, 30 deletions
diff --git a/src/guix/system.scm b/src/guix/system.scm
index f6e6d1c..c27f602 100644
--- a/src/guix/system.scm
+++ b/src/guix/system.scm
@@ -7,6 +7,7 @@
(gnu)
(guix git-download)
(guix packages)
+ (guix transformations)
(guix utils))
(use-package-modules)
(use-service-modules
@@ -27,33 +28,12 @@
(pkg:slurp
(string-append "src/versions/" name "/" s))))
-(define (go-latest pkg)
+(define (latest pkg)
(let* ((name (package-name pkg))
(version (cat name "version"))
- (checksum (cat name "sha256")))
- (package
- (inherit pkg)
- (version version)
- (source
- (origin
- (inherit (package-source pkg))
- (uri
- (git-reference
- (url
- (pkg:str "git://papo.im/" name))
- (commit version)))
- (sha256
- (base32 checksum))
- (file-name
- (git-file-name name version))))
- (arguments
- (substitute-keyword-arguments (package-arguments pkg)
- ((#:make-flags _flags)
- #~(list
- "-e"
- (string-append "PREFIX=" #$output)
- (string-append "VERSION=" #$version)
- (string-append "CC=" #$(cc-for-target)))))))))
+ (trans-fn (options->transformation
+ `((with-commit . ,(pkg:fmt "~a=~a" name version))))))
+ (trans-fn pkg)))
@@ -130,11 +110,11 @@
(service ntp-service-type)
(service dhcp-client-service-type)
(service fail2ban-service-type)
- (service binder-service-type (pkg:binder-configuration (package (go-latest pkg:binder))))
- (service glaze-service-type (pkg:glaze-configuration (package (go-latest pkg:glaze))))
- (service untls-service-type (pkg:untls-configuration (package (go-latest pkg:untls))))
- (service pkg:wscat-service-type (pkg:wscat-configuration (package (go-latest pkg:wscat))))
- (service pkg:papod-service-type (pkg:papod-configuration (package (go-latest pkg:papod))))
+ (service binder-service-type (pkg:binder-configuration (package (latest pkg:binder))))
+ (service glaze-service-type (pkg:glaze-configuration (package (latest pkg:glaze))))
+ (service untls-service-type (pkg:untls-configuration (package (latest pkg:untls))))
+ (service pkg:wscat-service-type (pkg:wscat-configuration (package (latest pkg:wscat))))
+ (service pkg:papod-service-type (pkg:papod-configuration (package (latest pkg:papod))))
(service knot-service-type (q:knot-zones-configuration +tld+ +ipv4+ +ipv6+))
(service openssh-service-type (q:openssh-default-configuration (pkg:users->keys +users+)))
(service certbot-service-type (q:tld-certbot-configuration +tld+))