mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
installer: Set the system's 'keyboard-layout' field.
* gnu/installer/newt/keymap.scm (keyboard-layout->configuration): New procedure. * gnu/installer.scm (compute-keymap-step): Return RESULT. (installer-steps) <'keymap>: Add 'configuration-formatter' field. (installer-program): Use (gnu installer newt keymap). * gnu/installer/parted.scm (bootloader-configuration): Set 'keyboard-layout'.
This commit is contained in:
parent
cde08a5120
commit
3191b5f6ba
3 changed files with 24 additions and 4 deletions
|
@ -1,5 +1,6 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com>
|
;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com>
|
||||||
|
;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -156,7 +157,8 @@ selected keymap."
|
||||||
(lambda (models layouts)
|
(lambda (models layouts)
|
||||||
((installer-keymap-page current-installer)
|
((installer-keymap-page current-installer)
|
||||||
layouts)))))
|
layouts)))))
|
||||||
(#$apply-keymap result))))
|
(#$apply-keymap result)
|
||||||
|
result)))
|
||||||
|
|
||||||
(define (installer-steps)
|
(define (installer-steps)
|
||||||
(let ((locale-step (compute-locale-step
|
(let ((locale-step (compute-locale-step
|
||||||
|
@ -208,7 +210,8 @@ selected keymap."
|
||||||
(id 'keymap)
|
(id 'keymap)
|
||||||
(description (G_ "Keyboard mapping selection"))
|
(description (G_ "Keyboard mapping selection"))
|
||||||
(compute (lambda _
|
(compute (lambda _
|
||||||
(#$keymap-step current-installer))))
|
(#$keymap-step current-installer)))
|
||||||
|
(configuration-formatter keyboard-layout->configuration))
|
||||||
|
|
||||||
;; Run a partitioning tool allowing the user to modify
|
;; Run a partitioning tool allowing the user to modify
|
||||||
;; partition tables, partitions and their mount points.
|
;; partition tables, partitions and their mount points.
|
||||||
|
@ -313,6 +316,8 @@ selected keymap."
|
||||||
(gnu installer timezone)
|
(gnu installer timezone)
|
||||||
(gnu installer user)
|
(gnu installer user)
|
||||||
(gnu installer newt)
|
(gnu installer newt)
|
||||||
|
((gnu installer newt keymap)
|
||||||
|
#:select (keyboard-layout->configuration))
|
||||||
(guix i18n)
|
(guix i18n)
|
||||||
(guix build utils)
|
(guix build utils)
|
||||||
(ice-9 match))
|
(ice-9 match))
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com>
|
;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com>
|
||||||
|
;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -27,7 +28,9 @@
|
||||||
#:use-module (srfi srfi-26)
|
#:use-module (srfi srfi-26)
|
||||||
#:use-module (srfi srfi-34)
|
#:use-module (srfi srfi-34)
|
||||||
#:use-module (srfi srfi-35)
|
#:use-module (srfi srfi-35)
|
||||||
#:export (run-keymap-page))
|
#:use-module (ice-9 match)
|
||||||
|
#:export (run-keymap-page
|
||||||
|
keyboard-layout->configuration))
|
||||||
|
|
||||||
(define (run-layout-page layouts layout->text)
|
(define (run-layout-page layouts layout->text)
|
||||||
(let ((title (G_ "Layout")))
|
(let ((title (G_ "Layout")))
|
||||||
|
@ -120,3 +123,11 @@ names of the selected keyboard layout and variant."
|
||||||
(list layout (or variant ""))))
|
(list layout (or variant ""))))
|
||||||
(format-result
|
(format-result
|
||||||
(run-installer-steps #:steps keymap-steps)))
|
(run-installer-steps #:steps keymap-steps)))
|
||||||
|
|
||||||
|
(define (keyboard-layout->configuration keymap)
|
||||||
|
"Return the operating system configuration snippet to install KEYMAP."
|
||||||
|
(match keymap
|
||||||
|
((name "")
|
||||||
|
`((keyboard-layout (keyboard-layout ,name))))
|
||||||
|
((name variant)
|
||||||
|
`((keyboard-layout (keyboard-layout ,name ,variant))))))
|
||||||
|
|
|
@ -1258,7 +1258,11 @@ from (gnu system mapped-devices) and return it."
|
||||||
`((bootloader grub-efi-bootloader)
|
`((bootloader grub-efi-bootloader)
|
||||||
(target ,(default-esp-mount-point)))
|
(target ,(default-esp-mount-point)))
|
||||||
`((bootloader grub-bootloader)
|
`((bootloader grub-bootloader)
|
||||||
(target ,root-partition-disk)))))))
|
(target ,root-partition-disk)))
|
||||||
|
|
||||||
|
;; XXX: Assume we defined the 'keyboard-layout' field of
|
||||||
|
;; <operating-system> right above.
|
||||||
|
(keyboard-layout keyboard-layout)))))
|
||||||
|
|
||||||
(define (user-partitions->configuration user-partitions)
|
(define (user-partitions->configuration user-partitions)
|
||||||
"Return the configuration field for USER-PARTITIONS."
|
"Return the configuration field for USER-PARTITIONS."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue