Commit Graph

26 Commits

Author SHA1 Message Date
Ludovic Courtès bf87f38ace system: Define '%base-user-accounts'.
* gnu/system/shadow.scm (%base-user-accounts): New variable.
* gnu/system.scm (<operating-system>)[users]: Use it as the default value.
* gnu/system/examples/bare-bones.tmpl (users): Use it.
* gnu/system/examples/desktop.tmpl (users): Likewise.
* doc/guix.texi (operating-system Reference, User Accounts): Adjust
  accordingly.
2015-05-25 21:34:23 +02:00
Ludovic Courtès 0c09a306e5 system: Make sure user accounts refer to existing groups.
Fixes <http://bugs.gnu.org/20646>.
Reported by David Thompson <davet@gnu.org>.

* gnu/system/shadow.scm (assert-valid-users/groups): New procedure
* gnu/system.scm (operating-system-activation-script): Use it.
* tests/guix-system.sh (make_user_config): New function.
  Add 3 tests using it.
* po/guix/POTFILES.in: Add gnu/system/shadow.scm.
2015-05-24 18:02:54 +02:00
Ludovic Courtès 2f094a69f0 system: Skeleton '.bashrc' now exports the 'SHELL' variable.
* gnu/system/shadow.scm (default-skeletons)[bashrc]: Export 'SHELL'.
2015-03-16 23:30:59 +01:00
Ludovic Courtès 9a10acc986 system: Adjust '.bashrc' skeleton for non-interactive SSH sessions.
* gnu/system/shadow.scm (default-skeletons)[bashrc]: Source /etc/profile
  when in a non-interactive SSH session.
2015-03-12 19:00:54 +01:00
Ludovic Courtès e87f0591f3 monads: Move '%store-monad' and related procedures where they belong.
This turns (guix monads) into a generic module for monads, and moves the
store monad and related monadic procedures in their corresponding
module.

* guix/monads.scm (store-return, store-bind, %store-monad, store-lift,
  text-file, interned-file, package-file, package->derivation,
  package->cross-derivation, origin->derivation, imported-modules,
  compiled, modules, built-derivations, run-with-store): Move to...
* guix/store.scm (store-return, store-bind, %store-monad, store-lift,
  text-file, interned-file): ... here.
  (%guile-for-build): New variable.
  (run-with-store): Moved from monads.scm.  Remove default value for
  #:guile-for-build.
* guix/packages.scm (default-guile): Export.
  (set-guile-for-build): New procedure.
  (package-file, package->derivation, package->cross-derivation,
  origin->derivation): Moved from monads.scm.
* guix/derivations.scm (%guile-for-build): Remove.
  (imported-modules): Rename to...
  (%imported-modules): ... this.
  (compiled-modules): Rename to...
  (%compiled-modules): ... this.
  (built-derivations, imported-modules, compiled-modules): New
  procedures.
* gnu/services/avahi.scm, gnu/services/base.scm, gnu/services/dbus.scm,
  gnu/services/dmd.scm, gnu/services/networking.scm,
  gnu/services/ssh.scm, gnu/services/xorg.scm, gnu/system/install.scm,
  gnu/system/linux-initrd.scm, gnu/system/shadow.scm, guix/download.scm,
  guix/gexp.scm, guix/git-download.scm, guix/profiles.scm,
  guix/svn-download.scm, tests/monads.scm: Adjust imports accordingly.
* guix/monad-repl.scm (default-guile-derivation): New procedure.
  (store-monad-language, run-in-store): Use it.
* build-aux/hydra/gnu-system.scm (qemu-jobs): Add explicit
  'set-guile-for-build' call.
