2016-08-15 00:47:00 +02:00
|
|
|
{ stdenv, curl, xidel, cacert
|
2016-01-23 00:54:49 +01:00
|
|
|
# Begin download parameters
|
|
|
|
, username ? ""
|
|
|
|
, password ? ""
|
|
|
|
}:
|
|
|
|
|
|
|
|
{
|
|
|
|
# URL to fetch.
|
|
|
|
url ? ""
|
|
|
|
|
2016-09-23 04:49:36 +02:00
|
|
|
, name ? "factorio.tar.gz"
|
|
|
|
|
2016-01-23 00:54:49 +01:00
|
|
|
# Login URL.
|
|
|
|
, loginUrl ? "https://www.factorio.com/login"
|
|
|
|
|
|
|
|
# SHA256 of the fetched URL.
|
|
|
|
, sha256 ? ""
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2018-01-10 01:27:23 +01:00
|
|
|
nativeBuildInputs = [ curl xidel ];
|
2016-01-23 00:54:49 +01:00
|
|
|
|
2016-09-23 04:49:36 +02:00
|
|
|
inherit name url loginUrl username password cacert;
|
2016-01-23 00:54:49 +01:00
|
|
|
|
|
|
|
builder = ./fetch.sh;
|
|
|
|
|
|
|
|
outputHashAlgo = "sha256";
|
|
|
|
outputHash = sha256;
|
|
|
|
outputHashMode = "flat";
|
|
|
|
|
|
|
|
# There's no point in downloading remotely, we'd just slow things down.
|
|
|
|
preferLocalBuild = true;
|
|
|
|
}
|