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