1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 01:51:47 +02:00

Format .nix files

This does not include any automation for the release branch, but
is based on the configuration of https://github.com/NixOS/nix/pull/12349

    pre-commit run -a nixfmt-rfc-style
This commit is contained in:
Robert Hensing 2025-01-24 20:26:47 +01:00
parent 42b22fe3de
commit 2f1b70a529
259 changed files with 7729 additions and 5286 deletions

View file

@ -6,55 +6,106 @@
multiply 2 3
=> 6
```
*/
*/
multiply = x: y: x * y;
/**👈 precisely this wide 👉*/
/**
👈 precisely this wide 👉
*/
measurement = x: x;
floatedIn = /** This also works. */
floatedIn =
/**
This also works.
*/
x: y: x;
compact=/**boom*/x: x;
# https://github.com/NixOS/rfcs/blob/master/rfcs/0145-doc-strings.md#ambiguous-placement
/** Ignore!!! */
unambiguous =
/** Very close */
compact =
/**
boom
*/
x: x;
/** Firmly rigid. */
# https://github.com/NixOS/rfcs/blob/master/rfcs/0145-doc-strings.md#ambiguous-placement
/**
Ignore!!!
*/
unambiguous =
/**
Very close
*/
x: x;
/**
Firmly rigid.
*/
constant = true;
/** Immovably fixed. */
/**
Immovably fixed.
*/
lib.version = "9000";
/** Unchangeably constant. */
/**
Unchangeably constant.
*/
lib.attr.empty = { };
lib.attr.undocumented = { };
nonStrict = /** My syntax is not strict, but I'm strict anyway. */ x: x;
strict = /** I don't have to be strict, but I am anyway. */ { ... }: null;
nonStrict =
/**
My syntax is not strict, but I'm strict anyway.
*/
x: x;
strict =
/**
I don't have to be strict, but I am anyway.
*/
{ ... }: null;
# Note that pre and post are the same here. I just had to name them somehow.
strictPre = /** Here's one way to do this */ a@{ ... }: a;
strictPost = /** Here's another way to do this */ { ... }@a: a;
strictPre =
/**
Here's one way to do this
*/
a@{ ... }: a;
strictPost =
/**
Here's another way to do this
*/
{ ... }@a: a;
# TODO
/** You won't see this. */
/**
You won't see this.
*/
curriedArgs =
/** A documented function. */
/**
A documented function.
*/
x:
/** The function returned by applying once */
/**
The function returned by applying once
*/
y:
/** A function body performing summation of two items */
/**
A function body performing summation of two items
*/
x + y;
/** Documented formals (but you won't see this comment) */
/**
Documented formals (but you won't see this comment)
*/
documentedFormals =
/** Finds x */
{ /** The x attribute */
x
}: x;
/**
Finds x
*/
{
/**
The x attribute
*/
x,
}:
x;
}