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
|
|
|
|
'';
|
|
|
|
};
|
2024-03-04 00:34:39 +03:00
|
|
|
};
|
|
|
|
}
|