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

This commit is contained in:
Silvan Mosberger 2024-10-01 01:32:33 +02:00 committed by GitHub
commit e1ca81afa8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 33 additions and 8 deletions

View File

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

View File

@ -0,0 +1,13 @@
{
lammps,
mpi,
lowPrio,
}:
lowPrio (
lammps.override {
extraBuildInputs = [
mpi
];
}
)

View File

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