Message ID | 875zoqan2e.fsf_-_@sdf.lonestar.org |
---|---|
State | Accepted |
Headers | show |
Series | Add 'guix deploy'. | expand |
Jakob L. Kreuze writes: > This is so machine declarations can have a simple (use-modules (gnu)) > rather than having to import the machine module explicitly. +1
Hi Jakob, > This is so machine declarations can have a simple (use-modules (gnu)) > rather than having to import the machine module explicitly. Do we need this at all or could “guix deploy” evaluate the machine declaration in an environment where the machine module is available? We do something like that for evaluating manifests – no module relating to manifest loading needs to be specified by users and yet “specifications->manifest” is available. Would it make sense to do something similar here instead of exporting (gnu machine) in (gnu)?
Hi Ricardo, Ricardo Wurmus <rekado@elephly.net> writes: > Do we need this at all or could “guix deploy” evaluate the machine > declaration in an environment where the machine module is available? > We do something like that for evaluating manifests – no module > relating to manifest loading needs to be specified by users and yet > “specifications->manifest” is available. > > Would it make sense to do something similar here instead of exporting > (gnu machine) in (gnu)? Thanks for that comment; I'd completely forgotten about not having to import 'specifications->manifest'. I doubt the machine types will see much use outside of deployment specifications, so something like that would definitely make sense here. I'll add it in. Regards, Jakob
diff --git a/gnu.scm b/gnu.scm index 2c29b6dc3f..fa643a5b92 100644 --- a/gnu.scm +++ b/gnu.scm @@ -27,7 +27,8 @@ #:use-module (guix packages) #:use-module (gnu packages) #:use-module (gnu services) - #:export (use-package-modules + #:export (use-machine-modules + use-package-modules use-service-modules use-system-modules)) @@ -45,6 +46,7 @@ (gnu system file-systems) (gnu bootloader) (gnu bootloader grub) + (gnu machine) (gnu system keyboard) (gnu system pam) (gnu system shadow) ; 'user-account' @@ -142,6 +144,10 @@ Try adding @code{(use-service-modules ~a)}.") (current-source-location)) hint))) +(define-syntax-rule (use-machine-modules module ...) + (try-use-modules package-module-hint + (gnu machine module) ...)) + (define-syntax-rule (use-package-modules module ...) (try-use-modules package-module-hint (gnu packages module) ...))