{ config, lib, pkgs, ... }: with lib; let cfg = config.nixfiles.modules.curl; in { options.nixfiles.modules.curl.enable = mkEnableOption "cURL"; config = mkIf cfg.enable { hm.xdg.configFile.".curlrc".text = '' connect-timeout = 60 progress-bar remote-time show-error ''; environment.systemPackages = with pkgs; [ curlHTTP3 (writeShellScriptBin "0x0" '' url="https://0x0.st" form="file=@" if [ -t 0 ] && [ -n "$1" ]; then form="$form$1" else form="$form-" fi ${getExe curl} --form "$form" "$url" '') ]; }; }