summaryrefslogtreecommitdiff
path: root/suweren/system.scm
blob: 39ec3d2d26da9f023f931256be4e3eb699235161 (about) (plain)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
(define-module (suweren system)
  #:use-module (gnu packages kde-pim)    ; kgpg
  #:use-module (gnu services)            ; modify-services
                                         ; profile-service-type
                                         ; simple-service
  #:use-module (gnu services base)       ; guix-configuration
                                         ; guix-service-type
                                         ; login-configuration
                                         ; login-service-type
  #:use-module (gnu services desktop)    ; %desktop-services
                                         ; plasma-desktop-service-type
  #:use-module (gnu services sddm)       ; sddm-configuration
                                         ; sddm-service-type
  #:use-module (gnu services syncthing)  ; syncthing-configuration
                                         ; syncthing-service-type
  #:use-module (gnu services xorg)       ; gdm-service-type
  #:use-module (gnu system)              ; operating-system
  #:use-module (gnu system locale)
  #:use-module (gnu system file-systems) ; %base-file-systems
  #:use-module (gnu system shadow)       ; %base-user-accounts
  #:use-module (guix channels)           ; %default-channels
  #:use-module (guix gexp)               ; plain-file
  #:use-module (nongnu packages linux)
  #:use-module (suweren commons sudoers) ; %sudoers-specification*
  #:use-module ((suweren trezor)
                #:prefix suweren-trezor:))

(define-public polish-locale-string
  "pl_PL.utf8")

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(define polish-locale
  (locale-definition (name polish-locale-string)
                     (source "pl_PL")))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; (list record* package)
(define packages
  (list kgpg))

;; record* service
(define profile
  (simple-service 'distribution-packages
                  profile-service-type
                  packages))

;; record guix-configuration ->
;; record guix-configuration
(define-public (guix configuration)
  (let* ((deployment-commit "c24ce7cb11e74da13d491f9de3c4b7040a069f43")
         (distribution-commit "7d17bded11ef1239592e6e5abd40ceee1e99cbb8")
         (marekpasnikowski-fingerprint
          (openpgp-fingerprint "590E 500F E39D 26B3 E60B 743B 6D81 B120 7711 899F"))
         (nonguix-commit "897c1a470da759236cc11798f4e0a5f7d4d59fbc")
         (nonguix-fingerprint
          (openpgp-fingerprint "2A39 3FFF 68F4 EF7A 3D29 12AF 6F51 20A0 22FB B2D5"))
         (sovereign-commit "44a44b4c3c645a878ab8920bf0d250541bf59af0")

         (deployment-introduction (make-channel-introduction deployment-commit
                                                             marekpasnikowski-fingerprint))
         (deployment-url "https://git.marekpasnikowski.pl/git/deployment.git")
         (distribution-introduction (make-channel-introduction distribution-commit
                                                               marekpasnikowski-fingerprint))
         (distribution-url "https://git.marekpasnikowski.pl/git/distribution.git")
         (nonguix-authorized-guix-key-content
          (string-append
           "(public-key \n"
           "(ecc \n"
           "(curve Ed25519) \n"
           "(q #C1FD53E5D4CE971933EC50C9F307AE2171A2D3B52C804642A7A35F84F3A4EA98#))) \n"))
         (nonguix-authorized-guix-key-name "nonguix-authorized-guix-key")
         (nonguix-introduction (make-channel-introduction nonguix-commit
                                                          nonguix-fingerprint))
         (nonguix-url "https://gitlab.com/nonguix/nonguix")
         (sovereign-introduction (make-channel-introduction sovereign-commit
                                                            marekpasnikowski-fingerprint))
         (sovereign-url "https://git.marekpasnikowski.pl/git/sovereign.git")

         (deployment (channel (name 'deployment)
                              (url deployment-url)
                              (introduction deployment-introduction)))
         (distribution (channel (name 'distribution)
                                (url distribution-url)
                                (introduction distribution-introduction)))
         (nonguix (channel (name 'nonguix)
                           (url nonguix-url)
                           (introduction nonguix-introduction)))
         (nonguix-key (plain-file nonguix-authorized-guix-key-name
                                  nonguix-authorized-guix-key-content))
         (sovereign (channel (name 'sovereign)
                             (url sovereign-url)
                             (introduction sovereign-introduction)))

         (nonguix-authorized-guix-keys (list nonguix-key))
         (nonguix-substitute-urls (list "https://substitutes.nonguix.org"))
         (suweren-channels (list deployment
                                 distribution
                                 nonguix
                                 sovereign))

         (%default-authorized-guix-keys* (append %default-authorized-guix-keys
                                                 nonguix-authorized-guix-keys))
         (%default-channels* (append %default-channels
                                     suweren-channels))
         (%default-substitute-urls* (append %default-substitute-urls
                                            nonguix-substitute-urls))
         (extra-options* (list "--gc-keep-derivations=yes"
                               "--gc-keep-outputs=yes")))
    (guix-configuration (inherit configuration)
                        (channels %default-channels*)
                        (authorized-keys %default-authorized-guix-keys*)
                        (substitute-urls %default-substitute-urls*)
                        (extra-options extra-options*))))

(define (locale-definitions*)
  (append %default-locale-definitions
          (list polish-locale)))

;; record login-configuration ->
;; record login-configuration
(define (login configuration)
  (login-configuration (inherit configuration)
                       (allow-empty-passwords? #f)))

;; record syncthing-configuration
(define syncthing-configuration*
  (syncthing-configuration (user "marek")))

;; record syncthing-service-type
(define syncthing
  (service syncthing-service-type
           syncthing-configuration*))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(define-public %suweren-bootloader
  #f)

(define-public %suweren-file-systems
  %base-file-systems)

(define-public %suweren-kernel
  linux)

(define-public %suweren-locale-definitions
  (locale-definitions*))

(define-public %suweren-services
  (let* ((sddm-configuration* (sddm-configuration (theme "breeze")
                                                  (auto-login-user "lilia")))

         (plasma-desktop (service plasma-desktop-service-type))
         (sddm (service sddm-service-type
                        sddm-configuration*))

         (%desktop-services* (modify-services %desktop-services
                                              (delete gdm-service-type)
                                              (guix-service-type configuration
                                                                 =>
                                                                 (guix configuration))
                                              (login-service-type configuration
                                                                  =>
                                                                  (login configuration)))))
    (append %desktop-services*
            suweren-trezor:trezor-bridge
            (list plasma-desktop
                  profile
                  sddm
                  syncthing))))

(define-public %suweren-users
  %base-user-accounts)