summaryrefslogtreecommitdiff
path: root/gnu/system/install.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/system/install.scm')
-rw-r--r--gnu/system/install.scm246
1 files changed, 127 insertions, 119 deletions
diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index 3aded93f385..05f3795b818 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -22,16 +22,23 @@
22 22
23(define-module (gnu system install) 23(define-module (gnu system install)
24 #:use-module (gnu) 24 #:use-module (gnu)
25 #:use-module (gnu system)
25 #:use-module (gnu bootloader u-boot) 26 #:use-module (gnu bootloader u-boot)
26 #:use-module (guix gexp) 27 #:use-module (guix gexp)
27 #:use-module (guix store) 28 #:use-module (guix store)
28 #:use-module (guix monads) 29 #:use-module (guix monads)
29 #:use-module ((guix store) #:select (%store-prefix)) 30 #:use-module ((guix store) #:select (%store-prefix))
31 #:use-module (gnu installer newt)
32 #:use-module (gnu installer build-installer)
33 #:use-module (gnu services dbus)
34 #:use-module (gnu services networking)
30 #:use-module (gnu services shepherd) 35 #:use-module (gnu services shepherd)
31 #:use-module (gnu services ssh) 36 #:use-module (gnu services ssh)
32 #:use-module (gnu packages admin) 37 #:use-module (gnu packages admin)
33 #:use-module (gnu packages bash) 38 #:use-module (gnu packages bash)
34 #:use-module (gnu packages bootloaders) 39 #:use-module (gnu packages bootloaders)
40 #:use-module (gnu packages fonts)
41 #:use-module (gnu packages fontutils)
35 #:use-module (gnu packages guile) 42 #:use-module (gnu packages guile)
36 #:use-module (gnu packages linux) 43 #:use-module (gnu packages linux)
37 #:use-module (gnu packages ssh) 44 #:use-module (gnu packages ssh)
@@ -202,120 +209,114 @@ the user's target storage device rather than on the RAM disk."
202 (persistent? #f) 209 (persistent? #f)
203 (max-database-size (* 5 (expt 2 20)))))) ;5 MiB 210 (max-database-size (* 5 (expt 2 20)))))) ;5 MiB
204 211
212(define (normal-tty tty)
213 (service kmscon-service-type
214 (kmscon-configuration
215 (virtual-terminal tty)
216 (auto-login "root"))))
217
218(define bare-bones-os
219 (load "examples/bare-bones.tmpl"))
220
205(define %installation-services 221(define %installation-services
206 ;; List of services of the installation system. 222 ;; List of services of the installation system.
207 (let ((motd (plain-file "motd" " 223 (list (login-service (login-configuration
208\x1b[1;37mWelcome to the installation of the Guix System Distribution!\x1b[0m 224 ;; The motd is overlapped by the graphical installer,
209 225 ;; so make sure it is not printed.
210\x1b[2mThere is NO WARRANTY, to the extent permitted by law. In particular, you may 226 (motd #f)))
211LOSE ALL YOUR DATA as a side effect of the installation process. Furthermore, 227
212it is 'beta' software, so it may contain bugs. 228 ;; This will be the active virtual terminal at boot. The graphical
213 229 ;; installer is launched as the 'shell' program of the root
214You have been warned. Thanks for being so brave.\x1b[0m 230 ;; user-account. Thanks to auto-login, it will be started
215"))) 231 ;; automatically. Another option would have been to set the graphical
216 (define (normal-tty tty) 232 ;; installer as a login program. However, it is preferable to wait
217 (mingetty-service (mingetty-configuration (tty tty) 233 ;; for the login phase to be over, so that the environnment variables
218 (auto-login "root") 234 ;; of /etc/environment like LANG are loaded by PAM.
219 (login-pause? #t)))) 235 (normal-tty "tty1")
220 236
221 (define bare-bones-os 237 ;; Documentation.
222 (load "examples/bare-bones.tmpl")) 238 (service kmscon-service-type
223 239 (kmscon-configuration
224 (list (service virtual-terminal-service-type) 240 (virtual-terminal "tty2")
225 241 (login-program (log-to-info))
226 (mingetty-service (mingetty-configuration 242 (auto-login "guest")))
227 (tty "tty1") 243
228 (auto-login "root"))) 244 ;; Documentation add-on.
229 245 %configuration-template-service
230 (login-service (login-configuration 246
231 (motd motd))) 247 ;; A bunch of 'root' ttys.
232 248 (normal-tty "tty3")
233 ;; Documentation. The manual is in UTF-8, but 249 (normal-tty "tty4")
234 ;; 'console-font-service' sets up Unicode support and loads a font 250 (normal-tty "tty5")
235 ;; with all the useful glyphs like em dash and quotation marks. 251 (normal-tty "tty6")
236 (mingetty-service (mingetty-configuration 252
237 (tty "tty2") 253 ;; The usual services.
238 (auto-login "guest") 254 (syslog-service)
239 (login-program (log-to-info)))) 255
240 256 ;; The build daemon. Register the hydra.gnu.org key as trusted.
241 ;; Documentation add-on. 257 ;; This allows the installation process to use substitutes by
242 %configuration-template-service 258 ;; default.
243 259 (service guix-service-type
244 ;; A bunch of 'root' ttys. 260 (guix-configuration (authorize-key? #t)))
245 (normal-tty "tty3") 261
246 (normal-tty "tty4") 262 ;; Start udev so that useful device nodes are available.
247 (normal-tty "tty5") 263 ;; Use device-mapper rules for cryptsetup & co; enable the CRDA for
248 (normal-tty "tty6") 264 ;; regulations-compliant WiFi access.
249 265 (udev-service #:rules (list lvm2 crda))
250 ;; The usual services. 266
251 (syslog-service) 267 ;; Add the 'cow-store' service, which users have to start manually
252 268 ;; since it takes the installation directory as an argument.
253 ;; The build daemon. Register the official server keys as trusted. 269 (cow-store-service)
254 ;; This allows the installation process to use substitutes by 270
255 ;; default. 271 ;; To facilitate copy/paste.
256 (service guix-service-type 272 (service gpm-service-type)
257 (guix-configuration (authorize-key? #t))) 273
258 274 ;; Add an SSH server to facilitate remote installs.
259 ;; Start udev so that useful device nodes are available. 275 (service openssh-service-type
260 ;; Use device-mapper rules for cryptsetup & co; enable the CRDA for 276 (openssh-configuration
261 ;; regulations-compliant WiFi access. 277 (port-number 22)
262 (udev-service #:rules (list lvm2 crda)) 278 (permit-root-login #t)
263 279 ;; The root account is passwordless, so make sure
264 ;; Add the 'cow-store' service, which users have to start manually 280 ;; a password is set before allowing logins.
265 ;; since it takes the installation directory as an argument. 281 (allow-empty-passwords? #f)
266 (cow-store-service) 282 (password-authentication? #t)
267 283
268 ;; Install Unicode support and a suitable font. Use a font that 284 ;; Don't start it upfront.
269 ;; doesn't have more than 256 glyphs so that we can use colors with 285 (%auto-start? #f)))
270 ;; varying brightness levels (see note in setfont(8)). 286
271 (service console-font-service-type 287 ;; Since this is running on a USB stick with a overlayfs as the root
272 (map (lambda (tty) 288 ;; file system, use an appropriate cache configuration.
273 (cons tty "lat9u-16")) 289 (nscd-service (nscd-configuration
274 '("tty1" "tty2" "tty3" "tty4" "tty5" "tty6"))) 290 (caches %nscd-minimal-caches)))
275 291
276 ;; To facilitate copy/paste. 292 ;; Having /bin/sh is a good idea. In particular it allows Tramp
277 (service gpm-service-type) 293 ;; connections to this system to work.
278 294 (service special-files-service-type
279 ;; Add an SSH server to facilitate remote installs. 295 `(("/bin/sh" ,(file-append (canonical-package bash)
280 (service openssh-service-type 296 "/bin/sh"))))
281 (openssh-configuration 297
282 (port-number 22) 298 ;; Loopback device, needed by OpenSSH notably.
283 (permit-root-login #t) 299 (service static-networking-service-type
284 ;; The root account is passwordless, so make sure 300 (list (static-networking (interface "lo")
285 ;; a password is set before allowing logins. 301 (ip "127.0.0.1")
286 (allow-empty-passwords? #f) 302 (requirement '())
287 (password-authentication? #t) 303 (provision '(loopback)))))
288 304
289 ;; Don't start it upfront. 305 (service wpa-supplicant-service-type)
290 (%auto-start? #f))) 306 (dbus-service)
291 307 (service connman-service-type
292 ;; Since this is running on a USB stick with a overlayfs as the root 308 (connman-configuration
293 ;; file system, use an appropriate cache configuration. 309 (disable-vpn? #t)))
294 (nscd-service (nscd-configuration 310
295 (caches %nscd-minimal-caches))) 311 ;; Keep a reference to BARE-BONES-OS to make sure it can be
296 312 ;; installed without downloading/building anything. Also keep the
297 ;; Having /bin/sh is a good idea. In particular it allows Tramp 313 ;; things needed by 'profile-derivation' to minimize the amount of
298 ;; connections to this system to work. 314 ;; download.
299 (service special-files-service-type 315 (service gc-root-service-type
300 `(("/bin/sh" ,(file-append (canonical-package bash) 316 (list bare-bones-os
301 "/bin/sh")))) 317 glibc-utf8-locales
302 318 texinfo
303 ;; Loopback device, needed by OpenSSH notably. 319 (canonical-package guile-2.2)))))
304 (service static-networking-service-type
305 (list (static-networking (interface "lo")
306 (ip "127.0.0.1")
307 (requirement '())
308 (provision '(loopback)))))
309
310 ;; Keep a reference to BARE-BONES-OS to make sure it can be
311 ;; installed without downloading/building anything. Also keep the
312 ;; things needed by 'profile-derivation' to minimize the amount of
313 ;; download.
314 (service gc-root-service-type
315 (list bare-bones-os
316 glibc-utf8-locales
317 texinfo
318 (canonical-package guile-2.2))))))
319 320
320(define %issue 321(define %issue
321 ;; Greeting. 322 ;; Greeting.
@@ -360,13 +361,18 @@ You have been warned. Thanks for being so brave.\x1b[0m
360 %shared-memory-file-system 361 %shared-memory-file-system
361 %immutable-store))) 362 %immutable-store)))
362 363
363 (users (list (user-account 364 (users (list
364 (name "guest") 365 (user-account
365 (group "users") 366 (inherit %root-account)
366 (supplementary-groups '("wheel")) ; allow use of sudo 367 ;; Launch the graphical installer.
367 (password "") 368 (shell (installer-program newt-installer)))
368 (comment "Guest of GNU") 369 (user-account
369 (home-directory "/home/guest")))) 370 (name "guest")
371 (group "users")
372 (supplementary-groups '("wheel")) ; allow use of sudo
373 (password "")
374 (comment "Guest of GNU")
375 (home-directory "/home/guest"))))
370 376
371 (issue %issue) 377 (issue %issue)
372 (services %installation-services) 378 (services %installation-services)
@@ -381,6 +387,8 @@ You have been warned. Thanks for being so brave.\x1b[0m
381 387
382 (packages (cons* (canonical-package glibc) ;for 'tzselect' & co. 388 (packages (cons* (canonical-package glibc) ;for 'tzselect' & co.
383 parted gptfdisk ddrescue 389 parted gptfdisk ddrescue
390 fontconfig
391 font-dejavu font-gnu-unifont
384 grub ;mostly so xrefs to its manual work 392 grub ;mostly so xrefs to its manual work
385 cryptsetup 393 cryptsetup
386 mdadm 394 mdadm