system-configuration/systems/tachikoma.scm

tachikoma.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 system))
20
(use-modules (gnu bootloader) (gnu bootloader grub))
21
(use-modules (gnu services dns))
22
(use-modules (gnu services docker))
23
(use-modules (gnu services linux))
24
(use-modules (gnu services sound))
25
(use-modules (gnu services virtualization))
26
(use-modules (gnu services xorg))
27
(use-modules (config os))
28
29
(let ((system (tyreunom-desktop-os "tachikoma")))
30
  (operating-system
31
    (inherit system)
32
    (bootloader
33
      (bootloader-configuration
34
        (targets '("/dev/sda"))
35
        (bootloader grub-bootloader)))
36
    (mapped-devices
37
      (list (mapped-device
38
              (source (uuid "c61efb54-dd82-4f94-ba30-344ed71d0783"))
39
              (target "cryptroot")
40
              (type luks-device-mapping))))
41
    (file-systems (cons (file-system
42
                          (device "/dev/mapper/cryptroot")
43
                          (mount-point "/")
44
                          (type "ext4")
45
                          (dependencies mapped-devices))
46
                        %base-file-systems))
47
    (users (map
48
             (lambda (user)
49
               (if (equal? (user-account-name user) "tyreunom")
50
                 (user-account
51
                   (inherit user)
52
                   (supplementary-groups
53
                     (cons* "docker" "libvirt" (user-account-supplementary-groups user))))
54
                 user))
55
             (operating-system-users system)))
56
    (services
57
      (cons*
58
        (service zram-device-service-type
59
                 (zram-device-configuration
60
                   (size "2G")
61
                   (compression-algorithm 'zstd)))
62
        (service libvirt-service-type
63
                 (libvirt-configuration
64
                   (unix-sock-group "libvirt")))
65
        (service virtlog-service-type
66
                 (virtlog-configuration
67
                   (max-clients 1000)))
68
        (service docker-service-type)
69
        (service dnsmasq-service-type
70
          (dnsmasq-configuration
71
            (no-resolv? #t)
72
            (servers '("80.67.169.12"
73
                       "80.67.169.40"
74
                       "2001:910:800::12"
75
                       "2001:910:800::40"))))
76
        (set-xorg-configuration
77
          (xorg-configuration
78
            (keyboard-layout (keyboard-layout "fr" "bepo"))
79
            (extra-config
80
              '("\n\nSection \"Device\""
81
                "  Identifier \"modesetting\""
82
                "  Driver \"modesetting\""
83
                "  Option \"TearFree\" \"true\""
84
                "EndSection"
85
                "\n"))))
86
        (modify-services desktop-services
87
          (guix-service-type config =>
88
            (guix-configuration
89
              (inherit config)
90
              (authorized-keys
91
                (cons*
92
                  (local-file "../keys/ene.pub")
93
                  (local-file "../keys/xana.pub")
94
                  (local-file "../keys/cs-pc.pub")
95
                  %default-authorized-guix-keys))))
96
          (pulseaudio-service-type config =>
97
            (pulseaudio-configuration
98
              (inherit config)
99
              (script-file
100
                (local-file "../files/pulse-default.pa")))))))))
101