system-configuration/systems/ene.scm

ene.scm

1
;;; Tyreunom's system administration and configuration tools.
2
;;;
3
;;; Copyright © 2019 Julien Lepiller <julien@lepiller.eu>
4
;;;
5
;;; This program is free software: you can redistribute it and/or modify
6
;;; it under the terms of the GNU General Public License as published by
7
;;; the Free Software Foundation, either version 3 of the License, or
8
;;; (at your option) any later version.
9
;;;
10
;;; This program is distributed in the hope that it will be useful,
11
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
12
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
;;; GNU General Public License for more details.
14
;;;
15
;;; You should have received a copy of the GNU General Public License
16
;;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
18
(use-modules (gnu))
19
(use-modules (gnu bootloader))
20
(use-modules (gnu packages bootloaders))
21
(use-modules (gnu services dns))
22
(use-modules (gnu services networking))
23
(use-modules (gnu services web))
24
(use-modules (gnu system))
25
26
(use-modules (config certbot) (config dns) (config mail) (config os))
27
28
29
(define u-boot-allwinner-bootloader (@@ (gnu bootloader u-boot) u-boot-allwinner-bootloader))
30
31
(define u-boot-cubietruck-bootloader
32
  (bootloader
33
    (inherit u-boot-allwinner-bootloader)
34
    (package u-boot-cubietruck)))
35
36
(operating-system
37
  (inherit (tyreunom-os "ene"))
38
  (bootloader
39
    (bootloader-configuration
40
      (target "/dev/mmcblk0")
41
      (bootloader u-boot-cubietruck-bootloader)))
42
  (initrd-modules (cons* "sunxi-mmc" "sd_mod" "ahci_sunxi" %base-initrd-modules))
43
  (file-systems (cons (file-system
44
                        (mount-point "/")
45
                        (device "/dev/sda1")
46
                        (type "ext4"))
47
                      %base-file-systems))
48
  (services
49
    (append
50
      (list
51
	(service dhcp-client-service-type)
52
	(agetty-service
53
	  (agetty-configuration
54
	    (extra-options '("-L"))
55
	    (baud-rate "115200")
56
	    (term "vt100")
57
	    (tty "ttyS0")))
58
        (service nginx-service-type)
59
        (service knot-service-type
60
                 (knot-configuration
61
                   (zones (list lepiller-master-zone
62
                                ipv4-reverse-master-zone
63
                                ipv6-reverse-master-zone))))
64
        (certbot-service `(("courriel.lepiller.eu" "imap.lepiller.eu")
65
			   ("ene.lepiller.eu" "rennes.lepiller.eu")
66
			   ("avatar.lepiller.eu")))
67
	(service php-fpm-service-type)
68
	(cat-avatar-generator-service
69
	  #:configuration
70
	  (nginx-server-configuration
71
	    (server-name '("avatar.lepiller.eu"))
72
	    (ssl-certificate "/etc/letsencrypt/live/avatar.lepiller.eu/fullchain.pem")
73
	    (ssl-certificate-key "/etc/letsencrypt/live/avatar.lepiller.eu/privkey.pem")
74
	    (listen '("443 ssl http2" "[::]:443 ssl http2"))))
75
        (simple-service 'default-http-server nginx-service-type
76
          (list (nginx-server-configuration
77
                  (ssl-certificate "/etc/letsencrypt/live/ene.lepiller.eu/fullchain.pem")
78
                  (ssl-certificate-key "/etc/letsencrypt/live/ene.lepiller.eu/privkey.pem")
79
                  (listen '("443 ssl http2" "[::]:443 ssl http2"))
80
                  (server-name '(default))(root "/srv/http/default")))))
81
      (lepiller-mail-services
82
	#:interface "eth0"
83
	#:domain "courriel.lepiller.eu")
84
      (server-services "ene"))))
85