;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès ;;; ;;; 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 . (define-module (gnu system shadow) #:use-module (guix records) #:use-module (guix gexp) #:use-module (guix store) #:use-module (guix sets) #:use-module (guix ui) #:use-module (gnu services) #:use-module ((gnu system file-systems)
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2019-01-23 17:02:41 +0100
committerRicardo Wurmus <rekado@elephly.net>2019-01-23 18:13:29 +0100
commitacb75c0328eccf30a3683a76d2bfed7ee5cfa9ed (patch)
treeb69e241e08abccbd4feb391c2523fd21a7441ed1 /gnu/packages/aidc.scm
parentd1c4f329d102ada27586a3430257d5c1e8d93b6b (diff)
downloadguix-acb75c0328eccf30a3683a76d2bfed7ee5cfa9ed.tar.gz
guix-acb75c0328eccf30a3683a76d2bfed7ee5cfa9ed.zip
gnu: python-pycparser: Use INVOKE.
* gnu/packages/python-xyz.scm (python-pycparser)[arguments]: Unconditionally return #T from "check" phase.
Diffstat (limited to 'gnu/packages/aidc.scm')
0 files changed, 0 insertions, 0 deletions
(xdefaults (plain-file "Xdefaults" "\ XTerm*utf8: always XTerm*metaSendsEscape: true\n")) (gdbinit (plain-file "gdbinit" "\ # Tell GDB where to look for separate debugging files. set debug-file-directory ~/.guix-profile/lib/debug\n"))) `((".bash_profile" ,profile) (".bashrc" ,bashrc) (".zlogin" ,zlogin) (".Xdefaults" ,xdefaults) (".guile-wm" ,guile-wm) (".gdbinit" ,gdbinit)))) (define (skeleton-directory skeletons) "Return a directory containing SKELETONS, a list of name/derivation tuples." (computed-file "skel" #~(begin (use-modules (ice-9 match)) (mkdir #$output) (chdir #$output) ;; Note: copy the skeletons instead of symlinking ;; them like 'file-union' does, because 'useradd' ;; would just copy the symlinks as is. (for-each (match-lambda ((target source) (copy-file source target))) '#$skeletons) #t))) (define (assert-valid-users/groups users groups) "Raise an error if USERS refer to groups not listed in GROUPS." (let ((groups (list->set (map user-group-name groups)))) (define (validate-supplementary-group user group) (unless (set-contains? groups group) (raise (condition (&message (message (format #f (_ "supplementary group '~a' \ of user '~a' is undeclared") group (user-account-name user)))))))) (for-each (lambda (user) (unless (set-contains? groups (user-account-group user)) (raise (condition (&message (message (format #f (_ "primary group '~a' \ of user '~a' is undeclared") (user-account-group user) (user-account-name user))))))) (for-each (cut validate-supplementary-group user <>) (user-account-supplementary-groups user))) users))) ;;; ;;; Service. ;;; (define (user-group->gexp group) "Turn GROUP, a object, into a list-valued gexp suitable for 'active-groups'." #~(list #$(user-group-name group) #$(user-group-password group) #$(user-group-id group) #$(user-group-system? group))) (define (user-account->gexp account) "Turn ACCOUNT, a object, into a list-valued gexp suitable for 'activate-users'." #~`(#$(user-account-name account) #$(user-account-uid account) #$(user-account-group account) #$(user-account-supplementary-groups account) #$(user-account-comment account) #$(user-account-home-directory account) ,#$(user-account-shell account) ; this one is a gexp #$(user-account-password account) #$(user-account-system? account))) (define (account-activation accounts+groups) "Return a gexp that activates ACCOUNTS+GROUPS, a list of and objects. Raise an error if a user account refers to a undefined group." (define accounts (filter user-account? accounts+groups)) (define user-specs (map user-account->gexp accounts)) (define groups (filter user-group? accounts+groups)) (define group-specs (map user-group->gexp groups)) (assert-valid-users/groups accounts groups) ;; Add users and user groups. #~(begin (setenv "PATH" (string-append #$(@ (gnu packages admin) shadow) "/sbin")) (activate-users+groups (list #$@user-specs) (list #$@group-specs)))) (define (shells-file shells) "Return a file-like object that builds a shell list for use as /etc/shells based on SHELLS. /etc/shells is used by xterm, polkit, and other programs." (computed-file "shells" #~(begin (use-modules (srfi srfi-1)) (define shells (delete-duplicates (list #$@shells))) (call-with-output-file #$output (lambda (port) (display "\ /bin/sh /run/current-system/profile/bin/sh /run/current-system/profile/bin/bash\n" port) (for-each (lambda (shell) (display shell port) (newline port)) shells)))))) (define (etc-files arguments) "Filter out among ARGUMENTS things corresponding to skeletons, and return the /etc/skel directory for those." (let ((skels (filter pair? arguments)) (users (filter user-account? arguments))) `(("skel" ,(skeleton-directory skels)) ("shells" ,(shells-file (map user-account-shell users)))))) (define account-service-type (service-type (name 'account) ;; Concatenate , , and skeleton ;; lists. (compose concatenate) (extend append) (extensions (list (service-extension activation-service-type account-activation) (service-extension etc-service-type etc-files))))) (define (account-service accounts+groups skeletons) "Return a that takes care of user accounts and user groups, with ACCOUNTS+GROUPS as its initial list of accounts and groups." (service account-service-type (append skeletons accounts+groups))) ;;; shadow.scm ends here