Rottlog was added to base-services

Julien LepillerWed Apr 22 23:03:54+0200 2020

109aadf

Rottlog was added to base-services

modules/config/os.scm

3232
  #:use-module (gnu packages xdisorg)
3333
  #:use-module (gnu packages xfce)
3434
  #:use-module (gnu services)
35+
  #:use-module (gnu services admin)
3536
  #:use-module (gnu services base)
3637
  #:use-module (gnu services dbus)
3738
  #:use-module (gnu services desktop)

5455
5556
(define (server-services host-name)
5657
  (cons*
57-
    server-rotation-service
5858
    (service ntp-service-type)
5959
    (service openssh-service-type
6060
	     (openssh-configuration
6161
	       (authorized-keys
6262
		 `(("tyreunom" ,(local-file "../../keys/tyreunom.pub"))))))
6363
    (modify-services %base-services
64+
      (rottlog-service-type config =>
65+
        server-rotation-service-config)
6466
      (login-service-type config =>
6567
        (login-configuration
6668
          (inherit config)

7880
      (qemu-binfmt-configuration
7981
	(platforms (lookup-qemu-platforms "arm" "aarch64" "i686" "ppc"))
8082
	(guix-support? #t)))
81-
    desktop-rotation-service
8283
    (modify-services %desktop-services
84+
      (rottlog-service-type config =>
85+
        desktop-rotation-service-config)
8386
      (udev-service-type config =>
8487
        (udev-configuration
8588
	  (inherit config)

modules/config/rotation.scm

2222
(define-module (config rotation)
2323
  #:use-module (gnu services)
2424
  #:use-module (gnu services admin)
25-
  #:export (server-rotation-service
26-
            desktop-rotation-service))
25+
  #:export (server-rotation-service-config
26+
            desktop-rotation-service-config))
2727
2828
(define base-rotations
2929
  (list

4848
      (frequency 'daily)
4949
      (options '("rotate 1" "log_rotate")))))
5050
51-
(define server-rotation-service
52-
  (service rottlog-service-type
53-
    (rottlog-configuration
54-
      (rotations
55-
        (append
56-
          (list
57-
            (log-rotation
58-
              (files '("/var/log/letsencrypt/letsencrypt.log"))
59-
              (frequency 'daily)
60-
              (options '("rotate 30" "log_rotate" "nocompress")))
61-
            (log-rotation
62-
              (files '("/var/log/maillog"))
63-
              (options '("rotate 5" "log_rotate"))
64-
              (frequency 'daily))
65-
            (log-rotation
66-
              (files '("/var/log/nginx/access.log" "/var/log/nginx/error.log"))
67-
              (frequency 'weekly)
68-
              (options '("rotate 1" "log_rotate" "nocompress"))))
69-
          base-rotations)))))
51+
(define server-rotation-service-config
52+
  (rottlog-configuration
53+
    (rotations
54+
      (append
55+
        (list
56+
          (log-rotation
57+
            (files '("/var/log/letsencrypt/letsencrypt.log"))
58+
            (frequency 'daily)
59+
            (options '("rotate 30" "log_rotate" "nocompress")))
60+
          (log-rotation
61+
            (files '("/var/log/maillog"))
62+
            (options '("rotate 5" "log_rotate"))
63+
            (frequency 'daily))
64+
          (log-rotation
65+
            (files '("/var/log/nginx/access.log" "/var/log/nginx/error.log"))
66+
            (frequency 'weekly)
67+
            (options '("rotate 1" "log_rotate" "nocompress"))))
68+
        base-rotations))))
7069
71-
(define desktop-rotation-service
72-
  (service rottlog-service-type
73-
    (rottlog-configuration
74-
      (rotations base-rotations))))
70+
(define desktop-rotation-service-config
71+
  (rottlog-configuration
72+
    (rotations base-rotations)))