;;; Tyreunom's system administration and configuration tools. ;;; ;;; Copyright © 2020 Julien Lepiller ;;; ;;; This program 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 program 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 program. If not, see . (use-modules (gnu)) (use-modules (gnu system)) (use-modules (gnu bootloader) (gnu bootloader grub)) (use-modules (gnu services mcron)) (use-modules (gnu services networking)) (use-modules (gnu services web)) (use-modules (config certbot) (config cuirass) (config network) (config os)) (use-modules (gnu packages base)) (use-modules (guix gexp)) (define i18n-download-job #~(job '(next-minute-from (next-hour '(05)) '(51)) (lambda () (execl #$(file-append gnu-make "/bin/make") "-C" "/srv/http/i18n" "fdroid-update")))) (define i18n-compile-job #~(job '(next-minute-from (next-hour '(06)) '(21)) (lambda () (execl #$(file-append gnu-make "/bin/make") "-C" "/srv/http/i18n")))) (define nani-download-job #~(job '(next-minute-from (next-hour-from (next-day (range 1 31 5)) '(02)) '(12)) (lambda () (execl #$(file-append gnu-make "/bin/make") "-C" "/srv/http/nani" "download")))) (define nani-update-job #~(job '(next-minute-from (next-hour-from (next-day (range 1 31 5)) '(03)) '(12)) (lambda () (execl #$(file-append gnu-make "/bin/make") "-C" "/srv/http/nani" "download")))) (operating-system (inherit (tyreunom-os "xana")) (bootloader (bootloader-configuration (target "/dev/sda") (bootloader grub-bootloader))) (file-systems (cons (file-system (mount-point "/") (device (uuid "27207be8-f30a-4ac6-a5ec-41859e90ee94")) (type "ext4")) %base-file-systems)) (swap-devices '("/dev/sda1")) (services (append (list (service dhcp-client-service-type) (service nginx-service-type) (simple-service 'i18n-cron mcron-service-type (list i18n-download-job i18n-compile-job nani-download-job nani-update-job)) (certbot-service `(("xana.lepiller.eu") ("nani.lepiller.eu"))) (simple-service 'nani-http-server nginx-service-type (list (nginx-server-configuration (ssl-certificate "/etc/letsencrypt/live/nani.lepiller.eu/fullchain.pem") (ssl-certificate-key "/etc/letsencrypt/live/nani.lepiller.eu/privkey.pem") (listen '("443 ssl http2" "[::]:443 ssl http2")) (server-name '("nani.lepiller.eu")) (root "/srv/http/nani/public")))) (simple-service 'default-http-server nginx-service-type (list (nginx-server-configuration (ssl-certificate "/etc/letsencrypt/live/xana.lepiller.eu/fullchain.pem") (ssl-certificate-key "/etc/letsencrypt/live/xana.lepiller.eu/privkey.pem") (listen '("443 ssl http2" "[::]:443 ssl http2")) (server-name '(default "xana.lepiller.eu")) (root "/srv/http/default"))))) (modify-services (server-services "xana") (guix-service-type config => (guix-configuration (inherit config) (substitute-urls '("https://guix.lepiller.eu" "https://ci.guix.gnu.org"))))))))