<commit_before>{ 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.
        The server will be run as an xinetd service.
      '';
    };

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

  };

}
<commit_msg>nixos/tftpd: change default dir from /home/tftp to /srv/tftp<commit_after>{ 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.
        The server will be run as an xinetd service.
      '';
    };

    services.tftpd.path = mkOption {
      type = types.path;
      default = "/srv/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}";
      };

  };

}

{'fraction_non_alphanumeric': 0.13631284916201117, 'fraction_numerical': 0.0, 'mean_word_length': 2.0615384615384613, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6071154', 'n_tokens_mistral': 599, 'n_tokens_neox': 565, 'n_words': 135}