diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/guix/packages.scm | 61 | ||||
-rw-r--r-- | src/guix/system.scm | 53 |
2 files changed, 41 insertions, 73 deletions
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+)) |