1 # NixOS module for atftpd TFTP server
10 cfg = config.services.atftpd;
20 enable = lib.mkOption {
22 type = lib.types.bool;
24 Whether to enable the atftpd TFTP server. By default, the server
25 binds to address 0.0.0.0.
29 extraOptions = lib.mkOption {
31 type = lib.types.listOf lib.types.str;
32 example = lib.literalExpression ''
33 [ "--bind-address 192.168.9.1"
38 Extra command line arguments to pass to atftp.
43 default = "/srv/tftp";
44 type = lib.types.path;
46 Document root directory for the atftpd.
54 config = lib.mkIf cfg.enable {
56 systemd.services.atftpd = {
57 description = "TFTP Server";
58 after = [ "network.target" ];
59 wantedBy = [ "multi-user.target" ];
61 serviceConfig.ExecStart = "${pkgs.atftp}/sbin/atftpd --daemon --no-fork ${lib.concatStringsSep " " cfg.extraOptions} ${cfg.root}";