nixpkgs/upstart-jobs/dhcpd.nix
Eelco Dolstra 4f3b2290b2 * FHS compliance: put persistent state in /var/lib, not /var/state.
svn path=/nixos/trunk/; revision=8377
2007-03-20 11:04:45 +00:00

26 lines
405 B
Nix

{dhcp, configFile, interfaces}:
let
stateDir = "/var/lib/dhcp"; # Don't use /var/state/dhcp; not FHS-compliant.
in
{
name = "dhcpd";
job = "
description \"DHCP server\"
start on network-interfaces/started
stop on network-interfaces/stop
script
exec ${dhcp}/sbin/dhcpd -f -cf ${configFile} \\
-lf ${stateDir}/dhcpd.leases \\
${toString interfaces}
end script
";
}