From: Amélia P. H. Coutard Date: Sat, 15 Jun 2024 01:17:53 +0000 (+0200) Subject: Ajout de mon site web (et de Hakyll) X-Git-Url: https://git.ameliathe1st.gay/?a=commitdiff_plain;h=6ba577517d327e38a4edeb96c047b22bbd0b1790;p=canal-guix.git Ajout de mon site web (et de Hakyll) --- diff --git a/amy/packages/site-web.scm b/amy/packages/site-web.scm new file mode 100644 index 0000000..b47db65 --- /dev/null +++ b/amy/packages/site-web.scm @@ -0,0 +1,172 @@ +; Copyright 2023 Amélia COUTARD. +; +; This file from the guix channel amy is free software: you can redistribute it and/or modify it +; under the terms of the GNU General Public License as published by the Free Software Foundation, +; either version 3 of the License, or (at your option) any later version. +; +; This channel is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; +; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +; PURPOSE. See the GNU General Public License for more details. +; +; You should have received a copy of the GNU General Public License along with this channel. If +; not, see . + +(define-module (amy packages site-web) + #:use-module (gnu packages haskell-check) + #:use-module (gnu packages haskell-web) + #:use-module (gnu packages haskell-xyz) + #:use-module (gnu packages linux) + #:use-module (guix build-system haskell) + #:use-module (guix download) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module ((guix licenses) + #:prefix license:) + #:use-module (guix packages) + #:use-module (guix utils) + #:export (site-web)) + +(define ghc-lrucache + (package + (name "ghc-lrucache") + (version "1.2.0.1") + (source + (origin + (method url-fetch) + (uri (hackage-uri "lrucache" version)) + (sha256 + (base32 "11avhnjnb89rvn2s41jhh5r40zgp7r6kb5c0hcfiibpabqvv46pw")))) + (build-system haskell-build-system) + (properties '((upstream-name . "lrucache"))) + (inputs (list ghc-contravariant)) + (home-page "http://github.com/chowells79/lrucache") + (synopsis "a simple, pure LRU cache") + (description + "This package contains a simple, pure LRU cache, implemented in terms of +\"Data.Map\". . It also contains a mutable IO wrapper providing atomic updates to +an LRU cache.") + (license license:bsd-3))) + +(define ghc-hakyll + (package + (name "ghc-hakyll") + (version "4.16.2.1") + (source + (origin + (method url-fetch) + (uri (hackage-uri "hakyll" version)) + (sha256 + (base32 "1xcw8pcw9h82hxdlpp8z0ma2a1ssa5x2m32vizxh2a2pm5l1d3a7")))) + (build-system haskell-build-system) + (properties '((upstream-name . "hakyll"))) + (inputs (list ghc-aeson + ghc-blaze-html + ghc-blaze-markup + ghc-data-default + ghc-file-embed + ghc-hashable + ghc-lrucache + ghc-network-uri + ghc-optparse-applicative + ghc-random + ghc-regex-tdfa + ghc-resourcet + ghc-scientific + ghc-tagsoup + ghc-time-locale-compat + ghc-unordered-containers + ghc-vector + ghc-wai-app-static + ghc-yaml + ghc-wai + ghc-warp + ghc-http-types + ghc-fsnotify + ghc-http-conduit + ghc-pandoc)) + (native-inputs (list ghc-quickcheck + ghc-tasty + ghc-tasty-golden + ghc-tasty-hunit + ghc-tasty-quickcheck + util-linux)) + (home-page "http://jaspervdj.be/hakyll") + (synopsis "A static website compiler library") + (description + "Hakyll is a static website compiler library. It provides you with the tools to +create a simple or advanced static website using a Haskell DSL and formats such +as markdown or RST. You can find more information, including a tutorial, on the +website: . * . If you seek assistance, there's: . +* A google group: . * An IRC channel, +@@#hakyll@@ on irc.libera.chat (we *do not* have a channel on Freenode anymore) +. Additionally, there's the Haddock documentation in the different modules, +meant as a reference.") + (license license:bsd-3))) + +(define ghc-hakyll-process + (package + (name "ghc-hakyll-process") + (version "0.0.3.0") + (source + (origin + (method url-fetch) + (uri (hackage-uri "hakyll-process" version)) + (sha256 + (base32 "1ci7sw9r73h06kdrhqqbs0sar91z56scns3xljq2rpzhcpf3ppms")))) + (build-system haskell-build-system) + (properties '((upstream-name . "hakyll-process"))) + (inputs (list ghc-hakyll ghc-typed-process)) + (home-page "https://github.com/jhmcstanton/hakyll-process#readme") + (synopsis "Hakyll compiler for arbitrary external processes.") + (description + "Exposes Hakyll compilers for passing file paths to external processes. +Transformed results are made available as Hakyll `Items`.") + (license license:bsd-3))) + +(define vcs-file? + (or (git-predicate (current-source-directory)) + (const #t))) + +(define site-web + (package + (name "site-web") + (version "1.0-3253fc10") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://git.ameliathe1st.gay/site-web.git") + (commit "3253fc1004e23b804861104d917da278a895ea64"))) ;(string-append "v" version)))) + (file-name (string-append name "-" version "-checkout")) + (sha256 + (base32 "0lqqv2qjirzcnlyq6wmfhsazc16hhs8y95jx1xn2g6p1h44zslvp")))) + (build-system haskell-build-system) + (inputs (list ghc-hakyll ghc-hakyll-process)) + (arguments + (list + #:phases #~(modify-phases %standard-phases + (delete 'configure) + (delete 'check) + (delete 'haddock) + (delete 'register) + (replace 'build + (lambda* (#:key #:allow-other-keys) + (mkdir "out") + (invoke "ghc" + "-Wno-tabs" + "-odir" + "out" + "-hidir" + "out" + "main.hs" + "-o" + "out/main") + (invoke "./out/main" "build"))) + (replace 'install + (lambda* (#:key output #:allow-other-keys) + (mkdir-p (string-append #$output "/share/")) + (invoke "cp" "-r" "_site" (string-append #$output "/share/site-web"))))))) + (synopsis "Mon site web") + (description "Mon site web statique, implémenté en haskell via Hakyll.") + (home-page "https://www.ameliathe1st.gay") + (license license:agpl3+)))