0
0
Fork 0
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 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,73 +1,76 @@
import ../make-test-python.nix ({ lib, pkgs, ... }:
import ../make-test-python.nix (
{ lib, pkgs, ... }:
{
name = "initrd-network-ssh";
meta.maintainers = with lib.maintainers; [ willibutz emily ];
{
name = "initrd-network-ssh";
meta.maintainers = with lib.maintainers; [
willibutz
emily
];
nodes = {
server =
{ config, ... }:
{
boot.kernelParams = [
"ip=${config.networking.primaryIPAddress}:::255.255.255.0::eth1:none"
];
boot.initrd.network = {
enable = true;
ssh = {
nodes = {
server =
{ config, ... }:
{
boot.kernelParams = [
"ip=${config.networking.primaryIPAddress}:::255.255.255.0::eth1:none"
];
boot.initrd.network = {
enable = true;
authorizedKeys = [ (lib.readFile ./id_ed25519.pub) ];
port = 22;
hostKeys = [ ./ssh_host_ed25519_key ];
ssh = {
enable = true;
authorizedKeys = [ (lib.readFile ./id_ed25519.pub) ];
port = 22;
hostKeys = [ ./ssh_host_ed25519_key ];
};
};
boot.initrd.preLVMCommands = ''
while true; do
if [ -f fnord ]; then
poweroff
fi
sleep 1
done
'';
};
client =
{ config, ... }:
{
environment.etc = {
knownHosts = {
text = lib.concatStrings [
"server,"
"${toString (lib.head (lib.splitString " " (toString (lib.elemAt (lib.splitString "\n" config.networking.extraHosts) 2))))} "
"${lib.readFile ./ssh_host_ed25519_key.pub}"
];
};
sshKey = {
source = ./id_ed25519;
mode = "0600";
};
};
};
boot.initrd.preLVMCommands = ''
while true; do
if [ -f fnord ]; then
poweroff
fi
sleep 1
done
'';
};
};
client =
{ config, ... }:
{
environment.etc = {
knownHosts = {
text = lib.concatStrings [
"server,"
"${toString (lib.head (lib.splitString " " (
toString (lib.elemAt (lib.splitString "\n" config.networking.extraHosts) 2)
)))} "
"${lib.readFile ./ssh_host_ed25519_key.pub}"
];
};
sshKey = {
source = ./id_ed25519;
mode = "0600";
};
};
};
};
testScript = ''
start_all()
client.wait_for_unit("network.target")
testScript = ''
start_all()
client.wait_for_unit("network.target")
def ssh_is_up(_) -> bool:
status, _ = client.execute("nc -z server 22")
return status == 0
def ssh_is_up(_) -> bool:
status, _ = client.execute("nc -z server 22")
return status == 0
with client.nested("waiting for SSH server to come up"):
retry(ssh_is_up)
with client.nested("waiting for SSH server to come up"):
retry(ssh_is_up)
client.succeed(
"ssh -i /etc/sshKey -o UserKnownHostsFile=/etc/knownHosts server 'touch /fnord'"
)
client.shutdown()
'';
})
client.succeed(
"ssh -i /etc/sshKey -o UserKnownHostsFile=/etc/knownHosts server 'touch /fnord'"
)
client.shutdown()
'';
}
)

View file

@ -1,6 +1,7 @@
with import ../../.. {};
with import ../../.. { };
runCommand "gen-keys" {
runCommand "gen-keys"
{
buildInputs = [ openssh ];
}
''