nixpkgs/upstart-jobs/make-job.nix
Eelco Dolstra 29c5178bdf * Declarative specification of user accounts. Jobs can now specify a
list of user accounts that the job needs to run.  For instance, the
  SSH daemon job says:

    { name = "sshd";
      uid = (import ../system/ids.nix).uids.sshd;
      description = "SSH privilege separation user";
      home = "/var/empty";
    }

  The activation script creates the system users/groups and updates
  them as well.  So a change in the Nix expression can be realised in
  /etc/{group,passwd} by running nixos-rebuild.

svn path=/nixos/trunk/; revision=8846
2007-06-08 15:41:12 +00:00

26 lines
602 B
Nix

{runCommand}: job:
(
if job ? jobDrv then
job.jobDrv
else
(
runCommand job.name {inherit (job) job;}
"ensureDir $out/etc/event.d; echo \"$job\" > $out/etc/event.d/$name"
)
)
//
{
# Allow jobs to declare extra packages that should be added to the
# system path.
extraPath = if job ? extraPath then job.extraPath else [];
# Allow jobs to declare extra files that should be added to /etc.
extraEtc = if job ? extraEtc then job.extraEtc else [];
# Allow jobs to declare user accounts that should be created.
users = if job ? users then job.users else [];
}