mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-28 08:33:54 +00:00
6afb255d97
these changes were generated with nixq 0.0.2, by running nixq ">> lib.mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix nixq ">> mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix nixq ">> Inherit >> mdDoc[remove]" --batchmode nixos/**.nix two mentions of the mdDoc function remain in nixos/, both of which are inside of comments. Since lib.mdDoc is already defined as just id, this commit is a no-op as far as Nix (and the built manual) is concerned.
66 lines
1.2 KiB
Nix
66 lines
1.2 KiB
Nix
# NixOS module for atftpd TFTP server
|
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.services.atftpd;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
services.atftpd = {
|
|
|
|
enable = mkOption {
|
|
default = false;
|
|
type = types.bool;
|
|
description = ''
|
|
Whether to enable the atftpd TFTP server. By default, the server
|
|
binds to address 0.0.0.0.
|
|
'';
|
|
};
|
|
|
|
extraOptions = mkOption {
|
|
default = [];
|
|
type = types.listOf types.str;
|
|
example = literalExpression ''
|
|
[ "--bind-address 192.168.9.1"
|
|
"--verbose=7"
|
|
]
|
|
'';
|
|
description = ''
|
|
Extra command line arguments to pass to atftp.
|
|
'';
|
|
};
|
|
|
|
root = mkOption {
|
|
default = "/srv/tftp";
|
|
type = types.path;
|
|
description = ''
|
|
Document root directory for the atftpd.
|
|
'';
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
systemd.services.atftpd = {
|
|
description = "TFTP Server";
|
|
after = [ "network.target" ];
|
|
wantedBy = [ "multi-user.target" ];
|
|
# runs as nobody
|
|
serviceConfig.ExecStart = "${pkgs.atftp}/sbin/atftpd --daemon --no-fork ${lib.concatStringsSep " " cfg.extraOptions} ${cfg.root}";
|
|
};
|
|
|
|
};
|
|
|
|
}
|