unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu.scm: add syntatic sugar macros for use-modules of packages, services, and system in the OS EDSL.
@ 2015-01-18 22:32 jgrant
  2015-01-19 12:54 ` David Thompson
  0 siblings, 1 reply; 4+ messages in thread
From: jgrant @ 2015-01-18 22:32 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 443 bytes --]

These macros allow for nicer and more condensed loading of package, 
service, and system modules in the OS EDSL. For an example of this, 
please take a look of the sample-os-config.scm (above the commented-out 
line).

I want to thank davexunit for his influence on this , this will be my 
first non-package recipe config. :^)

As always, if you see something blatantly astray don't be shy to poke 
the ol' bootay.

Thanks & Regards.
- JGrant.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-PATCH-gnu.scm-add-syntactic-sugar-macros-for-use-mod.patch --]
[-- Type: text/x-diff; name=0001-PATCH-gnu.scm-add-syntactic-sugar-macros-for-use-mod.patch, Size: 1255 bytes --]

From ee940d31ec9b3847c1bd9dfe817ba8f6550361bc Mon Sep 17 00:00:00 2001
From: "Joshua S. Grant" <jgrant@parethetical.io>
Date: Sun, 18 Jan 2015 16:23:21 -0600
Subject: [PATCH] [PATCH] gnu.scm: add syntactic sugar macros for use-modules
 of packages, services, and system in the OS EDSL.

---
 gnu.scm | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/gnu.scm b/gnu.scm
index eb0bf71..bca4586 100644
--- a/gnu.scm
+++ b/gnu.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2015 Joshua S. Grant <jgrant@parenthetical.io>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -44,4 +45,19 @@
                   (module-use! i (resolve-interface m))))
               %public-modules)))
 
+;;; Commentary:
+;;;
+;;; Macros that add Syntatic Sugar to use-modules of packages, services, and system.
+;;;
+;;; Code:
+
+(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
-- 
2.1.0


[-- Attachment #3: sample-os-config.scm --]
[-- Type: text/plain, Size: 1561 bytes --]

(use-modules (gnu)
	     (gnu packages)
 	     (gnu services)
 	     (gnu system)
 	     (guix monads))

(use-package-modules
   emacs conkeror ratpoison feh grub gawk perl ncurses aspell fonts
   version-control ssh wget video xiph file compression admin linux xorg)

(use-service-modules
   base networking ssh dbus xorg)

;; -------------------------------------------------------------------------------------

(operating-system
  (host-name "Guixotic")
  (timezone "America/Chicago")
  (bootloader (grub-configuration
	       (device "/dev/sda")))
  (file-systems (cons (file-system
		       (device "/dev/sda1")
				(title 'label)
		       (mount-point "/")
		       (type "ext4"))
		      %base-file-systems))
  (users (list (user-account
		(name "gnuser")
		(group "gnuser")
		(password "")
		(uid 1000)
		(supplementary-groups '("wheel","users","audio","video","dialout"))
		(home-directory "/home/gnuser"))))
  (groups (cons (user-group
		 (name "gnuser")
		 (id 1000))
		%base-groups))

  (packages (cons* grub
		   tar gzip bzip2 xz file diffutils gawk perl
                   ncurses git wget openssh
		   isc-dhcp wireless-tools wpa-supplicant		   
		   xset setxkbmap xkill
                   aspell aspell-dict-en font-dejavu font-terminus
                   feh alsa-utils vorbis-tools ffmpeg mplayer
		   xterm ratpoison conkeror
                   emacs emms magit geiser paredit
		   %base-packages))

  (services (cons* (dhcp-client-service #:dhcp isc-dhcp)
                   (dbus-service '())
		   (slim-service)
		   %base-services)))


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-01-22 16:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-18 22:32 [PATCH] gnu.scm: add syntatic sugar macros for use-modules of packages, services, and system in the OS EDSL jgrant
2015-01-19 12:54 ` David Thompson
2015-01-19 16:13   ` [PATCH v2] " jgrant
2015-01-22 16:02     ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).