2024-10-30 20:02:37 -07:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
config,
|
2024-11-16 21:13:07 -08:00
|
|
|
namespace,
|
|
|
|
pkgs,
|
2024-10-30 20:02:37 -07:00
|
|
|
...
|
2024-11-02 15:35:48 -07:00
|
|
|
}:
|
2024-11-16 21:13:07 -08:00
|
|
|
let
|
|
|
|
inherit (lib) mkIf;
|
|
|
|
inherit (lib.${namespace}) mkEnableModule;
|
|
|
|
|
|
|
|
cfg = config.${namespace}.programs.wget;
|
|
|
|
in
|
2024-11-02 15:35:48 -07:00
|
|
|
{
|
2024-11-16 21:13:07 -08:00
|
|
|
options = mkEnableModule "programs.wget";
|
2024-10-26 20:17:00 -07:00
|
|
|
|
2024-11-16 21:13:07 -08:00
|
|
|
config = mkIf cfg.enable {
|
|
|
|
home.packages = with pkgs; [
|
|
|
|
wget
|
|
|
|
];
|
2024-11-03 10:16:25 -08:00
|
|
|
|
2024-11-16 21:13:07 -08:00
|
|
|
xdg.configFile."wgetrc".text = # wget
|
2024-11-03 10:16:25 -08:00
|
|
|
''
|
|
|
|
# Use the server-provided last modification date, if available.
|
|
|
|
timestamping = on
|
|
|
|
|
|
|
|
# Wait 60 seconds before timing out.
|
|
|
|
timeout = 60
|
|
|
|
|
|
|
|
# Retry a few times when a download fails, but don't overdo it (the default is
|
|
|
|
# 20!).
|
|
|
|
tries = 3
|
|
|
|
|
|
|
|
# Retry even when the connection was refused.
|
|
|
|
retry_connrefused = on
|
|
|
|
|
|
|
|
# Use the last component of a redirection URL for the local file name.
|
|
|
|
trust_server_names = on
|
|
|
|
|
|
|
|
# Disguise as IE 9 on Windows 7.
|
|
|
|
user_agent = Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)
|
|
|
|
'';
|
2024-10-30 20:02:37 -07:00
|
|
|
|
2024-11-16 21:13:07 -08:00
|
|
|
home.sessionVariables = lib.mkIf config.home.preferXdgDirectories {
|
|
|
|
WGETRC = "${config.xdg.configHome}/wgetrc";
|
|
|
|
};
|
2024-10-30 20:02:37 -07:00
|
|
|
};
|
2024-10-26 20:17:00 -07:00
|
|
|
}
|