summary refs log tree commit diff
path: root/gnu/system/vm.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-09-11 22:36:50 +0200
committerLudovic Courtès <ludo@gnu.org>2013-09-11 22:36:50 +0200
commit0ded70f37d47579ca058f2f4ca27335129a96e25 (patch)
tree87f4be8fc34201c75aebe6fb4e335e0078a0fffc /gnu/system/vm.scm
parentaedb72fbe07b82da00f6c7a397794d465c217135 (diff)
downloadguix-0ded70f37d47579ca058f2f4ca27335129a96e25.tar.gz
gnu: Move helper code to (gnu system …) modules.
* gnu/packages/grub.scm (<menu-entry>, grub-configuration-file): Move
  to...
* gnu/system/grub.scm: ... here.  New file.
* gnu/packages/linux.scm (<pam-service>, <pam-entry>,
  pam-service->configuration, pam-service->directory,
  %pam-other-services, unix-pam-service): Move to...
* gnu/system/linux.scm: ... here.  New file.
* gnu/system/vm.scm (passwd-file): Move to...
* gnu/system/shadow.scm: ... here.  New file.
* gnu-system.am (GNU_SYSTEM_MODULES): Add
  gnu/system/{grub,linux,shadow}.scm.
Diffstat (limited to 'gnu/system/vm.scm')
-rw-r--r--gnu/system/vm.scm33
1 files changed, 6 insertions, 27 deletions
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 6886e67c21..192ed1d5a3 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -34,9 +34,15 @@
   #:use-module ((gnu packages make-bootstrap)
                 #:select (%guile-static-stripped))
   #:use-module (gnu packages system)
+
+  #:use-module (gnu system shadow)
+  #:use-module (gnu system linux)
+  #:use-module (gnu system grub)
+
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-26)
   #:use-module (ice-9 match)
+
   #:export (expression->derivation-in-linux-vm
             qemu-image
             system-qemu-image))
@@ -346,33 +352,6 @@ It can be used to provide additional files, such as /etc files."
 ;;; Stand-alone VM image.
 ;;;
 
-(define* (passwd-file store accounts #:key shadow?)
-  "Return a password file for ACCOUNTS, a list of vectors as returned by
-'getpwnam'.  If SHADOW? is true, then it is a /etc/shadow file, otherwise it
-is a /etc/passwd file."
-  ;; XXX: The resulting file is world-readable, so beware when SHADOW? is #t!
-  (define contents
-    (let loop ((accounts accounts)
-               (result   '()))
-      (match accounts
-        ((#(name pass uid gid comment home-dir shell) rest ...)
-         (loop rest
-               (cons (if shadow?
-                         (string-append name
-                                        ":"       ; XXX: use (crypt PASS …)?
-                                        ":::::::")
-                         (string-append name
-                                        ":" "x"
-                                        ":" (number->string uid)
-                                        ":" (number->string gid)
-                                        ":" comment ":" home-dir ":" shell))
-                     result)))
-        (()
-         (string-join (reverse result) "\n" 'suffix)))))
-
-  (add-text-to-store store (if shadow? "shadow" "passwd")
-                     contents '()))
-
 (define (system-qemu-image store)
   "Return the derivation of a QEMU image of the GNU system."
   (define %pam-services