~abcdw/rde

rde/rde/features/virtualization.scm -rw-r--r-- 1.5 KiB
e98d6a8eAndrew Tropin rde: gnupg: Add copyright preamble. 20 hours ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
;;; rde --- Reproducible development environment
;;; Copyright © 2022 Andrew Tropin <andrew@trop.in>
;;;
;;; This file is part of rde.
;;;
;;; rde is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; rde is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with rde.  If not, see <http://www.gnu.org/licenses/>.

(define-module (rde features virtualization)
  #:use-module (rde features)
  #:use-module (gnu packages virtualization)
  #:use-module (gnu services)
  #:use-module (gnu home services)
  #:use-module (rde system services accounts)

  #:export (feature-qemu))

(define* (feature-qemu
          #:key
          (qemu qemu))

  (define f-name 'qemu)
  (define (get-home-services config)
    (list
     (simple-service
      'qemu-add-qemu-package
      home-profile-service-type
      (list qemu))))

  (define (get-system-services config)
    (list
     (simple-service
      'qemu-add-kvm-group-to-user
      rde-account-service-type
      (list "kvm"))))

  (feature
   (name f-name)
   (values `((,f-name . #t)))
   (home-services-getter get-home-services)
   (system-services-getter get-system-services)))