1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-11 15:15:36 +00:00
nixpkgs/nixos/modules/services/networking/atftpd.nix

52 lines
896 B
Nix
Raw Normal View History

2014-06-12 06:36:16 +01:00
# NixOS module for atftpd TFTP server
2014-09-29 14:45:59 +01:00
{ config, pkgs, lib, ... }:
2014-06-12 06:36:16 +01:00
2014-09-29 14:45:59 +01:00
with lib;
2014-06-12 06:36:16 +01:00
let
cfg = config.services.atftpd;
in
{
options = {
services.atftpd = {
enable = mkOption {
default = false;
type = types.uniq types.bool;
description = ''
Whenever to enable the atftpd TFTP server.
'';
};
root = mkOption {
default = "/var/empty";
type = types.uniq types.string;
description = ''
Document root directory for the atftpd.
'';
};
};
};
config = mkIf cfg.enable {
systemd.services.atftpd = {
description = "atftpd TFTP server";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
# runs as nobody
serviceConfig.ExecStart = "${pkgs.atftp}/sbin/atftpd --daemon --no-fork --bind-address 0.0.0.0 ${cfg.root}";
};
};
}