From 676c38f73d69bab937ee8874b74f0058643eac55 Mon Sep 17 00:00:00 2001 From: Ethan Reece Date: Sun, 22 Sep 2024 00:45:31 -0500 Subject: [PATCH] Add typst --- .guix/modules/template-package.scm | 9 +++++---- Justfile | 9 ++++++--- README.md | 4 ++-- channels.scm | 11 ++++++++++- manifest.scm | 3 ++- src/document.typ | 1 + 6 files changed, 26 insertions(+), 11 deletions(-) create mode 100644 src/document.typ diff --git a/.guix/modules/template-package.scm b/.guix/modules/template-package.scm index afae328..e9ffda4 100644 --- a/.guix/modules/template-package.scm +++ b/.guix/modules/template-package.scm @@ -1,5 +1,6 @@ (add-to-load-path ".") (define-module (template-package) + #:use-module (saayix packages typst) #:use-module (guix) #:use-module (guix build-system gnu) #:use-module ((guix licenses) #:prefix license:) @@ -19,8 +20,8 @@ #:select? vcs-file?)) (build-system gnu-build-system) (native-inputs - `()) - (synopsis "Guix template for projects") - (description "Guix template for projects") - (home-page "https://git.sudoer777.dev/me/guix-template") + `(typst)) + (synopsis "Guix template for Typst projects") + (description "Guix template for Typst projects") + (home-page "https://git.sudoer777.dev/me/guix-typst-template") (license license:expat))) diff --git a/Justfile b/Justfile index 2a93737..8d23ea8 100644 --- a/Justfile +++ b/Justfile @@ -1,6 +1,9 @@ default: - guix time-machine --channels=./channels.scm.lock -- shell --container --emulate-fhs --manifest=./manifest.scm -- echo "Compile step..." - + guix time-machine --channels=./channels.scm.lock -- shell --container --emulate-fhs --manifest=./manifest.scm -- typst compile ./src/document.typ ./out/document.pdf --font-path=/usr/share/fonts + +fonts: + guix time-machine --channels=./channels.scm.lock -- shell --container --emulate-fhs --manifest=./manifest.scm -- typst fonts --font-path=/usr/share/fonts + dev: guix time-machine --channels=./channels.scm.lock -- shell --manifest=./manifest.scm @@ -8,4 +11,4 @@ update: guix time-machine --channels=./channels.scm -- describe --format=channels > ./channels.scm.lock run: default - echo "Run step..." + xdg-open ./out/document.pdf diff --git a/README.md b/README.md index ce2053f..7d0a665 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Guix project template +# Guix Typst project template 1. Modify `./guix/modules/template-package.scm` (defines the project), `./channels.scm` (for project dependencies), and `./manifest.scm` (for development environment) to your requirements. @@ -6,4 +6,4 @@ 1. Run `just update` to update the dependencies. -1. Run `just` to compile the program. Run `just run` to compile then run the program. Run `just dev` to open a shell environment with the program's dependencies. +1. Run `just` to generate the document. Run `just run` to generate then open the document. Run `just dev` to open a shell environment with the document's dependencies. Run `just fonts` to show the available fonts. diff --git a/channels.scm b/channels.scm index 9e31cd0..f98373c 100644 --- a/channels.scm +++ b/channels.scm @@ -6,4 +6,13 @@ (make-channel-introduction "9edb3f66fd807b096b48283debdcddccfea34bad" (openpgp-fingerprint - "BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA"))))) + "BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA")))) + (channel + (name 'saayix) + (url "https://codeberg.org/look/saayix") + (branch "main") + (introduction + (make-channel-introduction + "12540f593092e9a177eb8a974a57bb4892327752" + (openpgp-fingerprint + "3FFA 7335 973E 0A49 47FC 0A8C 38D5 96BE 07D3 34AB"))))) diff --git a/manifest.scm b/manifest.scm index c7830b2..0936605 100644 --- a/manifest.scm +++ b/manifest.scm @@ -1,5 +1,6 @@ (add-to-load-path ".guix/modules") (use-modules (template-package) + (saayix packages typst) (gnu packages fontutils)) -(packages->manifest (list coreutils)) +(packages->manifest (list typst coreutils)) diff --git a/src/document.typ b/src/document.typ new file mode 100644 index 0000000..f1e87ac --- /dev/null +++ b/src/document.typ @@ -0,0 +1 @@ +This document is located in `src/document.typ`.