3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/nixos/modules/services/networking/tftpd.nix
Bjørn Forsman cd1b09af5d nixos/tftpd: change default dir from /home/tftp to /srv/tftp
/home is for real users. /srv is recommended by FHS (although there is
no consensus for what to name subdirs under /srv).
2016-10-25 17:20:52 +02:00

47 lines
844 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.
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}";
};
};
}