aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu installer user)
  #:use-module (gnu installer utils)
  #:use-module (guix records)
  #:use-module (guix read-print)
  #:use-module (srfi srfi-1)
  #:use-module (srfi srfi-9)
  #:use-module (srfi srfi-9 gnu)
  #:export (<user>
            user
            make-user
            user-name
            user-real-name
            user-group
            user-home-directory
            user-password

            users->configuration))

(define-record-type* <user>
  user make-user
  user?
  (name            user-name)
  (real-name       user-real-name
                   (default ""))
  (group           user-group
                   (default "users"))
  (password        user-password)
  (home-directory  user-home-directory))

(define (users->configuration users)
  "Return the configuration field for USERS."
  (define (user->sexp user)
    `(user-account
      (name ,(user-name user))
      (comment ,(user-real-name user))
      (group ,(user-group user))
      (home-directory ,(user-home-directory user))
      (supplementary-groups '("wheel" "netdev"
                              "audio" "video"))))

  (define-syntax-rule (G_ str) str)

  `(,(vertical-space 1)
    ,(comment (G_ ";; The list of user accounts ('root' is implicit).\n"))
    (users (cons*
            ,@(filter-map (lambda (user)
                            ;; Do not emit a 'user-account' form for "root".
                            (and (not (string=? (user-name user) "root"))
                                 (user->sexp user)))
                          users)
            %base-user-accounts))))
ee3f542a2c9d7 Ricardo Wurmus 2024-02-13gnu: sugar-read-activity: Use webkit with libsoup 3....* gnu/packages/sugar.scm (sugar-read-activity)[propagated-inputs]: Replace webkitgtk-with-libsoup2 with webkitgtk-for-gtk3. Change-Id: I0abf74ebc48f733634679e0700151fadfa7e6dc7 Ricardo Wurmus 2024-02-13gnu: sugar-maze-activity: Update to 32....* gnu/packages/sugar.scm (sugar-maze-activity): Update to 32. Change-Id: Ib153cd1fff1d6894b3cf6f78941fe0a11f1d0626 Ricardo Wurmus 2024-02-13gnu: sugar-jukebox-activity: Update to 36-2.44ad1da....* gnu/packages/sugar.scm (sugar-jukebox-activity): Update to 36-2.44ad1da. Change-Id: I6d639c2fc3909565c8f7c0eedea3a043b8cb285e Ricardo Wurmus 2024-02-13gnu: sugar-browse-activity: Update to 208....* gnu/packages/sugar.scm (sugar-browse-activity): Update to 208. [propagated-inputs]: Replace libsoup-minimal-2 with libsoup-minimal; replace webkitgtk-with-libsoup2 with webkitgtk-for-gtk3. Change-Id: I077e86310e4a8853ba00d2913cf5ae70868bce12 Ricardo Wurmus 2024-02-13gnu: sugar-block-party-activity: Update to 12-1.26a58f1....* gnu/packages/sugar.scm (sugar-block-party-activity): Update to 12-1.26a58f1. Change-Id: I2373b613cb6a31240e5e2d8d0060d038a9557084 Ricardo Wurmus 2024-02-13gnu: sugar: Update to 0.121....* gnu/packages/sugar.scm (sugar): Update to 0.121. [arguments]: Patch LINGUAS file to fix build; remove now obsolete patch to spawn_command_line_sync. [propagated-inputs]: Replace libsoup-minimal-2 with libsoup-minimal; replace webkitgtk-with-libsoup2 with webkitgtk-for-gtk3. Change-Id: I03be3a414515001851125ae92c51269aa441cf1a Ricardo Wurmus 2024-02-13gnu: sugar-toolkit-gtk3: Update to 0.121....* gnu/packages/sugar.scm (sugar-toolkit-gtk3): Update to 0.121. [native-inputs]: Replace autoconf with autoconf-2.71. [propagated-inputs]: Replace webkitgtk-with-libsoup2 with webkitgtk-for-gtk3. Change-Id: Ie1e1b4acb6486c3856143a22cb7aa568b18ed539 Ricardo Wurmus 2024-02-13gnu: sugar-datastore: Update to 0.121....* gnu/packages/sugar.scm (sugar-datastore): Update to 0.121. [native-inputs]: Replace autoconf with autoconf-2.71 Change-Id: Iff5b03b5cf85093f7a1f8ba8a635d6b6551bfdbb Ricardo Wurmus 2024-02-13gnu: sugar-artwork: Update to 0.121....* gnu/packages/sugar.scm (sugar-artwork): Update to 0.121. [native-inputs]: Replace autoconf with autoconf-2.71. Change-Id: Ia281addab6c51cc9886d327d60b9761e5f2ab04e Ricardo Wurmus