modules/services/networking/dhcpcd.nix: add "extraConfig" option

This option allows administrators to add verbatim text to the generated
config file. I use this feature, for instance, to disable the default
route normally added by dhcpcd for certain interfaces.
apcupsd-service: add services.apcupsd.hooks option

Each attribute in this option should name an apcupsd event and the
string value it contains will be executed in a shell in response to that
event. See "man apccontrol" for the list of events and what they
represent.

Now it is easy to hook into the apcupsd event system:

  services.apcupsd.hooks = {
    onbattery  = ''# shell commands to run when the onbattery event is emitted'';
    doshutdown = ''# shell commands to notify that the computer is shutting down'';
  };
apcupsd-service: create missing /run/apcupsd/ directory

apcupsd complains about this missing directory when it is starting the
shutdown procedure.
apcupsd-service: put UPS in hibernate mode when shutting down

This adds a special systemd service that calls "apcupsd --killpower"
(put UPS in hibernate mode) just before shutting down the system.
Without this command, the UPS will stay on until the battery is
completely empty.
apcupsd-service: workaround for "A stop job is running for UPS daemon"

When apcupsd has initiated a shutdown, systemd always ends up waiting
for it to stop ("A stop job is running for UPS daemon"). This is weird,
because in the journal one can clearly see that apcupsd has received the
SIGTERM signal and has already quit (or so it seems). This reduces the
wait time from 90 seconds (default) to just 5. Then systemd kills it
with SIGKILL.
apcupsd-service: "UPS daemon" => "APC UPS daemon" description update

Sometimes systemd only prints the service description. Then it is nice
to know which UPS daemon we're dealing with.
Ensure /var/log/journal permission bits are set

Ensure permission bits are (re)set on each system activation with
explicit chmod call.

mkdir -m MODE PATH will only set the permission bits if PATH is
*created*, which means users that have old NixOS versions will continue
to have the old 700 permissions on /var/log/journal until they chmod
manually. With this commit the permissions will be set to 755 on system
activation.
Revert "Allow specifying packages whose closures should be in the chroot"

This reverts commit be3d498b1891339ffceb3f54f749d3d5fa343429.
Revert "Only include /bin/sh (not all of /bin) in the chroot"

This reverts commit 883d310bac6cc6b7a136786688b6b55079558cb7.
New kernel iso/system_tarball now use 3.10 in stead of 3.7, which had been removed.
pulseaudio service: Use the configured pulseaudio package instead of the default.
x11 session: Don't start pulseaudio if it already is running system-wide
Generate /etc/passwd and /etc/group at build time

This is a rather large commit that switches user/group creation from
using useradd to just generating the contents of /etc/passwd and /etc/group,
and then on activation merging the generated files with the files that exist in
the system. This makes the user activation process much cleaner, in my opinion.

The users.extraUsers.<user>.uid and users.extraGroups.<group>.gid must all be
properly defined (if <user>.createUser is true, which is by default). My pull
request adds a lot of uids/gids to config.ids to solve this problem for
existing nixos services, but there might be configurations that break because
this change. However, this will be discovered during the build.

The commit removes the options <user>.isSystemUser and <user>.isAlias since
they don't make sense when generating /etc/passwd. It adds <group>.members as a
complement to <user>.extraGroups and <user>.passwordFile for setting a user's
password from an encrypted (shadow-style) file. It also adds users.mutableUsers
which is false by default. If set to true, the generated passwd and group
files will not be merged with the system files on activation. Instead they will
simply replace the system files.

The merging of the files is simplistic. It just looks at the user/group names.
If a user/group exists both on the system and in the generated files, the
system entry will be kept un-changed and the generated entries will be ignored.
The merging itself is performed with the help of vipw/vigr to properly lock
the account files during edit.

I have tested this on a couple of different systems and it seems to work fine
so far. If you think this is a good idea, please test it. This way of adding
local users has been discussed in issue #103 (and this commit solves that
issue).