mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 13:40:28 +03:00
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 57b193d8dd
result/bin/apply-formatting $NIXPKGS_PATH
This commit is contained in:
parent
57b193d8dd
commit
667d42c00d
21287 changed files with 701385 additions and 428458 deletions
|
@ -1,103 +1,113 @@
|
|||
import ./make-test-python.nix ({ pkgs, ... }: {
|
||||
name = "caddy";
|
||||
meta = with pkgs.lib.maintainers; {
|
||||
maintainers = [ Br1ght0ne ];
|
||||
};
|
||||
import ./make-test-python.nix (
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
name = "caddy";
|
||||
meta = with pkgs.lib.maintainers; {
|
||||
maintainers = [ Br1ght0ne ];
|
||||
};
|
||||
|
||||
nodes = {
|
||||
webserver = { pkgs, lib, ... }: {
|
||||
services.caddy.enable = true;
|
||||
services.caddy.extraConfig = ''
|
||||
http://localhost {
|
||||
encode gzip
|
||||
nodes = {
|
||||
webserver =
|
||||
{ pkgs, lib, ... }:
|
||||
{
|
||||
services.caddy.enable = true;
|
||||
services.caddy.extraConfig = ''
|
||||
http://localhost {
|
||||
encode gzip
|
||||
|
||||
file_server
|
||||
root * ${
|
||||
pkgs.runCommand "testdir" {} ''
|
||||
mkdir "$out"
|
||||
echo hello world > "$out/example.html"
|
||||
''
|
||||
}
|
||||
}
|
||||
'';
|
||||
services.caddy.enableReload = true;
|
||||
file_server
|
||||
root * ${
|
||||
pkgs.runCommand "testdir" { } ''
|
||||
mkdir "$out"
|
||||
echo hello world > "$out/example.html"
|
||||
''
|
||||
}
|
||||
}
|
||||
'';
|
||||
services.caddy.enableReload = true;
|
||||
|
||||
specialisation.config-reload.configuration = {
|
||||
services.caddy.extraConfig = ''
|
||||
http://localhost:8080 {
|
||||
}
|
||||
'';
|
||||
};
|
||||
specialisation.multiple-configs.configuration = {
|
||||
services.caddy.virtualHosts = {
|
||||
"http://localhost:8080" = { };
|
||||
"http://localhost:8081" = { };
|
||||
};
|
||||
};
|
||||
specialisation.rfc42.configuration = {
|
||||
services.caddy.settings = {
|
||||
apps.http.servers.default = {
|
||||
listen = [ ":80" ];
|
||||
routes = [{
|
||||
handle = [{
|
||||
body = "hello world";
|
||||
handler = "static_response";
|
||||
status_code = 200;
|
||||
}];
|
||||
}];
|
||||
specialisation.config-reload.configuration = {
|
||||
services.caddy.extraConfig = ''
|
||||
http://localhost:8080 {
|
||||
}
|
||||
'';
|
||||
};
|
||||
specialisation.multiple-configs.configuration = {
|
||||
services.caddy.virtualHosts = {
|
||||
"http://localhost:8080" = { };
|
||||
"http://localhost:8081" = { };
|
||||
};
|
||||
};
|
||||
specialisation.rfc42.configuration = {
|
||||
services.caddy.settings = {
|
||||
apps.http.servers.default = {
|
||||
listen = [ ":80" ];
|
||||
routes = [
|
||||
{
|
||||
handle = [
|
||||
{
|
||||
body = "hello world";
|
||||
handler = "static_response";
|
||||
status_code = 200;
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
specialisation.explicit-config-file.configuration = {
|
||||
services.caddy.configFile = pkgs.writeText "Caddyfile" ''
|
||||
localhost:80
|
||||
|
||||
respond "hello world"
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
specialisation.explicit-config-file.configuration = {
|
||||
services.caddy.configFile = pkgs.writeText "Caddyfile" ''
|
||||
localhost:80
|
||||
|
||||
respond "hello world"
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
testScript = { nodes, ... }:
|
||||
let
|
||||
explicitConfigFile = "${nodes.webserver.system.build.toplevel}/specialisation/explicit-config-file";
|
||||
justReloadSystem = "${nodes.webserver.system.build.toplevel}/specialisation/config-reload";
|
||||
multipleConfigs = "${nodes.webserver.system.build.toplevel}/specialisation/multiple-configs";
|
||||
rfc42Config = "${nodes.webserver.system.build.toplevel}/specialisation/rfc42";
|
||||
in
|
||||
''
|
||||
url = "http://localhost/example.html"
|
||||
webserver.wait_for_unit("caddy")
|
||||
webserver.wait_for_open_port(80)
|
||||
testScript =
|
||||
{ nodes, ... }:
|
||||
let
|
||||
explicitConfigFile = "${nodes.webserver.system.build.toplevel}/specialisation/explicit-config-file";
|
||||
justReloadSystem = "${nodes.webserver.system.build.toplevel}/specialisation/config-reload";
|
||||
multipleConfigs = "${nodes.webserver.system.build.toplevel}/specialisation/multiple-configs";
|
||||
rfc42Config = "${nodes.webserver.system.build.toplevel}/specialisation/rfc42";
|
||||
in
|
||||
''
|
||||
url = "http://localhost/example.html"
|
||||
webserver.wait_for_unit("caddy")
|
||||
webserver.wait_for_open_port(80)
|
||||
|
||||
|
||||
with subtest("config is reloaded on nixos-rebuild switch"):
|
||||
webserver.succeed(
|
||||
"${justReloadSystem}/bin/switch-to-configuration test >&2"
|
||||
)
|
||||
webserver.wait_for_open_port(8080)
|
||||
webserver.fail("journalctl -u caddy | grep -q -i stopped")
|
||||
webserver.succeed("journalctl -u caddy | grep -q -i reloaded")
|
||||
with subtest("config is reloaded on nixos-rebuild switch"):
|
||||
webserver.succeed(
|
||||
"${justReloadSystem}/bin/switch-to-configuration test >&2"
|
||||
)
|
||||
webserver.wait_for_open_port(8080)
|
||||
webserver.fail("journalctl -u caddy | grep -q -i stopped")
|
||||
webserver.succeed("journalctl -u caddy | grep -q -i reloaded")
|
||||
|
||||
with subtest("multiple configs are correctly merged"):
|
||||
webserver.succeed(
|
||||
"${multipleConfigs}/bin/switch-to-configuration test >&2"
|
||||
)
|
||||
webserver.wait_for_open_port(8080)
|
||||
webserver.wait_for_open_port(8081)
|
||||
with subtest("multiple configs are correctly merged"):
|
||||
webserver.succeed(
|
||||
"${multipleConfigs}/bin/switch-to-configuration test >&2"
|
||||
)
|
||||
webserver.wait_for_open_port(8080)
|
||||
webserver.wait_for_open_port(8081)
|
||||
|
||||
with subtest("rfc42 settings config"):
|
||||
webserver.succeed(
|
||||
"${rfc42Config}/bin/switch-to-configuration test >&2"
|
||||
)
|
||||
webserver.wait_for_open_port(80)
|
||||
webserver.succeed("curl http://localhost | grep hello")
|
||||
with subtest("rfc42 settings config"):
|
||||
webserver.succeed(
|
||||
"${rfc42Config}/bin/switch-to-configuration test >&2"
|
||||
)
|
||||
webserver.wait_for_open_port(80)
|
||||
webserver.succeed("curl http://localhost | grep hello")
|
||||
|
||||
with subtest("explicit configFile"):
|
||||
webserver.succeed(
|
||||
"${explicitConfigFile}/bin/switch-to-configuration test >&2"
|
||||
)
|
||||
webserver.wait_for_open_port(80)
|
||||
webserver.succeed("curl http://localhost | grep hello")
|
||||
'';
|
||||
})
|
||||
with subtest("explicit configFile"):
|
||||
webserver.succeed(
|
||||
"${explicitConfigFile}/bin/switch-to-configuration test >&2"
|
||||
)
|
||||
webserver.wait_for_open_port(80)
|
||||
webserver.succeed("curl http://localhost | grep hello")
|
||||
'';
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue