summaryrefslogtreecommitdiff
path: root/customized/factorio-fetch.nix
blob: 04b31ac10d35de8644ebdb4e04140e8ccebfb222 (plain)
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
{ stdenv, curl, xidel, cacert
# Begin download parameters
, username ? ""
, password ? ""
}:

{
  # URL to fetch.
  url ? ""

  # Login URL.
, loginUrl ? "https://www.factorio.com/login"

  # SHA256 of the fetched URL.
, sha256 ? ""
}:

stdenv.mkDerivation {
  name = "factorio.tar.gz";

  buildInputs = [ curl xidel ];

  inherit url loginUrl username password cacert;

  builder = ./fetch.sh;

  outputHashAlgo = "sha256";
  outputHash = sha256;
  outputHashMode = "flat";

  # There's no point in downloading remotely, we'd just slow things down.
  preferLocalBuild = true;
}