Unverified Commit e1ca81af authored by Silvan Mosberger's avatar Silvan Mosberger Committed by GitHub
Browse files

doc/by-name: 2 small manual transition improvements (#342621)

parents cc12ae05 c50e9389
Loading
Loading
Loading
Loading
+20 −2
Original line number Diff line number Diff line
@@ -90,11 +90,29 @@ if package maintainers would like to use this feature, they are welcome to migra
To lessen PR traffic, they're encouraged to also perform some more general maintenance on the package in the same PR,
though this is not required and must not be expected.

Note that definitions in `all-packages.nix` with custom arguments should not be removed.
Note that `callPackage` definitions in `all-packages.nix` with custom arguments should not be removed.
That is a backwards-incompatible change because it changes the `.override` interface.
Such packages may still be moved to `pkgs/by-name` however, while keeping the definition in `all-packages.nix`.
Such packages may still be moved to `pkgs/by-name` however, in order to avoid the slightly superficial choice of directory / category in which the `default.nix` file was placed, but please keep the definition in `all-packages.nix` using `callPackage`.
See also [changing implicit attribute defaults](#changing-implicit-attribute-defaults).

Definitions like the following however, _can_ be transitioned:

```nix
# all-packages.nix
fooWithBaz = foo.override {
  bar = baz;
};
# turned into pkgs/by-name/fo/fooWithBaz/package.nix with:
{
  foo,
  baz,
}:

foo.override {
  bar = baz;
}
```

## Limitations

There's some limitations as to which packages can be defined using this structure:
+13 −0
Original line number Diff line number Diff line
{
  lammps,
  mpi,
  lowPrio,
}:

lowPrio (
  lammps.override {
    extraBuildInputs = [
      mpi
    ];
  }
)
+0 −6
Original line number Diff line number Diff line
@@ -36543,12 +36543,6 @@ with pkgs;
  dl-poly-classic-mpi = callPackage ../applications/science/molecular-dynamics/dl-poly-classic { };
  lammps-mpi = lowPrio (lammps.override {
    extraBuildInputs = [
      mpi
    ];
  });
  gromacs = callPackage ../applications/science/molecular-dynamics/gromacs {
    singlePrec = true;
    fftw = fftwSinglePrec;