nixpkgs/nixos/modules/services/networking/tftpd.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

39 lines
805 B
Nix
Raw Permalink Normal View History

{
config,
lib,
pkgs,
...
}:
{
options = {
2024-11-04 15:49:59 +01:00
services.tftpd.enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Whether to enable tftpd, a Trivial File Transfer Protocol server.
The server will be run as an xinetd service.
'';
};
2024-11-04 15:49:59 +01:00
services.tftpd.path = lib.mkOption {
type = lib.types.path;
default = "/srv/tftp";
description = ''
Where the tftp server files are stored.
'';
};
};
2024-11-04 15:49:59 +01:00
config = lib.mkIf config.services.tftpd.enable {
services.xinetd.enable = true;
services.xinetd.services = lib.singleton {
name = "tftp";
protocol = "udp";
server = "${pkgs.netkittftp}/sbin/in.tftpd";
serverArgs = "${config.services.tftpd.path}";
};
};
}