diff options
author | EuAndreh <eu@euandre.org> | 2023-03-27 08:32:49 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2023-03-27 08:32:49 -0300 |
commit | ab742a1ebc61d571bb9d13d7692ef7e245bba192 (patch) | |
tree | 0329573f78946daac6fa62802d189ca53ef2e809 /src/infrastructure/guix | |
parent | Makefile: Rename "result" to "system" (diff) | |
download | toph-ab742a1ebc61d571bb9d13d7692ef7e245bba192.tar.gz toph-ab742a1ebc61d571bb9d13d7692ef7e245bba192.tar.xz |
Build HTML and install it via CI
Notes
See CI logs with:
git notes --ref=refs/notes/ci-logs show ab742a1ebc61d571bb9d13d7692ef7e245bba192
git notes --ref=refs/notes/ci-data show ab742a1ebc61d571bb9d13d7692ef7e245bba192
Exit status: 0
Duration: 27
Diffstat (limited to 'src/infrastructure/guix')
-rw-r--r-- | src/infrastructure/guix/packages.scm | 70 | ||||
-rw-r--r-- | src/infrastructure/guix/system.scm | 7 |
2 files changed, 77 insertions, 0 deletions
diff --git a/src/infrastructure/guix/packages.scm b/src/infrastructure/guix/packages.scm new file mode 100644 index 0000000..c2f76e1 --- /dev/null +++ b/src/infrastructure/guix/packages.scm @@ -0,0 +1,70 @@ +(define-module (packages) + #:use-module ((ice-9 popen) #:prefix popen:) + #:use-module ((ice-9 rdelim) #:prefix rdelim:) + #:use-module ((org euandre queue) #:prefix queue:) + #:use-module ((xyz euandreh heredoc) #:prefix heredoc:) + #:use-module (gnu) + #:use-module (guix build utils) + #:use-module (guix build-system gnu) + #:use-module (guix packages)) +(use-package-modules + check + finance + groff + haskell-apps + haskell-xyz + imagemagick + python + python-web + python-xyz + version-control) +(heredoc:enable-syntax) + + +(define working-dir + (if (directory-exists? "/opt/deploy/current") + "/opt/deploy/current" + (canonicalize-path "."))) + +(define version-cmd #"- + if grep -q deployer /etc/passwd && [ -e /opt/deploy/current ]; then + sudo -u deployer git -C /opt/deploy/current rev-parse HEAD + else + git rev-parse HEAD + fi + "#) + +(define repo-version + (let* ((port (popen:open-input-pipe version-cmd)) + (v (rdelim:read-line port))) + (popen:close-pipe port) + v)) + +(define-public servers + (package + (name "servers") + (version repo-version) + (source + (local-file working-dir #:recursive? #t)) + (build-system gnu-build-system) + (arguments + (list + #:make-flags #~(list (string-append "PREFIX=" %output)) + #:phases + #~(modify-phases %standard-phases + (delete 'configure) + (add-after 'install 'installcheck + (lambda* (#:key make-flags #:allow-other-keys) + (define dash-j (format #f "-j~a" (parallel-job-count))) + (apply invoke "make" dash-j "installcheck" make-flags)))))) + (native-inputs + (list + git-minimal + shellcheck)) + (home-page #f) + (synopsis #f) + (description #f) + (license #f))) + +(list + servers) diff --git a/src/infrastructure/guix/system.scm b/src/infrastructure/guix/system.scm index 0cc8377..9257cc6 100644 --- a/src/infrastructure/guix/system.scm +++ b/src/infrastructure/guix/system.scm @@ -40,6 +40,12 @@ "/opt/deploy/current" (canonicalize-path "."))) +(add-to-load-path + (string-append working-dir "/src/infrastructure/guix")) +(use-modules + ((packages) #:prefix packages:)) + + (define (str . rest) (apply string-append rest)) @@ -307,6 +313,7 @@ trash-cli tree)) (list + packages:servers (script "gc" (file "src/infrastructure/scripts/gc.sh")) (script "check" (file "src/infrastructure/scripts/check.sh")) (script "backup" (file "src/infrastructure/scripts/backup.sh")) |