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 linux))
22
(use-modules (gnu services virtualization))
23
(use-modules (config os))
24
25
(let ((system (tyreunom-desktop-os "tachikoma")))
26
  (operating-system
27
    (inherit system)
28
    (bootloader
29
      (bootloader-configuration
30
        (target "/dev/sda")
31
        (bootloader grub-bootloader)))
32
    (mapped-devices
33
      (list (mapped-device
34
              (source (uuid "c61efb54-dd82-4f94-ba30-344ed71d0783"))
35
              (target "cryptroot")
36
              (type luks-device-mapping))))
37
    (file-systems (cons (file-system
38
                          (device "/dev/mapper/cryptroot")
39
                          (mount-point "/")
40
                          (type "ext4")
41
                          (dependencies mapped-devices))
42
                        %base-file-systems))
43
    (users (map
44
             (lambda (user)
45
               (if (equal? (user-account-name user) "tyreunom")
46
                 (user-account
47
                   (inherit user)
48
                   (supplementary-groups
49
                     (cons "libvirt" (user-account-supplementary-groups user))))
50
                 user))
51
             (operating-system-users system)))
52
    (services
53
      (cons*
54
        (service zram-device-service-type
55
                 (zram-device-configuration
56
                   (size "2G")
57
                   (compression-algorithm 'zstd)))
58
        (service libvirt-service-type
59
                 (libvirt-configuration
60
                   (unix-sock-group "libvirt")))
61
        (service virtlog-service-type
62
                 (virtlog-configuration
63
                   (max-clients 1000)))
64
        desktop-services))))
65