diff options
Diffstat (limited to 'gnu/system.scm')
-rw-r--r-- | gnu/system.scm | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/gnu/system.scm b/gnu/system.scm index 9b5c96d0ad..c76f4d7c50 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -43,13 +43,15 @@ #:use-module (guix deprecation) #:use-module (guix derivations) #:use-module (guix profiles) - #:use-module ((guix utils) #:select (substitute-keyword-arguments)) + #:use-module ((guix utils) #:select (substitute-keyword-arguments + version>?)) #:use-module (guix i18n) #:use-module (guix diagnostics) #:use-module (guix ui) #:use-module (gnu packages admin) #:use-module (gnu packages base) #:use-module (gnu packages bash) + #:use-module ((gnu packages certs) #:select (nss-certs)) #:use-module (gnu packages compression) #:use-module (gnu packages cross-base) #:use-module (gnu packages firmware) @@ -274,7 +276,7 @@ VERSION is the target version of the boot-parameters record." (issue operating-system-issue ; string (default %default-issue)) - (packages operating-system-packages ; list of (PACKAGE OUTPUT...) + (packages %operating-system-packages ; list of (PACKAGE OUTPUT...) (default %base-packages)) ; or just PACKAGE (timezone operating-system-timezone @@ -315,6 +317,37 @@ VERSION is the target version of the boot-parameters record." hosts-service-type (%operating-system-hosts-file os)) +;;; XXX: Remove after a new release of Guix no longer suggests to install +;;; nss-certs. +(define (operating-system-packages os) + "Return the packages of the OS <operating-system> record object." + ;; This wrapper is used to warn users that their operating system packages + ;; field contains a duplicated nss-certs packages. + (let* ((packages (%operating-system-packages os)) + (nss-certs-packages (sort (filter (lambda (p) + (and (package? p) + (string=? "nss-certs" + (package-name p)))) + packages) + (lambda (x y) + ;; Sort from newer to older versions. + (version>? (package-version x) + (package-version y)))))) + (if (> (length nss-certs-packages) 1) + (begin + (warning #f + (G_ "multiple 'nss-certs' packages found; 'nss-certs' \ +is now included by default in '%base-packages'; ensure it is not explicitly \ +listed in the operating system 'packages' field~%")) + (let ((nss-certs-packages (delete-duplicates nss-certs-packages eq?))) + (if (> (length nss-certs-packages) 1) + ;; Only mismatched nss-certs packages need to be handled to + ;; avoid profile collisions; same objects are later + ;; deduplicated in `packages->profile-entry'. + (fold delete packages (drop nss-certs-packages 1)) + packages))) ;no-op + packages))) + (define* (operating-system-kernel-arguments os root-device #:key (version %boot-parameters-version)) "Return all the kernel arguments, including the ones not specified directly @@ -926,6 +959,7 @@ of PROVENANCE-SERVICE-TYPE to its services." (list inetutils isc-dhcp iproute wget + nss-certs ;; wireless-tools is deprecated in favor of iw, but it's still what ;; many people are familiar with, so keep it around. iw wireless-tools)) |