94259e9adf
cosmic-edit: unstable-2023-11-29 -> 0-unstable-2024-01-12 |
||
---|---|---|
.. | ||
_4/_4th | ||
_9/_9base | ||
a4/a4 | ||
aa | ||
ab/aba | ||
ac | ||
ad | ||
ae/aeron-cpp | ||
af/afterstep | ||
ai | ||
al | ||
am | ||
an | ||
ao/aocl-utils | ||
ap | ||
ar | ||
as | ||
at | ||
au | ||
av/avr-sim | ||
aw | ||
ax/axmldec | ||
ay/ayatana-indicator-messages | ||
ba | ||
bc/bc-ur | ||
be | ||
bi | ||
bk/bk | ||
bl | ||
bm/bmake | ||
bn/bngblaster | ||
bo | ||
br | ||
bu | ||
by/bytecode-viewer | ||
c2 | ||
ca | ||
cb/cbmbasic | ||
cd | ||
ce | ||
cg/cgl | ||
ch | ||
ci | ||
cl | ||
cm | ||
cn/cntb | ||
co | ||
cp | ||
cr | ||
cs | ||
ct/ctx | ||
cy | ||
cz/czkawka | ||
da/dark-mode-notify | ||
db/dbus-cpp | ||
de | ||
di | ||
dj/djent | ||
dm | ||
do | ||
dr/drone-scp | ||
dt/dtcmp | ||
du | ||
dv/dvb-apps | ||
dx | ||
dy | ||
eb/ebpf-usb | ||
ec | ||
ed/eduvpn-client | ||
ei | ||
ek/eksctl | ||
el | ||
em | ||
en | ||
er | ||
es | ||
eu | ||
ex/exiflooter | ||
ez/eza | ||
fa | ||
fc | ||
fe/feather | ||
ff | ||
fi | ||
fl | ||
fm | ||
fn/fnott | ||
fo | ||
fr | ||
ga | ||
gb/gbar | ||
gc | ||
ge | ||
gh | ||
gi | ||
gl | ||
gm/gmic | ||
go | ||
gr | ||
gt | ||
gu | ||
h8/h8mail | ||
ha | ||
hd/hdrop | ||
he | ||
hi/hifile | ||
hj/hjson-go | ||
ho | ||
ht | ||
hu/hugo | ||
hy | ||
i3 | ||
ia/ia-writer-quattro | ||
ic | ||
id/idsk | ||
if/ifrextractor-rs | ||
ig/ignite-cli | ||
ii | ||
im | ||
in | ||
ir/ironbar | ||
ja | ||
ji | ||
jj/jj | ||
jo/joycond-cemuhook | ||
ju/justbuild | ||
ka | ||
kc/kconfig-frontends | ||
kd/kdsingleapplication | ||
ke | ||
kg/kgeotag | ||
ki | ||
kl/klog-time-tracker | ||
km/kmsvnc | ||
ko | ||
ks/kseexpr | ||
kt | ||
ku | ||
kx/kxstitch | ||
la | ||
lc/lcab | ||
le | ||
li | ||
ll | ||
ln/lngen | ||
lo | ||
ls/lshw | ||
lu | ||
lw/lwgrp | ||
lx/lxd-to-incus | ||
lz/lzsa | ||
m2 | ||
ma | ||
mc | ||
me | ||
mf/mfoc-hardnested | ||
mi | ||
mk | ||
ml/mlx42 | ||
mo | ||
mp/mpifileutils | ||
ms/msolve | ||
mu | ||
my/mystmd | ||
n2/n2 | ||
na | ||
nc/ncdc | ||
ne | ||
nf/nfft | ||
nh/nh | ||
ni | ||
nl | ||
nn/nncp | ||
no | ||
np/npm-lockfile-fix | ||
nr/nrpl | ||
ns | ||
nu | ||
nv/nvidia-texture-tools | ||
nw/nwg-drawer | ||
oa | ||
ob/obs-do | ||
oc | ||
oe/oelint-adv | ||
of/offpunk | ||
oh/oh-my-fish | ||
on | ||
op | ||
or | ||
ot | ||
ou/outputcheck | ||
ov | ||
ow/owncloud-client | ||
pa | ||
pd | ||
pe | ||
pg | ||
ph | ||
pi | ||
pk/pkcrack | ||
pl | ||
pm/pmtiles | ||
po | ||
pp/ppsspp | ||
pr | ||
pt/pterm | ||
pu/pushup | ||
pw | ||
px/pxder | ||
py | ||
pz/pzip | ||
qa/qadwaitadecorations | ||
qg/qgrep | ||
qr | ||
qs/qspeakers | ||
qu | ||
ra | ||
rc | ||
re | ||
ri | ||
rm/rmg | ||
ro | ||
rp/rpcs3 | ||
rq/rqbit | ||
rs | ||
rt/rtl-sdr-osmocom | ||
ru | ||
s3/s3scanner | ||
sa | ||
sc | ||
sd | ||
se | ||
sg/sgfutils | ||
sh | ||
si | ||
sl | ||
sm | ||
sn | ||
so | ||
sp | ||
sq/sqlite-vss | ||
sr | ||
ss | ||
st | ||
su | ||
sv/svix-server | ||
sw | ||
sx | ||
sy | ||
ta | ||
tc/tcsh | ||
te | ||
th | ||
ti | ||
tk/tkdiff | ||
tl/tlrc | ||
tm/tmuxifier | ||
to/torrentstream | ||
tp | ||
tr | ||
tt/ttop | ||
tu | ||
tx/txr | ||
ty | ||
uc | ||
ud | ||
ui | ||
un | ||
up | ||
us/usql | ||
ut/ut | ||
uu/uuu | ||
ux/uxn | ||
va/valijson | ||
vc | ||
ve | ||
vg/vgm2x | ||
vi | ||
wa | ||
wb/wb32-dfu-updater | ||
we | ||
wh | ||
wi | ||
wl | ||
wo | ||
wp/wp-cli | ||
ws/wslay | ||
wt/wtfis | ||
x1/x16 | ||
xa/xarcan | ||
xd | ||
xi/xib2nib | ||
xm/xmldiff | ||
xo | ||
xp/xplr | ||
xs | ||
xw/xwayland-run | ||
ye/yeahwm | ||
yg/yggdrasil | ||
yt | ||
yu/yunfaavatar | ||
za/zapzap | ||
zb/zbus-xmlgen | ||
zc/zcfan | ||
ze/zesarux | ||
zi | ||
zo/zola | ||
zp | ||
zs/zs | ||
zu/zug | ||
zw/zwave-js-server | ||
zx | ||
README.md |
Name-based package directories
The structure of this directory maps almost directly to top-level package attributes. Add new top-level packages to Nixpkgs using this mechanism whenever possible.
Packages found in the name-based structure are automatically included, without needing to be added to all-packages.nix
. However if the implicit attribute defaults need to be changed for a package, this must still be declared in all-packages.nix
.
Example
The top-level package pkgs.some-package
may be declared by setting up this file structure:
pkgs
└── by-name
├── so
┊ ├── some-package
┊ └── package.nix
Where some-package
is the package name and so
is the lowercased 2-letter prefix of the package name.
The package.nix
may look like this:
# A function taking an attribute set as an argument
{
# Get access to top-level attributes for use as dependencies
lib,
stdenv,
libbar,
# Make this derivation configurable using `.override { enableBar = true }`
enableBar ? false,
}:
# The return value must be a derivation
stdenv.mkDerivation {
# ...
buildInputs =
lib.optional enableBar libbar;
}
You can also split up the package definition into more files in the same directory if necessary.
Once defined, the package can be built from the Nixpkgs root directory using:
nix-build -A some-package
See the general package conventions for more information on package definitions.
Changing implicit attribute defaults
The above expression is called using these arguments by default:
{
lib = pkgs.lib;
stdenv = pkgs.stdenv;
libbar = pkgs.libbar;
}
But the package might need pkgs.libbar_2
instead.
While the function could be changed to take libbar_2
directly as an argument,
this would change the .override
interface, breaking code like .override { libbar = ...; }
.
So instead it is preferable to use the same generic parameter name libbar
and override its value in pkgs/top-level/all-packages.nix
:
libfoo = callPackage ../by-name/so/some-package/package.nix {
libbar = libbar_2;
};
Manual migration guidelines
Most packages are still defined in all-packages.nix
and the category hierarchy.
Please hold off migrating your maintained packages to this directory.
-
An automated migration for the majority of packages is being worked on. In order to save on contributor and reviewer time, packages should only be migrated manually afterwards if they couldn't be migrated automatically.
-
Manual migrations should only be lightly encouraged if the relevant code is being worked on anyways. For example with a package update or refactoring.
-
Manual migrations should not remove definitions from
all-packages.nix
with custom arguments. That is a backwards-incompatible change because it changes the.override
interface. Such packages may still be moved topkgs/by-name
however, while keeping the definition inall-packages.nix
. See also changing implicit attribute defaults.
Limitations
There's some limitations as to which packages can be defined using this structure:
-
Only packages defined using
pkgs.callPackage
. This excludes packages defined usingpkgs.python3Packages.callPackage ...
.Instead:
- Either change the package definition to work with
pkgs.callPackage
. - Or use the category hierarchy.
- Either change the package definition to work with
-
Only top-level packages. This excludes packages for other package sets like
pkgs.pythonPackages.*
.Refer to the definition and documentation of the respective package set to figure out how such packages can be declared.
Validation
CI performs certain checks on the pkgs/by-name
structure.
This is done using the nixpkgs-check-by-name
tool.
You can locally emulate the CI check using
$ ./pkgs/test/nixpkgs-check-by-name/scripts/run-local.sh master
See here for more info.