nix/module/Ftpd.nix

32 lines
717 B
Nix
Raw Normal View History

2024-06-25 04:04:39 +03:00
{ pkgs, lib, config, ... }: with lib; let
cfg = config.module.ftpd;
in {
options = {
module.ftpd = {
enable = mkEnableOption "Enable FTP server";
storage = mkOption {
default = null;
type = types.str;
};
};
};
config = mkIf cfg.enable {
services.vsftpd = {
enable = true;
anonymousUser = true;
anonymousUserNoPassword = true;
anonymousUploadEnable = true;
anonymousMkdirEnable = true;
anonymousUmask = "000";
anonymousUserHome = cfg.storage;
allowWriteableChroot = true;
writeEnable = true;
localUsers = false;
extraConfig = ''
anon_other_write_enable=YES
'';
};
};
}