~abcdw/rde

rde/rde/features/docker.scm -rw-r--r-- 1.8 KiB
e98d6a8eAndrew Tropin rde: gnupg: Add copyright preamble. 19 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
52
53
54
55
56
57
58
59
(define-module (rde features docker)
  #:use-module (rde features)
  #:use-module (rde features emacs)
  #:use-module (gnu packages docker)
  #:use-module (gnu packages emacs-xyz)
  #:use-module (gnu services)
  #:use-module (gnu services docker)
  #:use-module (rde system services accounts)

  #:export (feature-docker))

(define* (feature-docker
          #:key
          (docker docker)
          (docker-cli docker-cli)
          (emacs-docker emacs-docker)
          (emacs-dockerfile-mode emacs-dockerfile-mode)
          (containerd containerd)
          (docker-key "D"))
  "Configure docker and related packages."

  (define f-name 'docker)
  (define (get-home-services config)
    (list
     (rde-elisp-configuration-service
      f-name
      config
      `((eval-when-compile (require 'configure-rde-keymaps))
        (with-eval-after-load
         'configure-rde-keymaps
         (define-key rde-app-map (kbd ,docker-key) 'docker))
        (add-to-list 'auto-mode-alist '(".*Dockerfile\\'" . dockerfile-mode)))
      #:summary "\
Docker interface and Dockerfile syntax"
      #:commentary "\
Keybinding and Dockerfile major mode association."
      #:keywords '(convenience)
      ;; MAYBE: Add emacs-docker-tramp?
      #:elisp-packages (list emacs-docker emacs-dockerfile-mode
                             (get-value 'emacs-configure-rde-keymaps config)))))

  (define (get-system-services config)
    (list
     (simple-service
      'docker-add-docker-group-to-user
      rde-account-service-type
      (list "docker"))
     (service
      docker-service-type
      (docker-configuration
       (docker docker)
       (docker-cli docker-cli)
       (containerd containerd)))))

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