summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua S. Grant <jgrant@parenthetical.io>2015-01-22 16:59:35 +0100
committerLudovic Courtès <ludo@gnu.org>2015-01-22 17:01:01 +0100
commitfbb020451ea25896936a5fba966612b59c0bcdf3 (patch)
treec5a6650e4c6e282167d5cffa8e2e5d6626bc3158
parent3698f524d5d1777aebec653c444783800a70417a (diff)
gnu: Add convenience macros to make module imports more concise.
* gnu.scm (use-package-modules, use-service-modules, use-system-modules): New macros.
-rw-r--r--gnu.scm15
1 files changed, 14 insertions, 1 deletions
diff --git a/gnu.scm b/gnu.scm
index eb0bf71ab1e..d9b9117b8ad 100644
--- a/gnu.scm
+++ b/gnu.scm
@@ -1,5 +1,6 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org>
3;;; Copyright © 2015 Joshua S. Grant <jgrant@parenthetical.io>
3;;; 4;;;
4;;; This file is part of GNU Guix. 5;;; This file is part of GNU Guix.
5;;; 6;;;
@@ -16,7 +17,10 @@
16;;; You should have received a copy of the GNU General Public License 17;;; You should have received a copy of the GNU General Public License
17;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. 18;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18 19
19(define-module (gnu)) 20(define-module (gnu)
21 #:export (use-package-modules
22 use-service-modules
23 use-system-modules))
20 24
21;;; Commentary: 25;;; Commentary:
22;;; 26;;;
@@ -44,4 +48,13 @@
44 (module-use! i (resolve-interface m)))) 48 (module-use! i (resolve-interface m))))
45 %public-modules))) 49 %public-modules)))
46 50
51(define-syntax-rule (use-package-modules module ...)
52 (use-modules (gnu packages module) ...))
53
54(define-syntax-rule (use-service-modules module ...)
55 (use-modules (gnu services module) ...))
56
57(define-syntax-rule (use-system-modules module ...)
58 (use-modules (gnu system module) ...))
59
47;;; gnu.scm ends here 60;;; gnu.scm ends here