factorio: Formatting
Format with nixpkgs-fmt and alphabetize.
This commit is contained in:
parent
3c384353a6
commit
c5ef4af03f
@ -1,11 +1,27 @@
|
||||
{ lib, stdenv, fetchurl, makeWrapper, makeDesktopItem
|
||||
, alsa-lib, libpulseaudio, libX11, libXcursor, libXinerama, libXrandr, libXi, libGL
|
||||
, libSM, libICE, libXext, factorio-utils
|
||||
{ lib
|
||||
, alsa-lib
|
||||
, factorio-utils
|
||||
, fetchurl
|
||||
, libGL
|
||||
, libICE
|
||||
, libSM
|
||||
, libX11
|
||||
, libXcursor
|
||||
, libXext
|
||||
, libXi
|
||||
, libXinerama
|
||||
, libXrandr
|
||||
, libpulseaudio
|
||||
, makeDesktopItem
|
||||
, makeWrapper
|
||||
, releaseType
|
||||
, stdenv
|
||||
|
||||
, mods ? [ ]
|
||||
, mods-dat ? null
|
||||
, versionsJson ? ./versions.json
|
||||
, username ? "", token ? "" # get/reset token at https://factorio.com/profile
|
||||
, username ? ""
|
||||
, token ? "" # get/reset token at https://factorio.com/profile
|
||||
, experimental ? false # true means to always use the latest branch
|
||||
}:
|
||||
|
||||
@ -68,7 +84,8 @@ let
|
||||
actual = binDists.${stdenv.hostPlatform.system}.${releaseType}.${branch} or (throw "Factorio ${releaseType}-${branch} binaries for ${stdenv.hostPlatform.system} are not available for download.");
|
||||
|
||||
makeBinDists = versions:
|
||||
let f = path: name: value:
|
||||
let
|
||||
f = path: name: value:
|
||||
if builtins.isAttrs value then
|
||||
if value ? "name" then
|
||||
makeBinDist value
|
||||
@ -89,11 +106,14 @@ let
|
||||
inherit name url sha256;
|
||||
curlOptsList = [
|
||||
"--get"
|
||||
"--data-urlencode" "username@username"
|
||||
"--data-urlencode" "token@token"
|
||||
"--data-urlencode"
|
||||
"username@username"
|
||||
"--data-urlencode"
|
||||
"token@token"
|
||||
];
|
||||
})
|
||||
(_: { # This preHook hides the credentials from /proc
|
||||
(_: {
|
||||
# This preHook hides the credentials from /proc
|
||||
preHook =
|
||||
if username != "" && token != "" then ''
|
||||
echo -n "${username}" >username
|
||||
@ -149,8 +169,11 @@ let
|
||||
$out/bin/factorio
|
||||
'';
|
||||
|
||||
passthru.updateScript = if (username != "" && token != "") then [
|
||||
./update.py "--username=${username}" "--token=${token}"
|
||||
passthru.updateScript =
|
||||
if (username != "" && token != "") then [
|
||||
./update.py
|
||||
"--username=${username}"
|
||||
"--token=${token}"
|
||||
] else null;
|
||||
|
||||
meta = {
|
||||
@ -184,16 +207,16 @@ let
|
||||
|
||||
libPath = lib.makeLibraryPath [
|
||||
alsa-lib
|
||||
libpulseaudio
|
||||
libGL
|
||||
libICE
|
||||
libSM
|
||||
libX11
|
||||
libXcursor
|
||||
libXext
|
||||
libXi
|
||||
libXinerama
|
||||
libXrandr
|
||||
libXi
|
||||
libGL
|
||||
libSM
|
||||
libICE
|
||||
libXext
|
||||
libpulseaudio
|
||||
];
|
||||
|
||||
installPhase = base.installPhase + ''
|
||||
@ -244,4 +267,5 @@ let
|
||||
};
|
||||
};
|
||||
|
||||
in stdenv.mkDerivation (releases.${releaseType})
|
||||
in
|
||||
stdenv.mkDerivation (releases.${releaseType})
|
||||
|
Loading…
Reference in New Issue
Block a user