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 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

@ -1,4 +1,10 @@
{ config, lib, utils, pkgs, ... }:
{
config,
lib,
utils,
pkgs,
...
}:
let
inherit (lib)
@ -8,11 +14,12 @@ let
mkPackageOption
mkIf
mkOption
types;
types
;
cfg = config.services.filebeat;
json = pkgs.formats.json {};
json = pkgs.formats.json { };
in
{
options = {
@ -41,23 +48,28 @@ in
See <https://www.elastic.co/guide/en/beats/filebeat/current/configuration-filebeat-options.html>.
'';
default = {};
type = types.attrsOf (types.submodule ({ name, ... }: {
freeformType = json.type;
options = {
type = mkOption {
type = types.str;
default = name;
description = ''
The input type.
default = { };
type = types.attrsOf (
types.submodule (
{ name, ... }:
{
freeformType = json.type;
options = {
type = mkOption {
type = types.str;
default = name;
description = ''
The input type.
Look for the value after `type:` on
the individual input pages linked from
<https://www.elastic.co/guide/en/beats/filebeat/current/configuration-filebeat-options.html>.
'';
};
};
}));
Look for the value after `type:` on
the individual input pages linked from
<https://www.elastic.co/guide/en/beats/filebeat/current/configuration-filebeat-options.html>.
'';
};
};
}
)
);
example = literalExpression ''
{
journald.id = "everything"; # Only for filebeat7
@ -91,23 +103,28 @@ in
See <https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-modules.html>.
'';
default = {};
type = types.attrsOf (types.submodule ({ name, ... }: {
freeformType = json.type;
options = {
module = mkOption {
type = types.str;
default = name;
description = ''
The name of the module.
default = { };
type = types.attrsOf (
types.submodule (
{ name, ... }:
{
freeformType = json.type;
options = {
module = mkOption {
type = types.str;
default = name;
description = ''
The name of the module.
Look for the value after `module:` on
the individual input pages linked from
<https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-modules.html>.
'';
};
};
}));
Look for the value after `module:` on
the individual input pages linked from
<https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-modules.html>.
'';
};
};
}
)
);
example = literalExpression ''
{
nginx = {
@ -152,7 +169,7 @@ in
filebeat = {
inputs = mkOption {
type = types.listOf json.type;
default = [];
default = [ ];
internal = true;
description = ''
Inputs specify how Filebeat locates and processes
@ -163,7 +180,7 @@ in
};
modules = mkOption {
type = types.listOf json.type;
default = [];
default = [ ];
internal = true;
description = ''
Filebeat modules provide a quick way to get started
@ -180,7 +197,7 @@ in
};
};
};
default = {};
default = { };
example = literalExpression ''
{
settings = {
@ -229,10 +246,7 @@ in
umask u=rwx,g=,o=
${utils.genJqSecretsReplacementSnippet
cfg.settings
"/var/lib/filebeat/filebeat.yml"
}
${utils.genJqSecretsReplacementSnippet cfg.settings "/var/lib/filebeat/filebeat.yml"}
'';
ExecStart = ''
${cfg.package}/bin/filebeat -e \