mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-15 14:26:33 +01:00
8447e036fd
svn path=/nixos/trunk/; revision=8380
31 lines
476 B
Nix
31 lines
476 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
|
|
|
|
mkdir -m 755 -p ${stateDir}
|
|
|
|
touch ${stateDir}/dhcpd.leases
|
|
|
|
exec ${dhcp}/sbin/dhcpd -f -cf ${configFile} \\
|
|
-lf ${stateDir}/dhcpd.leases \\
|
|
${toString interfaces}
|
|
|
|
end script
|
|
";
|
|
|
|
}
|