Skip to content

Commit 5a07111

Browse files
treewide: run nixfmt 1.0.0
1 parent 6f56639 commit 5a07111

File tree

5,118 files changed

+100492
-103190
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,118 files changed

+100492
-103190
lines changed

doc/hooks/tauri.section.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ rustPlatform.buildRustPackage (finalAttrs: {
4545
4646
# Make sure we can find our libraries
4747
pkg-config
48-
] ++ lib.optionals stdenv.hostPlatform.isLinux [ wrapGAppsHook4 ];
48+
]
49+
++ lib.optionals stdenv.hostPlatform.isLinux [ wrapGAppsHook4 ];
4950
5051
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [
5152
glib-networking # Most Tauri apps need networking

doc/languages-frameworks/coq.section.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,8 @@ For instance, here is how you could add some code to be performed in the derivat
177177

178178
```nix
179179
coqPackages.multinomials.overrideAttrs (oldAttrs: {
180-
postInstall =
181-
oldAttrs.postInstall or ""
182-
+ ''
183-
echo "you can do anything you want here"
184-
'';
180+
postInstall = oldAttrs.postInstall or "" + ''
181+
echo "you can do anything you want here"
182+
'';
185183
})
186184
```

doc/languages-frameworks/python.section.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,20 +1376,19 @@ This is especially helpful to select tests or specify flags conditionally:
13761376

13771377
```nix
13781378
{
1379-
disabledTests =
1380-
[
1381-
# touches network
1382-
"download"
1383-
"update"
1384-
]
1385-
++ lib.optionals (pythonAtLeast "3.8") [
1386-
# broken due to python3.8 async changes
1387-
"async"
1388-
]
1389-
++ lib.optionals stdenv.buildPlatform.isDarwin [
1390-
# can fail when building with other packages
1391-
"socket"
1392-
];
1379+
disabledTests = [
1380+
# touches network
1381+
"download"
1382+
"update"
1383+
]
1384+
++ lib.optionals (pythonAtLeast "3.8") [
1385+
# broken due to python3.8 async changes
1386+
"async"
1387+
]
1388+
++ lib.optionals stdenv.buildPlatform.isDarwin [
1389+
# can fail when building with other packages
1390+
"socket"
1391+
];
13931392
}
13941393
```
13951394

@@ -2035,7 +2034,8 @@ and letting the package requiring the extra add the list to its dependencies
20352034
{
20362035
dependencies = [
20372036
# ...
2038-
] ++ dask.optional-dependencies.complete;
2037+
]
2038+
++ dask.optional-dependencies.complete;
20392039
}
20402040
```
20412041

doc/stdenv/cross-compilation.chapter.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ e.g.
171171
{
172172
nativeBuildInputs = [
173173
meson
174-
] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ mesonEmulatorHook ];
174+
]
175+
++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ mesonEmulatorHook ];
175176
}
176177
```
177178

lib/customisation.nix

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -446,16 +446,15 @@ rec {
446446
let
447447
outputs = drv.outputs or [ "out" ];
448448

449-
commonAttrs =
450-
{
451-
inherit (drv) name system meta;
452-
inherit outputs;
453-
}
454-
// optionalAttrs (drv._hydraAggregate or false) {
455-
_hydraAggregate = true;
456-
constituents = map hydraJob (flatten drv.constituents);
457-
}
458-
// (listToAttrs outputsList);
449+
commonAttrs = {
450+
inherit (drv) name system meta;
451+
inherit outputs;
452+
}
453+
// optionalAttrs (drv._hydraAggregate or false) {
454+
_hydraAggregate = true;
455+
constituents = map hydraJob (flatten drv.constituents);
456+
}
457+
// (listToAttrs outputsList);
459458

460459
makeOutput =
461460
outputName:

lib/deprecated/misc.nix

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,11 @@ let
355355
mergeAttrByFunc =
356356
x: y:
357357
let
358-
mergeAttrBy2 =
359-
{ mergeAttrBy = mergeAttrs; } // (maybeAttr "mergeAttrBy" { } x) // (maybeAttr "mergeAttrBy" { } y);
358+
mergeAttrBy2 = {
359+
mergeAttrBy = mergeAttrs;
360+
}
361+
// (maybeAttr "mergeAttrBy" { } x)
362+
// (maybeAttr "mergeAttrBy" { } y);
360363
in
361364
foldr mergeAttrs { } [
362365
x

lib/modules.nix

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -886,19 +886,18 @@ let
886886
path = showOption loc;
887887
depth = length loc;
888888

889-
paragraphs =
890-
[
891-
"In module ${file}: expected an option declaration at option path `${path}` but got an attribute set with type ${actualTag}"
892-
]
893-
++ optional (actualTag == "option-type") ''
894-
When declaring an option, you must wrap the type in a `mkOption` call. It should look somewhat like:
895-
${comment}
896-
${name} = lib.mkOption {
897-
description = ...;
898-
type = <the type you wrote for ${name}>;
899-
...
900-
};
901-
'';
889+
paragraphs = [
890+
"In module ${file}: expected an option declaration at option path `${path}` but got an attribute set with type ${actualTag}"
891+
]
892+
++ optional (actualTag == "option-type") ''
893+
When declaring an option, you must wrap the type in a `mkOption` call. It should look somewhat like:
894+
${comment}
895+
${name} = lib.mkOption {
896+
description = ...;
897+
type = <the type you wrote for ${name}>;
898+
...
899+
};
900+
'';
902901

903902
# Ideally we'd know the exact syntax they used, but short of that,
904903
# we can only reliably repeat the last. However, we repeat the
@@ -1627,25 +1626,24 @@ let
16271626
) from
16281627
);
16291628

