gnu: Add convenience macros to make module imports more concise.
* gnu.scm (use-package-modules, use-service-modules, use-system-modules): New macros.master
parent
3698f524d5
commit
fbb020451e
15
gnu.scm
15
gnu.scm
|
@ -1,5 +1,6 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org>
|
;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org>
|
||||||
|
;;; Copyright © 2015 Joshua S. Grant <jgrant@parenthetical.io>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -16,7 +17,10 @@
|
||||||
;;; You should have received a copy of the GNU General Public License
|
;;; You should have received a copy of the GNU General Public License
|
||||||
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
(define-module (gnu))
|
(define-module (gnu)
|
||||||
|
#:export (use-package-modules
|
||||||
|
use-service-modules
|
||||||
|
use-system-modules))
|
||||||
|
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
;;;
|
;;;
|
||||||
|
@ -44,4 +48,13 @@
|
||||||
(module-use! i (resolve-interface m))))
|
(module-use! i (resolve-interface m))))
|
||||||
%public-modules)))
|
%public-modules)))
|
||||||
|
|
||||||
|
(define-syntax-rule (use-package-modules module ...)
|
||||||
|
(use-modules (gnu packages module) ...))
|
||||||
|
|
||||||
|
(define-syntax-rule (use-service-modules module ...)
|
||||||
|
(use-modules (gnu services module) ...))
|
||||||
|
|
||||||
|
(define-syntax-rule (use-system-modules module ...)
|
||||||
|
(use-modules (gnu system module) ...))
|
||||||
|
|
||||||
;;; gnu.scm ends here
|
;;; gnu.scm ends here
|
||||||
|
|
Reference in New Issue