system-configuration/systems/sybil.scm

sybil.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 networking))
22
(use-modules (gnu services virtualization))
23
(use-modules (config os))
24
25
(let ((system (tyreunom-desktop-os "sybil")))
26
  (operating-system
27
    (inherit system)
28
    (keyboard-layout (keyboard-layout "fr" "bepo"))
29
    (bootloader
30
      (bootloader-configuration
31
        (targets (list "/boot/efi"))
32
        (bootloader grub-efi-bootloader)
33
        (keyboard-layout keyboard-layout)))
34
    (mapped-devices
35
      (list (mapped-device
36
              (source
37
                (uuid "f0514b14-8626-4048-a76f-d6001576e734"))
38
              (target "cryptroot")
39
              (type luks-device-mapping))
40
            (mapped-device
41
              (source
42
                (uuid "0729462b-5fff-4d66-898a-62c9e69cb74a"))
43
              (target "crypthome")
44
              (type luks-device-mapping))))
45
    (file-systems
46
      (cons* (file-system
47
               (mount-point "/boot/efi")
48
               (device (uuid "C62C-8291" 'fat32))
49
               (type "vfat"))
50
             (file-system
51
               (mount-point "/")
52
               (device "/dev/mapper/cryptroot")
53
               (type "btrfs")
54
               (dependencies mapped-devices))
55
             (file-system
56
               (mount-point "/home/")
57
               (device "/dev/mapper/crypthome")
58
               (type "btrfs")
59
               (dependencies mapped-devices))
60
             %base-file-systems))
61
    (users (map
62
             (lambda (user)
63
               (if (equal? (user-account-name user) "tyreunom")
64
                 (user-account
65
                   (inherit user)
66
                   (supplementary-groups
67
                     (cons* "libvirt" "kvm"
68
                            (user-account-supplementary-groups user))))
69
                 user))
70
             (operating-system-users system)))
71
    (services
72
      (cons*
73
        (service libvirt-service-type
74
                 (libvirt-configuration
75
                   (unix-sock-group "libvirt")))
76
        (service virtlog-service-type
77
                 (virtlog-configuration
78
                   (max-clients 1000)))
79
        (desktop-services)))))
80