Silvan Mosberger 4f0dadbf38 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 a08b3a4d19.tar.gz \
      --argstr baseRev b32a0943687d2a5094a6d92f25a4b6e16a76b5b7
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

89 lines
2.0 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
dos2unix,
edid-decode,
hexdump,
zsh,
}:
# Usage:
# hardware.firmware = [(edid-generator.overrideAttrs {
# clean = true;
# modelines = ''
# Modeline "PG278Q_60" 241.50 2560 2608 2640 2720 1440 1443 1448 1481 -hsync +vsync
# Modeline "PG278Q_120" 497.75 2560 2608 2640 2720 1440 1443 1448 1525 +hsync -vsync
# Modeline "U2711_60" 241.50 2560 2600 2632 2720 1440 1443 1448 1481 -hsync +vsync
# '';
# })];
stdenv.mkDerivation {
pname = "edid-generator";
version = "master-2023-11-20";
# so `hardware.firmware` doesn't compress it
compressFirmware = false;
src = fetchFromGitHub {
owner = "akatrevorjay";
repo = "edid-generator";
rev = "476a016d8b488df749bf6d6efbf7b9fbfb2e3cb8";
sha256 = "sha256-UGxze273VB5cQDWrv9X/Lam6WbOu9U3bro8GcVbEvws=";
};
nativeBuildInputs = [
dos2unix
edid-decode
hexdump
zsh
];
postPatch = ''
patchShebangs modeline2edid
'';
passAsFile = [ "modelines" ];
clean = false;
modelines = "";
configurePhase = ''
test "$clean" != 1 || rm *x*.S
./modeline2edid - <"$modelinesPath"
for file in *.S ; do
echo "--- generated file: $file"
cat "$file"
done
make clean
'';
buildPhase = ''
make all
'';
doCheck = true;
checkPhase = ''
for file in *.bin ; do
echo "validating $file"
edid-decode <"$file"
done
'';
installPhase = ''
install -Dm 444 *.bin -t "$out/lib/firmware/edid"
'';
meta = {
description = "Hackerswork to generate an EDID blob from given Xorg Modelines";
homepage = "https://github.com/akatrevorjay/edid-generator";
license = lib.licenses.gpl3;
maintainers = with lib.maintainers; [
flokli
nazarewk
];
platforms = lib.platforms.all;
broken = stdenv.hostPlatform.isDarwin; # never built on Hydra https://hydra.nixos.org/job/nixpkgs/trunk/edid-generator.x86_64-darwin
};
}