summary refs log blame commit diff
path: root/nixos/modules/services/networking/tftpd.nix
blob: 37935496c59766a9e17e07dc6fa8522370d40861 (plain) (tree)
1
2
3
4
5
6
7
8






                      
 


































                                                     
{ 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}";
      };

  };

}