* Upstart job for dhcpd.

svn path=/nixos/trunk/; revision=8311
This commit is contained in:
Eelco Dolstra 2007-03-16 16:41:38 +00:00
parent 1ca3258c3f
commit 8452dd3cd0
3 changed files with 51 additions and 0 deletions

View file

@ -413,6 +413,32 @@
*/
{
name = ["services" "dhcpd" "enable"];
default = false;
description = "
Whether to enable the DHCP server.
";
}
{
name = ["services" "dhcpd" "configFile"];
description = "
The path of the DHCP server configuration file.
";
}
{
name = ["services" "dhcpd" "interfaces"];
default = ["eth0"];
description = "
The interfaces on which the DHCP server should listen.
";
}
{
name = ["services" "sshd" "enable"];
default = false;

View file

@ -103,6 +103,14 @@ import ../upstart-jobs/gather.nix {
interfaces = config.get ["networking" "interfaces"];
})
# DHCP server.
++ optional ["services" "dhcpd" "enable"]
(import ../upstart-jobs/dhcpd.nix {
inherit (pkgs) dhcp;
configFile = config.get ["services" "dhcpd" "configFile"];
interfaces = config.get ["services" "dhcpd" "interfaces"];
})
# SSH daemon.
++ optional ["services" "sshd" "enable"]
(import ../upstart-jobs/sshd.nix {

17
upstart-jobs/dhcpd.nix Normal file
View file

@ -0,0 +1,17 @@
{dhcp, configFile, interfaces}:
{
name = "dhcpd";
job = "
description \"DHCP server\"
start on network-interfaces/started
stop on network-interfaces/stop
script
exec ${dhcp}/sbin/dhcpd -f -cf ${configFile} ${toString interfaces}
end script
";
}