mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-18 03:34:58 +00:00
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}";
|
||
|
};
|
||
|
|
||
|
};
|
||
|
|
||
|
}
|