* guix/scripts/archive.scm (derivation-from-expression): Likewise.
* guix/scripts/build.scm (options/resolve-packages): Likewise.
* guix/scripts/environment.scm (guix-environment): Likewise.
* guix/scripts/system.scm (guix-system): Likewise.
* doc/guix.texi (The Store Monad): Adjust module names accordingly.
2015-01-14 13:34:52 +01:00
宋文武 02f707c590 system: Add skeleton '.zlogin'.
* gnu/system/shadow.scm (default-skeletons): Add .zlogin.
2014-12-09 18:52:11 +08:00
宋文武 4e2a21d3d2 system: Cleanup bash startup files.
* gnu/system.scm (etc-directory) (bashrc): Rename to 'profile'.
* gnu/system/shadow.scm (default-skeletons): Rename '.bashrc' to
  '.bash_profile'. Don't source /etc/profile.
2014-12-09 18:51:01 +08:00
Ludovic Courtès 7f28bf9a43 system: Add udev rule for /dev/kvm.
* gnu/services/base.scm (kvm-udev-rule): New procedure.
  (udev-service): Use it, and add it to RULES.
  (guix-build-accounts): Add "kvm" to the 'supplementary-groups' field.
* gnu/system/shadow.scm (%base-groups): Add "kvm".
2014-09-18 23:23:46 +02:00
Ludovic Courtès e617a86137 system: Add "input" to '%base-groups'.
* gnu/system/shadow.scm (%base-groups): Add "input" group.
2014-09-16 22:43:55 +02:00
Ludovic Courtès c8fa34265d system: Add the 'system?' field for user groups.
Suggested by Mark H. Weaver.

* gnu/system/shadow.scm (<user-group>)[system?]: New field.
  (%base-groups): Introduce 'system-group' macro, and use it.
* gnu/system.scm (user-group->gexp): Pass the 'system?' field.
* guix/build/activation.scm (add-group): Add #:system? and honor it.
  (activate-users+groups): Handle the 'system?' field.
* gnu/system/file-systems.scm (%tty-gid): Choose an ID below 1000.
* doc/guix.texi (User Accounts): Document the 'system?' field.
2014-07-25 00:12:35 +02:00
Ludovic Courtès 7f239fd33f system: Add 'file-system' decl. for /dev/pts, and use the right options.
Fixes <http://bugs.gnu.org/18081>.

* gnu/system/file-systems.scm (%devtmpfs-file-system): Add
  'needed-for-boot?' field.
  (%tty-gid, %pseudo-terminal-file-system): New variables.
  (%base-file-systems): Add %PSEUDO-TERMINAL-FILE-SYSTEM.
* gnu/services/base.scm (udev-service): Remove dependency on
  'file-system-/dev'.
* gnu/system/shadow.scm (%base-groups): Add 'id' field for group 'tty'.
* guix/build/linux-initrd.scm (boot-system): Remove 'mount' call for
  /dev/pts.
* doc/guix.texi (File Systems): Add %pseudo-terminal-file-system.
2014-07-23 02:02:07 +02:00
Ludovic Courtès 715956cc26 system: Add "netdev" group.
* gnu/system/shadow.scm (%base-groups): Add "netdev".
2014-07-11 00:27:27 +02:00
Ludovic Courtès 459dd9eaf2 system: Add a 'system?' field to user accounts.
* gnu/system/shadow.scm (<user-account>)[system?]: New field.
* gnu/system.scm (user-account->gexp): Add it.
* guix/build/activation.scm (add-user): Add #:system? parameter and
  honor it.
  (activate-users+groups): Handle the 'system?' part of user tuples.
  Pass it to 'add-user'.  Don't create PROFILE-DIR when SYSTEM? is
  true.
* gnu/services/dbus.scm (dbus-service): Add 'system?' field for
  "messagebus" account.
* gnu/services/base.scm (guix-build-accounts): Likewise.
* gnu/services/avahi.scm (avahi-service): Likewise.
2014-06-27 19:06:08 +02:00
Ludovic Courtès 773e956d5d system: Augment the default set of groups.
* gnu/system/shadow.scm (%base-groups): New variable.
* gnu/system.scm (<operating-system>)[groups]: Use it as the default.
2014-06-22 22:16:14 +02:00
Ludovic Courtès 72507e23b5 system: Remove useless 'members' field of 'user-group'.
* gnu/system/shadow.scm (<user-group>)[members]: Remove field.
* gnu/system/install.scm (installation-os)[users]: Remove 'members'
  fields.  Use 'supplementary-groups' for 'guest'.
