me
/
guix
Archived
1
0
Fork 0

system: Warn about swap-devices format change

* gnu/system.scm (warn-swap-devices-change,
%warn-swap-devices-change): Add them.
* gnu/system.scm (operating-system) [swap-devices]: Use it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
master
Josselin Poiret 2021-11-15 20:26:28 +00:00 committed by Ludovic Courtès
parent 133a61ae26
commit f574dbd163
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 16 additions and 0 deletions

View File

@ -235,6 +235,8 @@
(file-systems operating-system-file-systems) ; list of fs
(swap-devices operating-system-swap-devices ; list of string | <swap-space>
(default '())
(delayed)
(sanitize warn-swap-devices-change))
(users operating-system-users ; list of user accounts
(default %base-user-accounts))
@ -583,6 +585,20 @@ mapped-device '~a' may not be mounted by the bootloader.~%")
(map device-mapping-service
(operating-system-user-mapped-devices os)))
(define-syntax-rule (warn-swap-devices-change value)
(%warn-swap-devices-change value (current-source-location)))
(define (%warn-swap-devices-change value location)
(map (lambda (x)
(unless (swap-space? x)
(warning
(source-properties->location
location)
(G_ "List elements of the field 'swap-devices' should \
now use the <swap-space> record, as the old method is deprecated. \
See \"(guix) operating-system Reference\" for more details.~%")))
x) value))
(define (swap-services os)
"Return the list of swap services for OS."
(map swap-service (operating-system-swap-devices os)))