mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 07:00:43 +00:00
ee52a61e3a
The first description is a (incorrect) copy/paste from the 'vsftpd' module, and the second option lacks a 'dot' at the end.
46 lines
792 B
Nix
46 lines
792 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
{
|
|
|
|
###### interface
|
|
|
|
options = {
|
|
|
|
services.tftpd.enable = mkOption {
|
|
type = types.bool;
|
|
default = false;
|
|
description = ''
|
|
Whether to enable tftpd, a Trivial File Transfer Protocol server.
|
|
'';
|
|
};
|
|
|
|
services.tftpd.path = mkOption {
|
|
type = types.path;
|
|
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}";
|
|
};
|
|
|
|
};
|
|
|
|
}
|