summaryrefslogtreecommitdiff
path: root/modules/common/wget.nix
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2023-02-19 17:50:35 +0300
committerAzat Bahawi <azat@bahawi.net>2023-02-19 17:50:35 +0300
commit91fb4f28ef5d87e8bcf7749928d30ba4a9cbbd34 (patch)
treee07291fcb1cf62a561ffe58d1fd8e2968ff6fcb3 /modules/common/wget.nix
parentf1e8dc736a904703eaa97ccf3d5cde3f69101c38 (diff)
2023-02-19
Diffstat (limited to 'modules/common/wget.nix')
-rw-r--r--modules/common/wget.nix35
1 files changed, 35 insertions, 0 deletions
diff --git a/modules/common/wget.nix b/modules/common/wget.nix
new file mode 100644
index 0000000..9a16fcc
--- /dev/null
+++ b/modules/common/wget.nix
@@ -0,0 +1,35 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
+with lib; let
+ cfg = config.nixfiles.modules.wget;
+in {
+ options.nixfiles.modules.wget.enable = mkEnableOption "wget";
+
+ config = mkIf cfg.enable {
+ hm = {
+ programs.bash.shellAliases.wget = "${pkgs.wget}/bin/wget --hsts-file=/tmp/wget-hsts";
+
+ home.sessionVariables.WGETRC = pkgs.writeText "wgetrc" ''
+ adjust_extension = on
+ dirstruct = off
+ follow_ftp = on
+ passive_ftp = off
+ progress = bar
+ quota = inf
+ reclevel = 5
+ recursive = off
+ robots = off
+ timestamping = off
+ tries = 5
+ wait = 0
+ waitretry = 10
+ '';
+ };
+
+ environment.systemPackages = with pkgs; [wget];
+ };
+}