summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2024-08-23 06:08:25 -0300
committerEuAndreh <eu@euandre.org>2024-08-23 06:08:25 -0300
commit7215d8413cbcb8bc79fda76672541d229e354da4 (patch)
tree369a09fb7f28818eca57812e27e7a78b42dbdc5d
parentsystem.scm: Remove cgit and enable git-daemon's git:// server (diff)
downloadasami-7215d8413cbcb8bc79fda76672541d229e354da4.tar.gz
asami-7215d8413cbcb8bc79fda76672541d229e354da4.tar.xz
cat src/guix/packages.scm >> src/guix/system.scm
-rw-r--r--Makefile7
-rw-r--r--src/guix/packages.scm61
-rw-r--r--src/guix/system.scm53
3 files changed, 43 insertions, 78 deletions
diff --git a/Makefile b/Makefile
index 8dbb6dc..e7b5984 100644
--- a/Makefile
+++ b/Makefile
@@ -20,13 +20,11 @@ repo-secrets.txt = $(repo-secrets.txt.gpg:.gpg=)
derived-assets = \
- packages.scm.sentinel \
system.scm.sentinel \
side-assets = \
$(prod-secrets.txt) \
$(repo-secrets.txt) \
- packages.scm \
system.scm \
@@ -44,9 +42,8 @@ src/config/tld.txt: Makefile
src/config/offsite-ssh.txt: Makefile
echo '$(OFFSITE_SSH)' | ifnew $@
-packages.scm.sentinel: src/guix/packages.scm
-system.scm.sentinel: src/guix/packages.scm src/guix/system.scm src/config/tld.txt src/config/offsite-ssh.txt
-packages.scm.sentinel system.scm.sentinel:
+system.scm.sentinel: src/guix/system.scm src/config/tld.txt src/config/offsite-ssh.txt
+system.scm.sentinel:
rm -f `basename $@ .sentinel`*
guix build -v3 -r`basename $@ .sentinel` -Kf src/guix/`basename $@ .sentinel`
touch $@
diff --git a/src/guix/packages.scm b/src/guix/packages.scm
deleted file mode 100644
index acccd3b..0000000
--- a/src/guix/packages.scm
+++ /dev/null
@@ -1,61 +0,0 @@
-(define-module (packages)
- #:use-module ((org euandre packages) #:prefix pkg:)
- #:use-module (gnu)
- #:use-module (guix packages)
- #:use-module (guix utils))
-(use-package-modules)
-
-
-
-(define (cat name s)
- (string-trim-right
- (pkg:slurp
- (string-append "src/versions/" name "/" s))))
-
-(define (go-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
- (string-append "https://papo.im/git/"
- name
- "/snapshot/"
- name
- "-"
- version
- ".tar.xz"))
- (sha256
- (base32 checksum))))
- (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)))))))))
-
-
-(define-public gobang (go-latest pkg:gobang))
-(define-public golite (go-latest pkg:golite))
-(define-public binder (go-latest pkg:binder))
-(define-public glaze (go-latest pkg:glaze))
-(define-public untls (go-latest pkg:untls))
-(define-public wscat (go-latest pkg:wscat))
-(define-public papod (go-latest pkg:papod))
-
-
-(list
- gobang
- golite
- binder
- glaze
- untls
- wscat
- papod)
diff --git a/src/guix/system.scm b/src/guix/system.scm
index 677fcc2..536f33e 100644
--- a/src/guix/system.scm
+++ b/src/guix/system.scm
@@ -19,19 +19,48 @@
+(define (cat name s)
+ (string-trim-right
+ (pkg:slurp
+ (string-append "src/versions/" name "/" s))))
+
+(define (go-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))
+ (method git-fetch)
+ (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)))))))))
+
(define (path s)
;; src/guix/system.scm + ../../../ = ./
(pkg:str (dirname (dirname (dirname (current-filename)))) "/" s))
-(define +users+
- `(("andre" "EuAndreh" ("wheel") ,(path "src/keys/SSH/andre.pub.txt"))))
-
-(add-to-load-path (dirname (current-filename)))
-(use-modules
- ((packages) #:prefix packages:))
-
+(define +users+
+ `(("andre" "EuAndreh" ("wheel") ,(path "src/keys/SSH/andre.pub.txt"))))
(define +ipv4+ "216.238.73.1")
(define +ipv6+ "2001:19f0:b400:1582:5400:04ff:fea9:370e")
@@ -104,11 +133,11 @@
(service ntp-service-type)
(service dhcp-client-service-type)
(service fail2ban-service-type)
- (service binder-service-type (pkg:binder-configuration (package packages:binder)))
- ;; (service glaze-service-type (pkg:glaze-configuration (package packages:glaze)))
- ;; (service untls-service-type (pkg:untls-configuration (package packages:untls)))
- ;; (service pkg:wscat-service-type (pkg:wscat-configuration (package packages:wscat)))
- ;; (service pkg:papod-service-type (pkg:papod-configuration (package packages:papod)))
+ (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 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+))