treewide: format all inactive Nix files

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-build https://github.com/infinisil/treewide-nixpkgs-reformat-script/archive/a08b3a4d199c6124ac5b36a889d9099b4383463f.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
This commit is contained in:
Silvan Mosberger
2024-12-10 20:26:33 +01:00
parent b32a094368
commit 4f0dadbf38
21293 changed files with 701276 additions and 428232 deletions
@@ -1,4 +1,11 @@
{ stdenv, pkgs, fetchurl, zlib, gmp, lib }:
{
stdenv,
pkgs,
fetchurl,
zlib,
gmp,
lib,
}:
# from justinwoo/easy-purescript-nix
# https://github.com/justinwoo/easy-purescript-nix/blob/d383972c82620a712ead4033db14110497bc2c9c/purs.nix
@@ -6,61 +13,69 @@
let
dynamic-linker = stdenv.cc.bintools.dynamicLinker;
patchelf = libPath :
patchelf =
libPath:
lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
chmod u+w $PURS
patchelf --interpreter ${dynamic-linker} --set-rpath ${libPath} $PURS
chmod u-w $PURS
'';
chmod u+w $PURS
patchelf --interpreter ${dynamic-linker} --set-rpath ${libPath} $PURS
chmod u-w $PURS
'';
in stdenv.mkDerivation rec {
in
stdenv.mkDerivation rec {
pname = "purescript";
version = "0.15.15";
# These hashes can be updated automatically by running the ./update.sh script.
src = let
url = "https://github.com/${pname}/${pname}/releases/download/v${version}/";
sources = {
"x86_64-linux" = fetchurl {
url = url + "linux64.tar.gz";
sha256 = "1w4jgjpfhaw3gkx9sna64lq9m030x49w4lwk01ik5ci0933imzj3";
src =
let
url = "https://github.com/${pname}/${pname}/releases/download/v${version}/";
sources = {
"x86_64-linux" = fetchurl {
url = url + "linux64.tar.gz";
sha256 = "1w4jgjpfhaw3gkx9sna64lq9m030x49w4lwk01ik5ci0933imzj3";
};
"aarch64-linux" = fetchurl {
url = url + "linux-arm64.tar.gz";
sha256 = "1ws5h337xq0l06zrs9010h6wj2hq5cqk5ikp9arq7hj7lxf43vn5";
};
"x86_64-darwin" = fetchurl {
url = url + "macos.tar.gz";
sha256 = "178ix54k2yragcgn0j8z1cfa78s1qbh1bsx3v9jnngby8igr6yn3";
};
"aarch64-darwin" = fetchurl {
url = url + "macos-arm64.tar.gz";
sha256 = "0bi231z1yhb7kjfn228wjkj6rv9lgpagz9f4djr2wy3kqgck4xg0";
};
};
"aarch64-linux" = fetchurl {
url = url + "linux-arm64.tar.gz";
sha256 = "1ws5h337xq0l06zrs9010h6wj2hq5cqk5ikp9arq7hj7lxf43vn5";
};
"x86_64-darwin" = fetchurl {
url = url + "macos.tar.gz";
sha256 = "178ix54k2yragcgn0j8z1cfa78s1qbh1bsx3v9jnngby8igr6yn3";
};
"aarch64-darwin" = fetchurl {
url = url + "macos-arm64.tar.gz";
sha256 = "0bi231z1yhb7kjfn228wjkj6rv9lgpagz9f4djr2wy3kqgck4xg0";
};
};
in
in
sources.${stdenv.hostPlatform.system}
or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
buildInputs = [ zlib gmp ];
buildInputs = [
zlib
gmp
];
libPath = lib.makeLibraryPath buildInputs;
dontStrip = true;
installPhase = ''
mkdir -p $out/bin
PURS="$out/bin/purs"
installPhase =
''
mkdir -p $out/bin
PURS="$out/bin/purs"
install -D -m555 -T purs $PURS
${patchelf libPath}
'' + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
mkdir -p $out/share/bash-completion/completions
$PURS --bash-completion-script $PURS > $out/share/bash-completion/completions/purs-completion.bash
'';
install -D -m555 -T purs $PURS
${patchelf libPath}
''
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
mkdir -p $out/share/bash-completion/completions
$PURS --bash-completion-script $PURS > $out/share/bash-completion/completions/purs-completion.bash
'';
passthru = {
updateScript = ./update.sh;
tests = {
minimal-module = pkgs.callPackage ./test-minimal-module {};
minimal-module = pkgs.callPackage ./test-minimal-module { };
};
};
@@ -69,8 +84,17 @@ in stdenv.mkDerivation rec {
homepage = "https://www.purescript.org/";
license = licenses.bsd3;
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
maintainers = with maintainers; [ justinwoo mbbx6spp cdepillabout ];
platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
maintainers = with maintainers; [
justinwoo
mbbx6spp
cdepillabout
];
platforms = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
mainProgram = "purs";
changelog = "https://github.com/purescript/purescript/releases/tag/v${version}";
};
@@ -1,6 +1,10 @@
{ runCommand, purescript, nodejs }:
{
runCommand,
purescript,
nodejs,
}:
runCommand "purescript-test-minimal-module" {} ''
runCommand "purescript-test-minimal-module" { } ''
${purescript}/bin/purs compile -o ./output ${./.}/Main.purs
echo 'import {main} from "./output/Main/index.js"; main()' > node.mjs