0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 21:50:33 +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:
Silvan Mosberger 2024-12-10 20:27:17 +01:00
parent 57b193d8dd
commit 667d42c00d
21287 changed files with 701385 additions and 428458 deletions

View file

@ -3,68 +3,73 @@
# TODO: use a real proxy node and put this test into networking.nix
# TODO: test whether nix tools work as expected behind a proxy
let default-config = {
imports = [ ./common/user-account.nix ];
let
default-config = {
imports = [ ./common/user-account.nix ];
services.xserver.enable = false;
services.xserver.enable = false;
};
in import ./make-test-python.nix ({ pkgs, ...} : {
name = "networking-proxy";
meta = with pkgs.lib.maintainers; {
maintainers = [ ];
};
nodes = {
# no proxy
machine =
{ ... }:
default-config;
# proxy default
machine2 =
{ ... }:
default-config // {
networking.proxy.default = "http://user:pass@host:port";
};
# specific proxy options
machine3 =
{ ... }:
default-config //
{
networking.proxy = {
# useless because overridden by the next options
default = "http://user:pass@host:port";
# advanced proxy setup
httpProxy = "123-http://user:pass@http-host:port";
httpsProxy = "456-http://user:pass@https-host:port";
rsyncProxy = "789-http://user:pass@rsync-host:port";
ftpProxy = "101112-http://user:pass@ftp-host:port";
noProxy = "131415-127.0.0.1,localhost,.localdomain";
};
};
# mix default + proxy options
machine4 =
{ ... }:
default-config // {
networking.proxy = {
# open for all *_proxy env var
default = "000-http://user:pass@default-host:port";
# except for those 2
rsyncProxy = "123-http://user:pass@http-host:port";
noProxy = "131415-127.0.0.1,localhost,.localdomain";
};
};
in
import ./make-test-python.nix (
{ pkgs, ... }:
{
name = "networking-proxy";
meta = with pkgs.lib.maintainers; {
maintainers = [ ];
};
testScript =
''
nodes = {
# no proxy
machine =
{ ... }:
default-config;
# proxy default
machine2 =
{ ... }:
default-config
// {
networking.proxy.default = "http://user:pass@host:port";
};
# specific proxy options
machine3 =
{ ... }:
default-config
// {
networking.proxy = {
# useless because overridden by the next options
default = "http://user:pass@host:port";
# advanced proxy setup
httpProxy = "123-http://user:pass@http-host:port";
httpsProxy = "456-http://user:pass@https-host:port";
rsyncProxy = "789-http://user:pass@rsync-host:port";
ftpProxy = "101112-http://user:pass@ftp-host:port";
noProxy = "131415-127.0.0.1,localhost,.localdomain";
};
};
# mix default + proxy options
machine4 =
{ ... }:
default-config
// {
networking.proxy = {
# open for all *_proxy env var
default = "000-http://user:pass@default-host:port";
# except for those 2
rsyncProxy = "123-http://user:pass@http-host:port";
noProxy = "131415-127.0.0.1,localhost,.localdomain";
};
};
};
testScript = ''
from typing import Dict, Optional
@ -131,4 +136,5 @@ in import ./make-test-python.nix ({ pkgs, ...} : {
assert "000" in env["ftp_proxy"]
assert "131415" in env["no_proxy"]
'';
})
}
)