about summary refs log tree commit diff
path: root/modules/common/wget.nix
blob: 9a16fcc1a608428a5b236cc23bb3ad820f2a1f26 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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];
  };
}

Consider giving Nix/NixOS a try! <3