summaryrefslogtreecommitdiff
path: root/doc/snippets
diff options
context:
space:
mode:
authorArun Isaac2022-02-28 17:34:41 +0530
committerArun Isaac2022-02-28 18:11:03 +0530
commit6353f4af51d8a96763672734cc631ad41961b299 (patch)
tree867f9b6a029d2d118b557137942fe293c81b483e /doc/snippets
parent2cbbe1e1522638c1b380b3cc2008f1d4deb3d45e (diff)
downloadguix-forge-6353f4af51d8a96763672734cc631ad41961b299.tar.gz
guix-forge-6353f4af51d8a96763672734cc631ad41961b299.tar.lz
guix-forge-6353f4af51d8a96763672734cc631ad41961b299.zip
doc: Add Tutorial.
* Makefile (doc_snippets): New variable. ($(doc_html)): Depend on $(doc_snippets). * doc/forge.skb: Import (skribilo source lisp). (Tutorial): New chapter. * doc/snippets/tutorial.scm: New file.
Diffstat (limited to 'doc/snippets')
-rw-r--r--doc/snippets/tutorial.scm53
1 files changed, 53 insertions, 0 deletions
diff --git a/doc/snippets/tutorial.scm b/doc/snippets/tutorial.scm
new file mode 100644
index 0000000..bbe8575
--- /dev/null
+++ b/doc/snippets/tutorial.scm
@@ -0,0 +1,53 @@
+(use-modules (gnu)
+ (gnu packages autotools)
+ (gnu packages gawk)
+ (gnu packages guile)
+ (gnu packages pkg-config)
+ (gnu packages version-control)
+ (gnu services ci)
+ (forge forge)
+ (forge laminar)
+ (forge utils))
+
+(define guile-json-tests
+ (with-imported-modules '((guix build utils))
+ (with-packages (list autoconf automake coreutils
+ gawk git-minimal gnu-make grep
+ guile-3.0 sed pkg-config)
+ #~(begin
+ (use-modules (guix build utils))
+ (invoke "git" "clone" "/srv/git/guile-json" ".")
+ (invoke "autoreconf" "--verbose" "--install" "--force")
+ (invoke "./configure")
+ (invoke "make")
+ (invoke "make" "check")))))
+
+(define guile-json-project
+ (forge-project
+ (name "guile-json")
+ (user "vetri")
+ (repository "/srv/git/guile-json")
+ (description "JSON module for Guile")
+ (ci-jobs (list (forge-laminar-job
+ (name "guile-json")
+ (run guile-json-tests))))))
+
+(operating-system
+ (host-name "tutorial")
+ (timezone "UTC")
+ (bootloader (bootloader-configuration
+ (bootloader grub-bootloader)))
+ (file-systems %base-file-systems)
+ (users (cons* (user-account
+ (name "vetri")
+ (group "users")
+ (home-directory "/home/vetri"))
+ %base-user-accounts))
+ (packages %base-packages)
+ (services (cons* (service forge-service-type
+ (forge-configuration
+ (projects (list guile-json-project))))
+ (service laminar-service-type
+ (laminar-configuration
+ (bind-http "localhost:8080")))
+ %base-services)))