mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-16 18:03:22 +00:00
c45cf3a28e
jobs, e.g. (from the nscd job) { name = "nscd"; description = "Name Service Cache Daemon"; startOn = "startup"; stopOn = "shutdown"; environment = { LD_LIBRARY_PATH = nssModulesPath; }; preStart = '' mkdir -m 0755 -p /var/run/nscd mkdir -m 0755 -p /var/db/nscd ''; exec = "${pkgs.glibc}/sbin/nscd -f ${./nscd.conf} -d 2> /dev/null"; }; The Upstart job is generated from this. The main goal is to provide some abstraction from the Upstart syntax. For instance, this should make it easier to upgrade to newer versions of Upstart, to switch to an entirely different process management system (e.g. initng or launchd), or to test a job independantly from Upstart. (However the startOn and stopOn attributes are tied to Upstart's event model.) svn path=/nixos/branches/modular-nixos/; revision=16376
41 lines
744 B
Nix
41 lines
744 B
Nix
{pkgs, config, ...}:
|
|
|
|
let
|
|
|
|
nssModulesPath = config.system.nssModules.path;
|
|
|
|
inherit (pkgs.lib) singleton;
|
|
|
|
in
|
|
|
|
{
|
|
config = {
|
|
|
|
users.extraUsers = singleton
|
|
{ name = "nscd";
|
|
uid = config.ids.uids.nscd;
|
|
description = "Name service cache daemon user";
|
|
};
|
|
|
|
jobs = singleton
|
|
{ name = "nscd";
|
|
|
|
description = "Name Service Cache Daemon";
|
|
|
|
startOn = "startup";
|
|
stopOn = "shutdown";
|
|
|
|
environment = { LD_LIBRARY_PATH = nssModulesPath; };
|
|
|
|
preStart =
|
|
''
|
|
mkdir -m 0755 -p /var/run/nscd
|
|
mkdir -m 0755 -p /var/db/nscd
|
|
'';
|
|
|
|
exec = "${pkgs.glibc}/sbin/nscd -f ${./nscd.conf} -d 2> /dev/null";
|
|
};
|
|
|
|
};
|
|
}
|