forked from mirrors/nixpkgs
8e6ad840f2
separate module, which just declares a configuration value that causes the xinetd module to add it to xinetd.conf. Also Nixified the service declarations to abstract over the inetd implementation. * Renamed the services.xinetd.tftpd options to services.tftpd. The fact that the tftpd module uses xinetd is an implementation detail. * xinetd: use -dontfork to let Upstart monitor it, and use -syslog to get error messages at startup. svn path=/nixos/trunk/; revision=16803
44 lines
719 B
Nix
44 lines
719 B
Nix
{ config, pkgs, ... }:
|
|
|
|
with pkgs.lib;
|
|
|
|
{
|
|
|
|
###### interface
|
|
|
|
options = {
|
|
|
|
services.tftpd.enable = mkOption {
|
|
default = false;
|
|
description = ''
|
|
Whether to enable the anonymous FTP user.
|
|
'';
|
|
};
|
|
|
|
services.tftpd.path = mkOption {
|
|
default = "/home/tftp";
|
|
description = ''
|
|
Where the tftp server files are stored
|
|
'';
|
|
};
|
|
|
|
};
|
|
|
|
|
|
###### implementation
|
|
|
|
config = mkIf config.services.tftpd.enable {
|
|
|
|
services.xinetd.enable = true;
|
|
|
|
services.xinetd.services = singleton
|
|
{ name = "tftp";
|
|
protocol = "udp";
|
|
server = "${pkgs.netkittftp}/sbin/in.tftpd";
|
|
serverArgs = "${config.services.tftpd.path}";
|
|
};
|
|
|
|
};
|
|
|
|
}
|