Unverified Commit b94e45ea authored by github-actions[bot]'s avatar github-actions[bot] Committed by GitHub
Browse files

Merge staging-next into staging

parents d8be0387 d1511265
Loading
Loading
Loading
Loading
+25 −8
Original line number Diff line number Diff line
@@ -251,25 +251,42 @@ You, as the writer of documentation, are still in charge of its content.
  For example:

  ```markdown
  # pkgs.coolFunction
  # pkgs.coolFunction {#pkgs.coolFunction}

  Description of what `coolFunction` does.
  `pkgs.coolFunction` *`name`* *`config`*

  ## Inputs
  Description of what `callPackage` does.

  `coolFunction` expects a single argument which should be an attribute set, with the following possible attributes:

  `name` (String)
  ## Inputs {#pkgs-coolFunction-inputs}

  If something's special about `coolFunction`'s general argument handling, you can say so here.
  Otherwise, just describe the single argument or start the arguments' definition list without introduction.

  *`name`* (String)

  : The name of the resulting image.

  `tag` (String; _optional_)
  *`config`* (Attribute set)

  : Introduce the parameter. Maybe you have a test to make sure `{ }` is a sensible default; then you can say: these attributes are optional; `{ }` is a valid argument.

  : Tag of the generated image.
    `outputHash` (String; _optional_)

    _Default:_ the output path's hash.
    : A brief explanation including when and when not to pass this attribute.

    : _Default:_ the output path's hash.
  ```

  Checklist:
  - Start with a synopsis, to show the order of positional arguments.
  - Metavariables are in emphasized code spans: ``` *`arg1`* ```. Metavariables are placeholders where users may write arbitrary expressions. This includes positional arguments.
  - Attribute names are regular code spans: ``` `attr1` ```. These identifiers can _not_ be picked freely by users, so they are _not_ metavariables.
  - _optional_ attributes have a _`Default:`_ if it's easily described as a value.
  - _optional_ attributes have a _`Default behavior:`_ if it's not easily described using a value.
  - Nix types aren't in code spans, because they are not code
  - Nix types are capitalized, to distinguish them from the camelCase [Module System](#module-system) types, which _are_ code and behave like functions.

#### Examples

To define a referenceable figure use the following fencing:
+8 −12
Original line number Diff line number Diff line
@@ -316,13 +316,7 @@ python3Packages.buildPythonApplication rec {
}
```

This is then added to `all-packages.nix` just as any other application would be.

```nix
{
  luigi = callPackage ../applications/networking/cluster/luigi { };
}
```
This is then added to `pkgs/by-name` just as any other application would be.

Since the package is an application, a consumer doesn't need to care about
Python versions or modules, which is why they don't go in `python3Packages`.
@@ -331,25 +325,27 @@ Python versions or modules, which is why they don't go in `python3Packages`.

A distinction is made between applications and libraries, however, sometimes a
package is used as both. In this case the package is added as a library to
`python-packages.nix` and as an application to `all-packages.nix`. To reduce
`python-packages.nix` and as an application to `pkgs/by-name`. To reduce
duplication the `toPythonApplication` can be used to convert a library to an
application.

The Nix expression shall use [`buildPythonPackage`](#buildpythonpackage-function) and be called from
`python-packages.nix`. A reference shall be created from `all-packages.nix` to
`python-packages.nix`. A reference shall be created from `pkgs/by-name` to
the attribute in `python-packages.nix`, and the `toPythonApplication` shall be
applied to the reference:

```nix
{
  youtube-dl = with python3Packages; toPythonApplication youtube-dl;
}
  python3Packages,
}:

python3Packages.toPythonApplication python3Packages.youtube-dl
```

#### `toPythonModule` function {#topythonmodule-function}

In some cases, such as bindings, a package is created using
[`stdenv.mkDerivation`](#sec-using-stdenv) and added as attribute in `all-packages.nix`. The Python
[`stdenv.mkDerivation`](#sec-using-stdenv) and added as attribute in `pkgs/by-name` or in `all-packages.nix`. The Python
bindings should be made available from `python-packages.nix`. The
`toPythonModule` function takes a derivation and makes certain Python-specific
modifications.
+4 −0
Original line number Diff line number Diff line
@@ -77,6 +77,10 @@
        }).nixos.manual;
      };

      devShells = forAllSystems (system: {
        default = import ./shell.nix { inherit system; };
      });

      # The "legacy" in `legacyPackages` doesn't imply that the packages exposed
      # through this attribute are "legacy" packages. Instead, `legacyPackages`
      # is used here as a substitute attribute name for `packages`. The problem
+14 −0
Original line number Diff line number Diff line
@@ -2544,6 +2544,13 @@
    githubId = 410028;
    name = "Tobias Bergkvist";
  };
  berquist = {
    name = "Eric Berquist";
    email = "eric.berquist@gmail.com";
    github = "berquist";
    githubId = 727571;
    keys = [ { fingerprint = "AAD4 3B70 A504 9675 CFC8  B101 BAFD 205D 5FA2 B329"; } ];
  };
  berryp = {
    email = "berryphillips@gmail.com";
    github = "berryp";
@@ -16685,6 +16692,13 @@
    githubId = 23097564;
    name = "Nora Widdecke";
  };
  pwnwriter = {
    name = "Nabeen Tiwaree";
    email = "hey@pwnwriter.xyz";
    keys = [ { fingerprint = "B681 763F 9B5B DF27 9A13  9E0C 0544 A89B C519 20AA"; } ];
    github = "pwnwriter";
    githubId = 90331517;
  };
  pwoelfel = {
    name = "Philipp Woelfel";
    email = "philipp.woelfel@gmail.com";
+2 −2
Original line number Diff line number Diff line
@@ -65,8 +65,8 @@ rec {
      client1.wait_for_x()
      client2.wait_for_x()

      client1.execute("quake3 +set r_fullscreen 0 +set name Foo +connect server &")
      client2.execute("quake3 +set r_fullscreen 0 +set name Bar +connect server &")
      client1.execute("quake3 +set r_fullscreen 0 +set name Foo +connect server >&2 &", check_return = False)
      client2.execute("quake3 +set r_fullscreen 0 +set name Bar +connect server >&2 &", check_return = False)

      server.wait_until_succeeds("grep -q 'Foo.*entered the game' /tmp/log")
      server.wait_until_succeeds("grep -q 'Bar.*entered the game' /tmp/log")
Loading