Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
67 lines
1.3 KiB
Nix
67 lines
1.3 KiB
Nix
# NixOS module for atftpd TFTP server
|
|
{
|
|
config,
|
|
pkgs,
|
|
lib,
|
|
...
|
|
}:
|
|
let
|
|
|
|
cfg = config.services.atftpd;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
services.atftpd = {
|
|
|
|
enable = lib.mkOption {
|
|
default = false;
|
|
type = lib.types.bool;
|
|
description = ''
|
|
Whether to enable the atftpd TFTP server. By default, the server
|
|
binds to address 0.0.0.0.
|
|
'';
|
|
};
|
|
|
|
extraOptions = lib.mkOption {
|
|
default = [ ];
|
|
type = lib.types.listOf lib.types.str;
|
|
example = lib.literalExpression ''
|
|
[ "--bind-address 192.168.9.1"
|
|
"--verbose=7"
|
|
]
|
|
'';
|
|
description = ''
|
|
Extra command line arguments to pass to atftp.
|
|
'';
|
|
};
|
|
|
|
root = lib.mkOption {
|
|
default = "/srv/tftp";
|
|
type = lib.types.path;
|
|
description = ''
|
|
Document root directory for the atftpd.
|
|
'';
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
config = lib.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}";
|
|
};
|
|
|
|
};
|
|
|
|
}
|