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 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 701351 additions and 428307 deletions

View file

@ -1,6 +1,7 @@
{ system ? builtins.currentSystem,
config ? {},
pkgs ? import ../.. { inherit system config; }
{
system ? builtins.currentSystem,
config ? { },
pkgs ? import ../.. { inherit system config; },
}:
with import ../lib/testing-python.nix { inherit system pkgs; };
@ -14,19 +15,23 @@ in
builtins.listToAttrs (
builtins.map
(nginxPackage:
{
name = pkgs.lib.getName nginxPackage;
value = makeTest {
name = "nginx-http3-${pkgs.lib.getName nginxPackage}";
meta.maintainers = with pkgs.lib.maintainers; [ izorkin ];
(nginxPackage: {
name = pkgs.lib.getName nginxPackage;
value = makeTest {
name = "nginx-http3-${pkgs.lib.getName nginxPackage}";
meta.maintainers = with pkgs.lib.maintainers; [ izorkin ];
nodes = {
server = { lib, pkgs, ... }: {
nodes = {
server =
{ lib, pkgs, ... }:
{
networking = {
interfaces.eth1 = {
ipv4.addresses = [
{ address = "192.168.2.101"; prefixLength = 24; }
{
address = "192.168.2.101";
prefixLength = 24;
}
];
};
extraHosts = hosts;
@ -51,25 +56,32 @@ builtins.listToAttrs (
http3_hq = false;
quic = true;
reuseport = true;
root = lib.mkForce (pkgs.runCommandLocal "testdir" {} ''
mkdir "$out"
cat > "$out/index.html" <<EOF
<html><body>Hello World!</body></html>
EOF
cat > "$out/example.txt" <<EOF
Check http3 protocol.
EOF
'');
root = lib.mkForce (
pkgs.runCommandLocal "testdir" { } ''
mkdir "$out"
cat > "$out/index.html" <<EOF
<html><body>Hello World!</body></html>
EOF
cat > "$out/example.txt" <<EOF
Check http3 protocol.
EOF
''
);
};
};
};
client = { pkgs, ... }: {
client =
{ pkgs, ... }:
{
environment.systemPackages = [ pkgs.curlHTTP3 ];
networking = {
interfaces.eth1 = {
ipv4.addresses = [
{ address = "192.168.2.201"; prefixLength = 24; }
{
address = "192.168.2.201";
prefixLength = 24;
}
];
};
extraHosts = hosts;
@ -79,35 +91,37 @@ builtins.listToAttrs (
(builtins.readFile ./common/acme/server/ca.cert.pem)
];
};
};
testScript = ''
start_all()
server.wait_for_unit("nginx")
server.wait_for_open_port(443)
# Check http connections
client.succeed("curl --verbose --http3-only https://acme.test | grep 'Hello World!'")
# Check downloadings
client.succeed("curl --verbose --http3-only https://acme.test/example.txt --output /tmp/example.txt")
client.succeed("cat /tmp/example.txt | grep 'Check http3 protocol.'")
# Check header reading
client.succeed("curl --verbose --http3-only --head https://acme.test | grep 'content-type'")
client.succeed("curl --verbose --http3-only --head https://acme.test | grep 'HTTP/3 200'")
client.succeed("curl --verbose --http3-only --head https://acme.test/error | grep 'HTTP/3 404'")
# Check change User-Agent
client.succeed("curl --verbose --http3-only --user-agent 'Curl test 3.0' https://acme.test")
server.succeed("cat /var/log/nginx/access.log | grep 'Curl test 3.0'")
server.shutdown()
client.shutdown()
'';
};
}
)
[ pkgs.angieQuic pkgs.nginxQuic ]
testScript = ''
start_all()
server.wait_for_unit("nginx")
server.wait_for_open_port(443)
# Check http connections
client.succeed("curl --verbose --http3-only https://acme.test | grep 'Hello World!'")
# Check downloadings
client.succeed("curl --verbose --http3-only https://acme.test/example.txt --output /tmp/example.txt")
client.succeed("cat /tmp/example.txt | grep 'Check http3 protocol.'")
# Check header reading
client.succeed("curl --verbose --http3-only --head https://acme.test | grep 'content-type'")
client.succeed("curl --verbose --http3-only --head https://acme.test | grep 'HTTP/3 200'")
client.succeed("curl --verbose --http3-only --head https://acme.test/error | grep 'HTTP/3 404'")
# Check change User-Agent
client.succeed("curl --verbose --http3-only --user-agent 'Curl test 3.0' https://acme.test")
server.succeed("cat /var/log/nginx/access.log | grep 'Curl test 3.0'")
server.shutdown()
client.shutdown()
'';
};
})
[
pkgs.angieQuic
pkgs.nginxQuic
]
)