1630-
config =
1631-
{
1632-
warnings = filter (x: x != "") (
1633-
map (
1634-
f:
1635-
let
1636-
val = getAttrFromPath f config;
1637-
opt = getAttrFromPath f options;
1638-
in
1639-
optionalString (val != "_mkMergedOptionModule")
1640-
"The option `${showOption f}' defined in ${showFiles opt.files} has been changed to `${showOption to}' that has a different type. Please read `${showOption to}' documentation and update your configuration accordingly."
1641-
) from
1642-
);
1643-
}
1644-
// setAttrByPath to (
1645-
mkMerge (
1646-
optional (any (f: (getAttrFromPath f config) != "_mkMergedOptionModule") from) (mergeFn config)
1647-
)
1629+
config = {
1630+
warnings = filter (x: x != "") (
1631+
map (
1632+
f:
1633+
let
1634+
val = getAttrFromPath f config;
1635+
opt = getAttrFromPath f options;
1636+
in
1637+
optionalString (val != "_mkMergedOptionModule")
1638+
"The option `${showOption f}' defined in ${showFiles opt.files} has been changed to `${showOption to}' that has a different type. Please read `${showOption to}' documentation and update your configuration accordingly."
1639+
) from
16481640
);
1641+
}
1642+
// setAttrByPath to (
1643+
mkMerge (
1644+
optional (any (f: (getAttrFromPath f config) != "_mkMergedOptionModule") from) (mergeFn config)
1645+
)
1646+
);
16491647
};
16501648

16511649
/**

lib/options.nix

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -572,30 +572,29 @@ rec {
572572
opt:
573573
let
574574
name = showOption opt.loc;
575-
docOption =
576-
{
577-
loc = opt.loc;
578-
inherit name;
579-
description = opt.description or null;
580-
declarations = filter (x: x != unknownModule) opt.declarations;
581-
internal = opt.internal or false;
582-
visible = if (opt ? visible && opt.visible == "shallow") then true else opt.visible or true;
583-
readOnly = opt.readOnly or false;
584-
type = opt.type.description or "unspecified";
585-
}
586-
// optionalAttrs (opt ? example) {
587-
example = builtins.addErrorContext "while evaluating the example of option `${name}`" (
588-
renderOptionValue opt.example
589-
);
590-
}
591-
// optionalAttrs (opt ? defaultText || opt ? default) {
592-
default = builtins.addErrorContext "while evaluating the ${
593-
if opt ? defaultText then "defaultText" else "default value"
594-
} of option `${name}`" (renderOptionValue (opt.defaultText or opt.default));
595-
}
596-
// optionalAttrs (opt ? relatedPackages && opt.relatedPackages != null) {
597-
inherit (opt) relatedPackages;
598-
};
575+
docOption = {
576+
loc = opt.loc;
577+
inherit name;
578+
description = opt.description or null;
579+
declarations = filter (x: x != unknownModule) opt.declarations;
580+
internal = opt.internal or false;
581+
visible = if (opt ? visible && opt.visible == "shallow") then true else opt.visible or true;
582+
readOnly = opt.readOnly or false;
583+
type = opt.type.description or "unspecified";
584+
}
585+
// optionalAttrs (opt ? example) {
586+
example = builtins.addErrorContext "while evaluating the example of option `${name}`" (
587+
renderOptionValue opt.example
588+
);
589+
}
590+
// optionalAttrs (opt ? defaultText || opt ? default) {
591+
default = builtins.addErrorContext "while evaluating the ${
592+
if opt ? defaultText then "defaultText" else "default value"
593+
} of option `${name}`" (renderOptionValue (opt.defaultText or opt.default));
594+
}
595+
// optionalAttrs (opt ? relatedPackages && opt.relatedPackages != null) {
596+
inherit (opt) relatedPackages;
597+
};
599598

600599
subOptions =
601600
let

lib/path/tests/default.nix

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@
1414

1515
pkgs.runCommand "lib-path-tests"
1616
{
17-
nativeBuildInputs =
18-
[
19-
nixVersions.stable
20-
]
21-
++ (with pkgs; [
22-
jq
23-
bc
24-
]);
17+
nativeBuildInputs = [
18+
nixVersions.stable
19+
]
20+
++ (with pkgs; [
21+
jq
22+
bc
23+
]);
2524
}
2625
''
2726
# Needed to make Nix evaluation work

lib/systems/architectures.nix

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,8 @@ rec {
477477
"armv9.1-a" = [
478478
"armv9-a"
479479
"armv8.6-a"
480-
] ++ inferiors."armv8.6-a";
480+
]
481+
++ inferiors."armv8.6-a";
481482
"armv9.2-a" = lib.unique (
482483
[
483484
"armv9.1-a"
@@ -503,12 +504,14 @@ rec {
503504
"armv8.2-a"
504505
"cortex-a53"
505506
"cortex-a72"
506-
] ++ inferiors."armv8.2-a";
507+
]
508+
++ inferiors."armv8.2-a";
507509
cortex-a76 = [
508510
"armv8.2-a"
509511
"cortex-a53"
510512
"cortex-a72"
511-
] ++ inferiors."armv8.2-a";
513+
]
514+
++ inferiors."armv8.2-a";
512515

513516
# Ampere
514517
ampere1 = withInferiors [

0 commit comments

Comments
 (0)