summaryrefslogtreecommitdiff
path: root/gnu/system
diff options
context:
space:
mode:
authorJakub Kądziołka <kuba@kadziolka.net>2020-04-29 11:08:42 +0200
committerJakub Kądziołka <kuba@kadziolka.net>2020-04-29 11:08:42 +0200
commit4035c3e3525599c3aa958d498c5bc789a4adffc3 (patch)
treee55a02215fcdb635d0504fc129526bfbf66abd14 /gnu/system
parent492b82bd4d592276e65c4b9bfbe1b679a00ff09f (diff)
parent4f0f46e4af0e342d84c5ad448258702029601e4b (diff)
Merge branch 'master' into staging
Diffstat (limited to 'gnu/system')
-rw-r--r--gnu/system/examples/lightweight-desktop.tmpl3
-rw-r--r--gnu/system/file-systems.scm3
-rw-r--r--gnu/system/install.scm43
-rw-r--r--gnu/system/keyboard.scm7
-rw-r--r--gnu/system/linux-container.scm6
-rw-r--r--gnu/system/shadow.scm16
-rw-r--r--gnu/system/vm.scm39
7 files changed, 93 insertions, 24 deletions
diff --git a/gnu/system/examples/lightweight-desktop.tmpl b/gnu/system/examples/lightweight-desktop.tmpl
index 45d9bf447f..20b122fe51 100644
--- a/gnu/system/examples/lightweight-desktop.tmpl
+++ b/gnu/system/examples/lightweight-desktop.tmpl
@@ -5,6 +5,7 @@
(use-modules (gnu) (gnu system nss))
(use-service-modules desktop)
(use-package-modules bootloaders certs ratpoison suckless wm)
+(use-package-modules bootloaders certs ratpoison suckless wm xorg)
(operating-system
(host-name "antelope")
@@ -43,6 +44,8 @@
(packages (append (list
;; window managers
ratpoison i3-wm i3status dmenu
+ ;; terminal emulator
+ xterm
;; for HTTPS access
nss-certs)
%base-packages))
diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm
index 3b599efa8e..b41f66e943 100644
--- a/gnu/system/file-systems.scm
+++ b/gnu/system/file-systems.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -389,7 +390,7 @@ TARGET in the other system."
;; parent directory.
(dependencies (list parent))))
'("cpuset" "cpu" "cpuacct" "memory" "devices" "freezer"
- "blkio" "perf_event")))))
+ "blkio" "perf_event" "pids")))))
(define %elogind-file-systems
;; We don't use systemd, but these file systems are needed for elogind,
diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index c15c2c7814..d31ed9a197 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -4,6 +4,7 @@
;;; Copyright © 2016 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2020 Florian Pelz <pelzflorian@pelzflorian.de>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -27,6 +28,7 @@
#:use-module (guix gexp)
#:use-module (guix store)
#:use-module (guix monads)
+ #:use-module (guix modules)
#:use-module ((guix packages) #:select (package-version))
#:use-module ((guix store) #:select (%store-prefix))
#:use-module (gnu installer)
@@ -50,6 +52,7 @@
#:use-module (gnu packages texinfo)
#:use-module (gnu packages compression)
#:use-module (gnu packages nvi)
+ #:use-module (gnu packages xorg)
#:use-module (ice-9 match)
#:use-module (srfi srfi-26)
#:export (installation-os
@@ -287,6 +290,38 @@ the user's target storage device rather than on the RAM disk."
(persistent? #f)
(max-database-size (* 5 (expt 2 20)))))) ;5 MiB
+
+;; These define a service to load the uvesafb kernel module with the
+;; appropriate options. The GUI installer needs it when the machine does not
+;; support Kernel Mode Setting. Otherwise kmscon is missing /dev/fb0.
+(define (uvesafb-shepherd-service _)
+ (list (shepherd-service
+ (documentation "Load the uvesafb kernel module if needed.")
+ (provision '(maybe-uvesafb))
+ (requirement '(file-systems))
+ (start #~(lambda ()
+ ;; uvesafb is only supported on x86 and x86_64.
+ (or (not (and (string-suffix? "linux-gnu" %host-type)
+ (or (string-prefix? "x86_64" %host-type)
+ (string-prefix? "i686" %host-type))))
+ (file-exists? "/dev/fb0")
+ (invoke #+(file-append kmod "/bin/modprobe")
+ "uvesafb"
+ (string-append "v86d=" #$v86d "/sbin/v86d")
+ "mode_option=1024x768"))))
+ (respawn? #f)
+ (one-shot? #t))))
+
+(define uvesafb-service-type
+ (service-type
+ (name 'uvesafb)
+ (extensions
+ (list (service-extension shepherd-root-service-type
+ uvesafb-shepherd-service)))
+ (description
+ "Load the @code{uvesafb} kernel module with the right options.")
+ (default-value #t)))
+
(define %installation-services
;; List of services of the installation system.
(let ((motd (plain-file "motd" "
@@ -408,7 +443,13 @@ Access documentation at any time by pressing Alt-F2.\x1b[0m
(list bare-bones-os
glibc-utf8-locales
texinfo
- (canonical-package guile-2.2))))))
+ (canonical-package guile-2.2)))
+
+ ;; Machines without Kernel Mode Setting (those with many old and
+ ;; current AMD GPUs, SiS GPUs, ...) need uvesafb to show the GUI
+ ;; installer. Some may also need a kernel parameter like nomodeset
+ ;; or vga=793, but we leave that for the user to specify in GRUB.
+ (service uvesafb-service-type))))
(define %issue
;; Greeting.
diff --git a/gnu/system/keyboard.scm b/gnu/system/keyboard.scm
index cd3ab37b27..5bd13a44be 100644
--- a/gnu/system/keyboard.scm
+++ b/gnu/system/keyboard.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -94,5 +94,8 @@ Layout information is taken from the XKEYBOARD-CONFIG package."
#$(keyboard-layout-name layout))))))
(computed-file (string-append "console-keymap."
- (keyboard-layout-name layout))
+ (string-map (match-lambda
+ (#\, #\-)
+ (chr chr))
+ (keyboard-layout-name layout)))
build))
diff --git a/gnu/system/linux-container.scm b/gnu/system/linux-container.scm
index c8807398b3..c5e2e4bf9c 100644
--- a/gnu/system/linux-container.scm
+++ b/gnu/system/linux-container.scm
@@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 David Thompson <davet@gnu.org>
-;;; Copyright © 2016, 2017, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016, 2017, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2019 Arun Isaac <arunisaac@systemreboot.net>
;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
;;;
@@ -53,9 +53,7 @@ from OS that are needed on the bare metal and not in a container."
(operating-system-default-essential-services os)))
(cons (service system-service-type
- (let ((locale (operating-system-locale-directory os)))
- (with-monad %store-monad
- (return `(("locale" ,locale))))))
+ `(("locale" ,(operating-system-locale-directory os))))
;; If network is to be shared with the host, remove network
;; configuration files from etc-service.
(if shared-network?
diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm
index 46efdfddab..a6f1d806cf 100644
--- a/gnu/system/shadow.scm
+++ b/gnu/system/shadow.scm
@@ -1,7 +1,8 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -215,6 +216,10 @@ for a colorful Guile experience.\\n\\n\"))))\n"))
((target source)
(copy-recursively source target)))
'#$skeletons)
+ ;; Make nanorc respect XDG_CONFIG_HOME.
+ (when (file-exists? ".nanorc")
+ (mkdir-p ".config/nano")
+ (rename-file ".nanorc" ".config/nano/nanorc"))
#t))))
(define (assert-valid-users/groups users groups)
@@ -309,9 +314,7 @@ accounts among ACCOUNTS+GROUPS."
;;
;; XXX: We arrange for this service to stop right after it's done its job so
;; that 'guix system reconfigure' knows that it can reload it fearlessly
- ;; (and thus create new home directories). The cost of this hack is that
- ;; there's a small window during which first-time logins could happen before
- ;; the home directory has been created.
+ ;; (and thus create new home directories).
(list (shepherd-service
(requirement '(file-systems))
(provision '(user-homes))
@@ -369,6 +372,11 @@ the /etc/skel directory for those."
account-activation)
(service-extension shepherd-root-service-type
account-shepherd-service)
+ ;; Have 'user-processes' depend on 'user-homes' so that
+ ;; daemons start after their home directory has been
+ ;; created.
+ (service-extension user-processes-service-type
+ (const '(user-homes)))
(service-extension etc-service-type
etc-files)))))
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index c6ec25a895..6f81ac16ff 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -50,8 +50,6 @@
#:use-module (gnu packages disk)
#:use-module (gnu packages zile)
#:use-module (gnu packages linux)
- #:use-module ((gnu packages make-bootstrap)
- #:select (%guile-static-stripped))
#:use-module (gnu packages admin)
#:use-module (gnu bootloader)
@@ -158,7 +156,9 @@
(references-graphs #f)
(memory-size 256)
(disk-image-format "qcow2")
- (disk-image-size 'guess))
+ (disk-image-size 'guess)
+
+ (substitutable? #t))
"Evaluate EXP in a QEMU virtual machine running LINUX with INITRD (a
derivation). The virtual machine runs with MEMORY-SIZE MiB of memory. In the
virtual machine, EXP has access to FILE-SYSTEMS, which, by default, includes a
@@ -175,7 +175,10 @@ based on the size of the closure of REFERENCES-GRAPHS.
When REFERENCES-GRAPHS is true, it must be a list of file name/store path
pairs, as for `derivation'. The files containing the reference graphs are
-made available under the /xchg CIFS share."
+made available under the /xchg CIFS share.
+
+SUBSTITUTABLE? determines whether the returned derivation should be marked as
+substitutable."
(define user-builder
(program-file "builder-in-linux-vm" exp))
@@ -257,7 +260,8 @@ made available under the /xchg CIFS share."
#:target target
#:env-vars env-vars
#:guile-for-build guile-for-build
- #:references-graphs references-graphs)))
+ #:references-graphs references-graphs
+ #:substitutable? substitutable?)))
(define (has-guix-service-type? os)
"Return true if OS contains a service of the type GUIX-SERVICE-TYPE."
@@ -277,7 +281,8 @@ made available under the /xchg CIFS share."
bootloader
(register-closures? (has-guix-service-type? os))
(inputs '())
- (grub-mkrescue-environment '()))
+ (grub-mkrescue-environment '())
+ (substitutable? #t))
"Return a bootable, stand-alone iso9660 image.
INPUTS is a list of inputs (as for packages)."
@@ -348,6 +353,7 @@ INPUTS is a list of inputs (as for packages)."
#:make-disk-image? #f
#:single-file-output? #t
#:references-graphs inputs
+ #:substitutable? substitutable?
;; Xorriso seems to be quite memory-hungry, so increase the VM's RAM size.
#:memory-size 512))
@@ -367,7 +373,8 @@ INPUTS is a list of inputs (as for packages)."
bootloader
(register-closures? (has-guix-service-type? os))
(inputs '())
- copy-inputs?)
+ copy-inputs?
+ (substitutable? #t))
"Return a bootable, stand-alone QEMU image of type DISK-IMAGE-FORMAT (e.g.,
'qcow2' or 'raw'), with a root partition of type FILE-SYSTEM-TYPE.
Optionally, FILE-SYSTEM-LABEL can be specified as the volume name for the root
@@ -495,7 +502,8 @@ system."
#:make-disk-image? #t
#:disk-image-size disk-image-size
#:disk-image-format disk-image-format
- #:references-graphs inputs))
+ #:references-graphs inputs
+ #:substitutable? substitutable?))
(define* (system-docker-image os
#:key
@@ -650,11 +658,15 @@ TYPE (one of 'iso9660 or 'dce). Return a UUID object."
(name "disk-image")
(file-system-type "ext4")
(disk-image-size (* 900 (expt 2 20)))
- (volatile? #t))
+ (volatile? #t)
+ (substitutable? #t))
"Return the derivation of a disk image of DISK-IMAGE-SIZE bytes of the
system described by OS. Said image can be copied on a USB stick as is. When
VOLATILE? is true, the root file system is made volatile; this is useful
-to USB sticks meant to be read-only."
+to USB sticks meant to be read-only.
+
+SUBSTITUTABLE? determines whether the returned derivation should be marked as
+substitutable."
(define normalize-label
;; ISO labels are all-caps (case-insensitive), but since
;; 'find-partition-by-label' is case-sensitive, make it all-caps here.
@@ -723,7 +735,8 @@ to USB sticks meant to be read-only."
#:inputs `(("system" ,os)
("bootcfg" ,bootcfg))
#:grub-mkrescue-environment
- '(("MKRESCUE_SED_MODE" . "mbr_hfs")))
+ '(("MKRESCUE_SED_MODE" . "mbr_hfs"))
+ #:substitutable? substitutable?)
(qemu-image #:name name
#:os os
#:bootcfg-drv bootcfg
@@ -736,7 +749,8 @@ to USB sticks meant to be read-only."
#:file-system-uuid uuid
#:copy-inputs? #t
#:inputs `(("system" ,os)
- ("bootcfg" ,bootcfg))))))
+ ("bootcfg" ,bootcfg))
+ #:substitutable? substitutable?))))
(define* (system-qemu-image os
#:key
@@ -925,6 +939,7 @@ with '-virtfs' options for the host file systems listed in SHARED-FS."
'())
"-no-reboot"
+ "-nic" "user,model=virtio-net-pci"
"-object" "rng-random,filename=/dev/urandom,id=guixsd-vm-rng"
"-device" "virtio-rng-pci,rng=guixsd-vm-rng"