diff options
author | Jakub Kądziołka <kuba@kadziolka.net> | 2020-04-29 11:08:42 +0200 |
---|---|---|
committer | Jakub Kądziołka <kuba@kadziolka.net> | 2020-04-29 11:08:42 +0200 |
commit | 4035c3e3525599c3aa958d498c5bc789a4adffc3 (patch) | |
tree | e55a02215fcdb635d0504fc129526bfbf66abd14 /gnu/services.scm | |
parent | 492b82bd4d592276e65c4b9bfbe1b679a00ff09f (diff) | |
parent | 4f0f46e4af0e342d84c5ad448258702029601e4b (diff) | |
download | guix-4035c3e3525599c3aa958d498c5bc789a4adffc3.tar.gz guix-4035c3e3525599c3aa958d498c5bc789a4adffc3.zip |
Merge branch 'master' into staging
Diffstat (limited to 'gnu/services.scm')
-rw-r--r-- | gnu/services.scm | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/gnu/services.scm b/gnu/services.scm index e7a3a95e43..2e4648bf78 100644 --- a/gnu/services.scm +++ b/gnu/services.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2016 Chris Marusich <cmmarusich@gmail.com> ;;; ;;; This file is part of GNU Guix. @@ -318,11 +318,11 @@ This is a shorthand for (map (lambda (svc) ...) %base-services)." ;;; Core services. ;;; -(define (system-derivation mentries mextensions) +(define (system-derivation entries mextensions) "Return as a monadic value the derivation of the 'system' directory containing the given entries." - (mlet %store-monad ((entries mentries) - (extensions (sequence %store-monad mextensions))) + (mlet %store-monad ((extensions (mapm/accumulate-builds identity + mextensions))) (lower-object (file-union "system" (append entries (concatenate extensions)))))) @@ -579,6 +579,10 @@ ACTIVATION-SCRIPT-TYPE." #~(begin (setenv "LINUX_MODULE_DIRECTORY" "/run/booted-system/kernel/lib/modules") + ;; FIXME: Remove this crutch when the patch #40422, + ;; updating to kmod 27 is merged. + (setenv "MODPROBE_OPTIONS" + "-C /etc/modprobe.d") (apply execl #$modprobe (cons #$modprobe (cdr (command-line)))))))) @@ -627,6 +631,23 @@ and FILE could be \"/usr/bin/env\"." (files->etc-directory (service-value service))) (define (files->etc-directory files) + (define (assert-no-duplicates files) + (let loop ((files files) + (seen (set))) + (match files + (() #t) + (((file _) rest ...) + (when (set-contains? seen file) + (raise (condition + (&message + (message (format #f (G_ "duplicate '~a' entry for /etc") + file)))))) + (loop rest (set-insert file seen)))))) + + ;; Detect duplicates early instead of letting them through, eventually + ;; leading to a build failure of "etc.drv". + (assert-no-duplicates files) + (file-union "etc" files)) (define (etc-entry files) @@ -669,10 +690,10 @@ executables, making them setuid-root."))) (define (packages->profile-entry packages) "Return a system entry for the profile containing PACKAGES." - (mlet %store-monad ((profile (profile-derivation - (packages->manifest - (delete-duplicates packages eq?))))) - (return `(("profile" ,profile))))) + (with-monad %store-monad + (return `(("profile" ,(profile + (content (packages->manifest + (delete-duplicates packages eq?))))))))) (define profile-service-type ;; The service that populates the system's profile---i.e., |