diff --git a/.guix-channel b/.guix-channel new file mode 100644 index 0000000..17b2f32 --- /dev/null +++ b/.guix-channel @@ -0,0 +1,4 @@ +(channel + (version 0) + (url "https://git.datat.fi/ry/datat.fi.git") + (directory ".guix/modules")) diff --git a/.guix/modules/datat-website-package.scm b/.guix/modules/datat-website-package.scm new file mode 100644 index 0000000..1f8697e --- /dev/null +++ b/.guix/modules/datat-website-package.scm @@ -0,0 +1,65 @@ +(define-module (datat-website-package) + #:use-module (guix) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix git-download) + #:use-module (guix packages) + #:use-module (guix build-system ruby) + #:use-module (gnu packages ruby)) + +(define vcs-file? + (or (git-predicate (string-append (current-source-directory) "/../..")) + (const #t))) + +(define-public datat.fi-website + (package + (name "datat.fi-website") + (version "0.0.0") + (source (local-file "../.." "datat.fi-website-checkout" + #:recursive? #t + #:select? vcs-file?)) + (build-system ruby-build-system) + (arguments + (list + #:tests? #f + #:phases + #~(modify-phases %standard-phases + (add-after 'build 'build-html + (lambda _ + (setenv "JEKYLL_ENV" "production") + (invoke "jekyll" "build"))) + (replace 'install + (lambda _ + (map delete-file (find-files "_site" "\\.gem(spec)?$|\\.scm$")) + (copy-recursively "_site" (string-append #$output "/srv/datat.fi-website/"))))))) ; no tests + (native-inputs + (list + jekyll + ruby-jekyll-feed + ruby-jekyll-paginate + ruby-jekyll-seo-tag + ruby-jekyll-sitemap)) + (synopsis "Datat.fi website") + (description "HTML site on https://datat.fi") + (home-page "https://git.datat.fi/ry/datat.fi") + (license license:expat))) + +(define ruby-jekyll-paginate + (package + (name "ruby-jekyll-paginate") + (version "1.1.0") + (source (origin + (method url-fetch) + (uri (rubygems-uri "jekyll-paginate" version)) + (sha256 + (base32 + "0r7bcs8fq98zldih4787zk5i9w24nz5wa26m84ssja95n3sas2l8")))) + (build-system ruby-build-system) + (arguments + (list + #:tests? #f)) ; no tests + (synopsis "Built-in Pagination Generator for Jekyll") + (description "Built-in Pagination Generator for Jekyll") + (home-page "https://github.com/jekyll/jekyll-paginate") + (license license:expat))) + +datat.fi-website diff --git a/guix.scm b/guix.scm new file mode 120000 index 0000000..9973b07 --- /dev/null +++ b/guix.scm @@ -0,0 +1 @@ +.guix/modules/datat-website-package.scm \ No newline at end of file