aboutsummaryrefslogtreecommitdiff
path: root/gnu/installer/user.scm
blob: 2866e4520f49685d4e351f91ee1b9e6988c4d55a (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
;;; 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))))
27430a4a979ea70cd0c1534acd580 Sharlatan Hellseher 2024-07-15gnu: go-github-com-muesli-reflow-wordwrap: Consolidate other packages....Rename go-github-com-muesli-reflow-wordwrap to go-github-com-muesli-reflow which would contain all submodules to ease maintenance. * gnu/packages/golang.scm (go-github-com-muesli-reflow): Refresh package style. [arguments]: <#unpack-path>: Remove it. <#:import-path>: Adjust it to reflect the go.mod. <#:phases>: Use custom 'check phase. [description]: Place on a new line. * gnu/packages/golang.scm (go-github-com-muesli-reflow-ansi, go-github-com-muesli-reflow-indent, go-github-com-muesli-reflow-padding, go-github-com-muesli-reflow-truncate): Delete variables. * gnu/packages/configuration-management.scm (chezmoi): Adjust inputs. [native-inputs]: Remove go-github-com-muesli-reflow-ansi, go-github-com-muesli-reflow-indent, go-github-com-muesli-reflow-padding, and go-github-com-muesli-reflow. * gnu/packages/golang.scm (go-github-com-charmbracelet-glamour): Likewise. [native-inputs]: Remove go-github-com-muesli-reflow-ansi, go-github-com-muesli-reflow-wordwrap, go-github-com-muesli-reflow-indent, and go-github-com-muesli-reflow. * gnu/packages/golang.scm (go-github-com-charmbracelet-bubbletea): Likewise. [propagated-inputs]: Remove go-github-com-muesli-reflow-indent, go-github-com-muesli-reflow-ansi, and and go-github-com-muesli-reflow. Change-Id: I2e0f2abad36bd6a9ca98e2505fcd90273294213b Sharlatan Hellseher 2024-07-15gnu: packages/golang: Set default go version to 1.21....Golang versions 1.17 (02 Aug 2022), 1.18 (01 Feb 2023), 1.19 (06 Sep 2023) and 1.20 (06 Feb 2024) are EOL <https://endoflife.date/go>. These changes set preferable default version to the minimal currently maintained one e.g. 1.21 * gnu/packages/golang.scm (go): Set default to go-1.21, add annotation for the future maintenance. Remove field <#:go> setting Golang version to go-1.18, go-1.19, 1.20 and 1.21: * gnu/packages/admin.scm * gnu/packages/configuration-management.scm * gnu/packages/databases.scm * gnu/packages/disk.scm * gnu/packages/education.scm * gnu/packages/file-systems.scm * gnu/packages/finance.scm * gnu/packages/golang-check.scm * gnu/packages/golang-crypto.scm * gnu/packages/golang-web.scm * gnu/packages/golang-xyz.scm * gnu/packages/golang.scm * gnu/packages/high-availability.scm * gnu/packages/ipfs.scm * gnu/packages/irc.scm * gnu/packages/messaging.scm * gnu/packages/networking.scm * gnu/packages/syncthing.scm * gnu/packages/textutils.scm * gnu/packages/time.scm * gnu/packages/version-control.scm * gnu/packages/video.scm Change-Id: Ieba6a5d7a18423f838d14c02ad55a2ba9c8559eb Sharlatan Hellseher 2024-06-29gnu: Remove go-etcd-io-bbolt....go-go-etcd-io-bbolt and go-etcd-io-bbolt are the same version and source packages. This change removes go-etcd-io-bbolt and keeps go-go-etcd-io-bbolt. * gnu/packages/configuration-management.scm (chezmoi) [native-inputs]: Add go-go-etcd-io-bbolt. Remove go-etcd-io-bbolt. * gnu/packages/golang.scm (go-etcd-io-bbolt): Remove variable. Co-authored-by: Sharlatan Hellseher <sharlatanus@gmail.com> Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com> Change-Id: I482f22b77b61d4761390742db2ced570cd4de3bd Troy Figiel 2024-06-28gnu: go-github-com-masterminds-sprig: Rename variable....* gnu/packages/golang-xyz.scm (go-github-com-masterminds-sprig): Rename to go-github-com-masterminds-sprig-v3. [arguments]: <#:import-path>: Reflect import path as seen in go.mod. * gnu/packages/configuration-management.scm (chezmoi) [native-inputs]: Replace go-github-com-masterminds-sprig with go-github-com-masterminds-sprig-v3. Change-Id: I2d171ff9f719e6664266723ae0483f73cef343c5 Sharlatan Hellseher 2024-06-28gnu: chezmoi: Refresh package style....* gnu/packages/configuration-management.scm (chezmoi): Use G-expressions and list style, re-indent. [arguments]: <#:go>: Set to go-1.21. Change-Id: I5a7a4deffcd8b9102614b3f628a7ddd33ee82633 Sharlatan Hellseher 2024-06-28gnu: chezmoi: Remove propagated inputs....* gnu/packages/configuration-management.scm (chezmoi): Remove propagated inputs. [native-inputs]: Remove go-github-com-google-uuid, go-github-com-huandu-xstrings, go-github-com-imdario-mergo, go-github-com-masterminds-goutils, go-github-com-masterminds-semver, go-github-com-mitchellh-copystructure, go-github-com-mitchellh-reflectwalk, and go-golang-org-x-crypto. Change-Id: Ifeb42652b07827e76c57a0165683200af312faf3 Sharlatan Hellseher 2024-02-19gnu: chezmoi: Update to 1.8.10....* gnu/packages/configuration-management.scm (chezmoi): Update to 1.8.10. [arguments] <#:phases>: Add 'remove-failing-test-scripts phase, deleting testdata scripts requiring additional programs. [native-inputs]: Remove go-github-com-bmatcuk-doublestar and go-github-com-google-go-github; add go-github-com-bmatcuk-doublestar-v2, go-github-com-google-go-github-v33, and go-golang-org-x-term. Change-Id: Ia0b9b7e4dd00e99bc8150816c46b456cc272b25c Sharlatan Hellseher 2024-02-19gnu: chezmoi: Sort inputs alphabetically....* gnu/packages/configuration-management.scm (chezmoi) [native-inputs]: Sort alphabetically to ease maintenance. Change-Id: I22b82ce7163db696c4d9e8484fbe72da086a4139 Sharlatan Hellseher 2024-02-19gnu: go-github-com-alecthomas-chroma: Move to golang-xyz....* gnu/packages/golang.scm (go-github-com-alecthomas-chroma): Move from here ... * gnu/packages/golang-xyz.scm: ... to here. * gnu/packages/configuration-management.scm: Add (gnu packages golang-xyz) module. Change-Id: I0f5f7068f530b282f3636678e9edc4fad6c8c94a Sharlatan Hellseher 2024-02-13gnu: go-golang-org-x-net: Move to golang-build....* gnu/packages/golang.scm (go-golang-org-x-net, go-golang-org-x-net-0.17, go-golang-org-x-net-html): Move from here ... * gnu/packages/golang-build.scm: ... to here. * gnu/packages/configuration-management.scm: Add (gnu packages golang-build) module. * gnu/packages/education.scm: As above ... * gnu/packages/file-systems.scm: As above ... * gnu/packages/golang-check.scm: As above ... * gnu/packages/golang-crypto.scm: As above ... * gnu/packages/golang-web.scm: As above ... * gnu/packages/golang-xyz.scm: As above ... * gnu/packages/golang.scm: As above ... * gnu/packages/ipfs.scm: As above ... * gnu/packages/messaging.scm: As above ... * gnu/packages/networking.scm: As above ... * gnu/packages/uucp.scm: As above ... * gnu/packages/version-control.scm: As above ... Change-Id: If009e62555ada293f17cf0f42fde82c21ef4615e Sharlatan Hellseher 2024-01-03gnu: go-github-com-gorilla-css: Move to (gnu packages golang-web)....* gnu/packages/golang.scm (go-github-com-gorilla-css): Move from here... * gnu/packages/golang-web.scm: ...to here. * gnu/packages/configuration-management.sc: Add (gnu packages golang-web) module. * gnu/packages/golang.scm: As above... Change-Id: I6e387966d05c40321b9116b93d76fce68aad8c7f Sharlatan Hellseher