* build-aux/hydra/demo-os.scm (users): Likewise.
* gnu/services/base.scm (guix-service): Remove 'members' field.
2014-06-22 21:48:35 +02:00
Ludovic Courtès 838d9a9ddb system: Move skeleton code to (gnu system shadow).
* gnu/system.scm (default-skeletons, skeleton-directory): Move to...
* gnu/system/shadow.scm: ... here.
2014-05-14 01:02:46 +02:00
Ludovic Courtès ab6a279abb system: Make accounts and groups at activation time.
* gnu/services/base.scm (guix-build-accounts): Remove #:gid parameter;
  add #:group.  Remove 'password' and 'gid' fields in 'user-account'
  form, and add 'group'.
  (guix-service): Remove #:build-user-gid parameter.  Remove 'id' field
  in 'user-group' form.
* gnu/system.scm (etc-directory): Remove #:groups and #:accounts.  No
  longer produce files "passwd", "shadow", and "group".  Adjust caller
  accordingly.
  (%root-account): New variable.
  (operating-system-accounts): Add 'users' variable.  Add %ROOT-ACCOUNT
  only of 'operating-system-users' doesn't already contain a root
  account.
  (user-group->gexp, user-account->gexp): New procedures.
  (operating-system-boot-script): Add calls to 'setenv' and
  'activate-users+groups' in gexp.
* gnu/system/linux.scm (base-pam-services): Add PAM services for
  "user{add,del,mode}" and "group{add,del,mod}".
* gnu/system/shadow.scm (<user-account>)[gid]: Rename to...
  [group]: ... this.
  [supplementary-groups]: New field.
  [uid, password]: Default to #f.
  (<user-group>)[id]: Default to #f.
  (group-file, passwd-file): Remove.
* gnu/system/vm.scm (operating-system-default-contents)[user-directories]:
  Remove.  Add "/home" to the directives.
* guix/build/activation.scm (add-group, add-user,
  activate-users+groups): New procedures.
2014-05-11 22:41:58 +02:00
Ludovic Courtès b5f4e68635 services: Rewrite using gexps.
* gnu/services.scm (<service>)[inputs]: Remove.
* gnu/system.scm (links): Remove.
  (etc-directory): Add PASSWD and SHADOW to #:inputs.
  (operating-system-boot-script): Pass ETC to 'dmd-configuration-file'.
  (operating-system-derivation): Remove EXTRAS from the union.
* gnu/system/linux.scm (pam-service->configuration): Rewrite in terms of
  'gexp->derivation'.  Compute the contents on the build side.  Expect
  'arguments' to contain a list of gexps.
  (pam-services->directory): Rewrite in terms of 'gexp->derivation'.
  (unix-pam-service): Change 'arguments' to a list of one gexp.
* gnu/system/shadow.scm (<user-account>)[inputs]: Remove.
  [shell]: Change default value to a gexp.
  (passwd-file): Rewrite in terms of 'gexp->derivation'.  Compute
  contents on the build side.
* gnu/services/base.scm (host-name-service, mingetty-service,
  nscd-service, syslog-service, guix-service): Change 'start' and 'stop'
  to gexps; remove 'inputs' field.
  (guix-build-accounts): Change 'shell' field to a gexp.
* gnu/services/networking.scm (static-networking-service): Change
  'start' and 'stop' to gexps; remove 'inputs' field.
* gnu/services/xorg.scm (slim-service): Likewise.
* gnu/services/dmd.scm (dmd-configuration-file): Expect ETC to be a
  derivation.  Change 'config' to a gexp.  Use 'gexp->file' instead of
  'text-file'.
