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 virtualization))
22
(use-modules (config os))
23
24
(let ((system (tyreunom-desktop-os "tachikoma")))
25
  (operating-system
26
    (inherit system)
27
    (bootloader
28
      (bootloader-configuration
29
        (target "/dev/sda")
30
        (bootloader grub-bootloader)))
31
    (mapped-devices
32
      (list (mapped-device
33
              (source (uuid "c61efb54-dd82-4f94-ba30-344ed71d0783"))
34
              (target "cryptroot")
35
              (type luks-device-mapping))))
36
    (file-systems (cons (file-system
37
                          (device "/dev/mapper/cryptroot")
38
                          (mount-point "/")
39
                          (type "ext4")
40
                          (dependencies mapped-devices))
41
                        %base-file-systems))
42
    (users (cons
43
             (user-account
44
               (name "zoom")
45
               (group "users")
46
               (home-directory "/home/zoom"))
47
             (map
48
               (lambda (user)
49
                 (if (equal? (user-account-name user) "tyreunom")
50
                   (user-account
51
                     (inherit user)
52
                     (supplementary-groups
53
                       (cons "libvirt" (user-account-supplementary-groups user))))
54
                   user))
55
               (operating-system-users system))))
56
    (services
57
      (cons*
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