mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-20 03:43:45 +00:00
4f0dadbf38
After final improvements to the official formatter implementation, this commit now performs the first treewide reformat of Nix files using it. This is part of the implementation of RFC 166. Only "inactive" files are reformatted, meaning only files that aren't being touched by any PR with activity in the past 2 months. This is to avoid conflicts for PRs that might soon be merged. Later we can do a full treewide reformat to get the rest, which should not cause as many conflicts. A CI check has already been running for some time to ensure that new and already-formatted files are formatted, so the files being reformatted here should also stay formatted. This commit was automatically created and can be verified using nix-builda08b3a4d19
.tar.gz \ --argstr baseRevb32a094368
result/bin/apply-formatting $NIXPKGS_PATH
51 lines
1.1 KiB
Nix
51 lines
1.1 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchurl,
|
|
}:
|
|
|
|
{
|
|
pkg,
|
|
version,
|
|
sha256,
|
|
meta ? { },
|
|
}:
|
|
|
|
stdenv.mkDerivation ({
|
|
pname = pkg;
|
|
inherit version;
|
|
dontBuild = true;
|
|
dontConfigure = true;
|
|
dontFixup = true;
|
|
|
|
src = fetchurl {
|
|
url = "https://repo.hex.pm/tarballs/${pkg}-${version}.tar";
|
|
inherit sha256;
|
|
};
|
|
|
|
unpackCmd = ''
|
|
tar -xf $curSrc contents.tar.gz CHECKSUM metadata.config
|
|
mkdir contents
|
|
tar -C contents -xzf contents.tar.gz
|
|
mv metadata.config contents/hex_metadata.config
|
|
|
|
# To make the extracted hex tarballs appear legitimate to mix, we need to
|
|
# make sure they contain not just the contents of contents.tar.gz but also
|
|
# a .hex file with some lock metadata.
|
|
# We use an old version of .hex file per hex's mix_task_test.exs since it
|
|
# is just plain-text instead of an encoded format.
|
|
# See: https://github.com/hexpm/hex/blob/main/test/hex/mix_task_test.exs#L410
|
|
echo -n "${pkg},${version},$(cat CHECKSUM | tr '[:upper:]' '[:lower:]'),hexpm" > contents/.hex
|
|
'';
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
mkdir "$out"
|
|
cp -Hrt "$out" .
|
|
success=1
|
|
runHook postInstall
|
|
'';
|
|
|
|
inherit meta;
|
|
})
|