2014-04-14 16:26:48 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
2009-08-21 15:05:45 +02:00
|
|
|
|
2014-04-14 16:26:48 +02:00
|
|
|
with lib;
|
2009-08-21 15:05:45 +02:00
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
###### interface
|
2011-09-14 20:20:50 +02:00
|
|
|
|
2009-08-21 15:05:45 +02:00
|
|
|
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}";
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|