* doc/guix.texi (Defining Services): Update nscd example with gexps, and
  without 'inputs'.  Add xref to "G-Expressions".
2014-04-28 23:24:18 +02:00
Ludovic Courtès 9de46ffb1c gnu: Changes references to (gnu packages admin).
* gnu/packages/version-control.scm, gnu/packages/vim.scm,
  gnu/system.scm, gnu/system/dmd.scm, gnu/system/shadow.scm,
  gnu/system/vm.scm: Change references to (gnu packages system) to (gnu
  packages admin).
  This is a followup to commit 4aeea89.
2014-01-13 23:21:47 +01:00
Ludovic Courtès 78ed003811 gnu: Add 'inputs' field to <user-account>; make 'shell' a monadic value.
* gnu/system/shadow.scm (<user-account>)[inputs]: New field.
  (passwd-file): Bind the 'shell' field of each account.
* gnu/system/vm.scm (%demo-operating-system): Remove 'shell' field.
* gnu/system/dmd.scm (guix-build-accounts): Store a monadic value in
  'shell'.  Add 'inputs' field.
* gnu/system.scm (operating-system-derivation): Remove 'shell' field for
  'root' account.  Add all the 'user-account-inputs' to EXTRAS.
2013-12-10 00:24:02 +01:00
Ludovic Courtès 18fb40e414 gnu: dmd: Add 'user-accounts' and 'user-groups' fields to <service>.
* gnu/system/shadow.scm (guix-build-accounts): Move to...
* gnu/system/dmd.scm (guix-build-accounts): ... here.
  (<service>)[user-accounts, user-groups]: New fields.
  (guix-service): New #:build-user-id and #:build-accounts parameters.
  Use 'guix-build-accounts' and set the 'user-accounts' and
  'user-groups' fields accordingly.
* gnu/system/vm.scm (system-qemu-image): Remove use of
  'guix-build-accounts'.  Augment ACCOUNTS and GROUPS from what SERVICES
  demand.
2013-12-07 15:01:40 +01:00
Ludovic Courtès d9f0a23704 gnu: vm: Rewrite helper functions as monadic functions.
* gnu/system/dmd.scm (host-name-service, nscd-service, mingetty-service,
  syslog-service, guix-service, static-networking-service): Rewrite as
  monadic functions.
  (dmd-configuration-file): Use 'text-file' instead of
  'add-text-to-store'.
* gnu/system/grub.scm (grub-configuration-file): Rewrite as a monadic
  function.
* gnu/system/linux.scm (pam-services->directory): Likewise.
* gnu/system/shadow.scm (group-file, passwd-file, guix-build-accounts):
  Likewise.
* gnu/system/vm.scm (expression->derivation-in-linux-vm, qemu-image,
  union, system-qemu-image): Likewise.
2013-10-03 23:12:20 +02:00
Ludovic Courtès d0c66871b1 gnu: vm: Add build users.
* gnu/system/shadow.scm (guix-build-accounts): New procedure.
* gnu/system/vm.scm (system-qemu-image): Use it.  Add the "guixbuild"
  group.
* gnu/system/dmd.scm (guix-service): Add 'builder-group' parameter.
  Pass 'guix-daemon' the '--build-users-group' option.
2013-09-27 00:46:17 +02:00
Ludovic Courtès 16a0e9dc34 gnu: shadow: Add record type for user groups.
* gnu/system/shadow.scm (<user-group>): New record type.
  (group-file): New procedure.
* gnu/system/vm.scm (system-qemu-image): Use it.
2013-09-27 00:46:17 +02:00
Ludovic Courtès bacadb026c gnu: shadow: Add record type for user accounts.
* gnu/system/shadow.scm (<user-account>): New record type.
  (passwd-file): Use it.
* gnu/system/vm.scm (system-qemu-image): Adjust accordingly.
2013-09-27 00:46:17 +02:00
Ludovic Courtès 0ded70f37d 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.
2013-09-11 22:36:50 +02:00