modified gnu/packages/guile.scm @@ -41,6 +41,7 @@ #:use-module (gnu packages ed) #:use-module (gnu packages base) #:use-module (gnu packages texinfo) + #:use-module (gnu packages man) #:use-module (gnu packages gettext) #:use-module (gnu packages databases) #:use-module (gnu packages python) @@ -424,6 +425,54 @@ Guile, so its configuration can be written in Scheme; the original cron format is also supported.") (license gpl3+))) +(define-public mcron2 + (let ((commit "573a09a32684c091cb8e8f521946f8bf90a295af")) + (package + (inherit mcron) + (name "mcron2") + (version (string-append (package-version mcron) "-0." + (string-take commit 7))) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://notabug.org/mthl/mcron/") + (commit commit))) + (sha256 + (base32 + "0m4kcpxmcr3rf6l6dd2z0m427gc2y1xx9z361j2zw3jgvamg0yhw")) + (file-name (string-append name "-" version "-checkout")))) + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("pkg-config" ,pkg-config) + ("texinfo" ,texinfo) + ("help2man" ,help2man))) + (arguments + `(#:modules ((ice-9 match) (ice-9 ftw) + ,@%gnu-build-system-modules) + + #:phases (modify-phases %standard-phases + (add-after 'unpack 'bootstrap + (lambda _ + (zero? (system* "autoreconf" "-vfi")))) + (add-after 'install 'wrap-mcron + (lambda* (#:key outputs #:allow-other-keys) + ;; Wrap the 'mcron' command to refer to the right + ;; modules. + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin")) + (site (string-append + out "/share/guile/site"))) + (match (scandir site) + (("." ".." version) + (let ((modules (string-append site "/" version))) + (wrap-program (string-append bin "/mcron") + `("GUILE_LOAD_PATH" ":" prefix + (,modules)) + `("GUILE_LOAD_COMPILED_PATH" ":" prefix + (,modules))) + #t)))))))))))) + (define-public guile-lib (package (name "guile-lib") modified gnu/system/examples/bare-bones.tmpl @@ -2,7 +2,7 @@ ;; for a "bare bones" setup, with no X11 display server. (use-modules (gnu)) -(use-service-modules networking ssh) +(use-service-modules networking ssh mcron) (use-package-modules admin) (operating-system @@ -42,6 +42,15 @@ ;; Add services to the baseline: a DHCP client and ;; an SSH server. - (services (cons* (dhcp-client-service) - (lsh-service #:port-number 2222) + (services (cons* (service mcron-service-type + (mcron-configuration + (jobs (list (mcron-job + (user "alice") + (specification + #~(job next-second-from + (lambda () + (call-with-output-file + "/dev/console" + (lambda (port) + (display "hello!\n" port))))))))))) %base-services)))