nixpkgs/pkgs/by-name
2024-09-30 19:38:31 +03:00
..
_0
_1
_2/_2ship2harkinian
_4
_6/_64gram
_9
a4/a4
a5/a52dec
aa
ab
ac
ad
ae
af
ag
ai
al
am
an
ao/aocl-utils
ap
aq/aquamarine
ar
as treewide: replace passthru.optional-dependencies with optional-dependencies (#345232) 2024-09-30 15:41:25 +02:00
at
au
av
aw
ax
ay
az
b3/b3sum
ba
bc
bd
be
bi
bk/bk
bl
bm
bn/bngblaster
bo
bp
bq/bqn
br
bs
bt
bu
by
c2
c-
ca
cb
cc
cd
ce
cf/cf-tool
cg
ch
ci
cj/cjs
cl
cm
cn
co treewide: replace passthru.optional-dependencies with optional-dependencies (#345232) 2024-09-30 15:41:25 +02:00
cp
cq/cq
cr
cs
ct/ctx
cu
cv/cvemap
cw/cwe-client-cli
cy
cz/czkawka
da
db
dc
dd
de
dg
dh/dhcpig
di
dj/djent
dm
dn
do doggo: 1.0.4 -> 1.0.5 2024-09-30 12:17:56 +02:00
dp
dr
ds
dt
du
dv
dw
dx
dy
e1/e1s
ea
eb
ec
ed
ee/eepers
ef
eg/eg25-manager
ei
ej
ek
el
em
en envio: add manpage, reformat using nixfmt-rfc-style 2024-09-30 15:05:43 +02:00
eo/eog
ep
er
es
et
eu
ev
ew
ex
ey/eyewitness
ez/eza
f2/f2fs-tools
fa
fb/fbset
fc maintainers: rename oo-infty to oosquare 2024-09-30 15:35:17 +08:00
fd/fdroidserver
fe
ff
fg/fgqcanvas
fi
fj/fjo
fl
fm
fn/fnott
fo
fr
fs
ft
fu
fv
fw/fwupd
fx/fx
fy
fz
g3/g3kb-switch
ga
gb
gc
gd
ge
gf
gg/gg
gh
gi
gk/gk-cli
gl
gm
gn
go
gp
gr gren: init at 0.4.5 (#344666) 2024-09-30 17:03:40 +09:00
gt
gu
gv/gvisor
gx
gz/gzdoom
h2/h2
h5/h5utils
h8/h8mail
ha harlequin: init at 1.24.1 2024-09-30 18:37:43 +02:00
hb/hb-honeypot
hc/hclfmt
hd
he
hi
hj/hjson-go
hn/hn-text
ho
hp
hr/hred
ht
hu
hv/hvm
hw/hwinfo
hx/hxtools
hy
i2/i2p
i3
ia
ic
id
if
ig
ii
ij
im imsprog: 1.4.3 -> 1.4.4 (#343972) 2024-09-30 21:59:00 +09:00
in
io
ip
ir
is
it
iu/iucode-tool
iv
iw
iz/izrss
j/j
ja
jc/jcli
jd/jdt-language-server
je
ji
jj/jj
jn
jo
jp/jp-zip-codes
jq/jq-zsh-plugin
jr
js
jt/jtdx
ju
jw/jwasm
k8/k8s-manifest-sigstore
ka
kb/kbld
kc
kd
ke
kg/kgeotag
ki
kl
km
kn
ko
kp/kplex
kr
ks
kt
ku
kv/kvmarwaita
kw/kwok
kx
ky
la
lb
lc
ld
le
lg/lgogdownloader
li libsbml: 5.20.2 -> 5.20.4 and add python support (#344137) 2024-09-30 09:24:52 +02:00
lk/lk-jwt-service
ll
lm
ln/lngen
lo
lp
lr/lrcget
ls
lt/ltris
lu
lv/lv_font_conv
lw
lx maintainers: rename oo-infty to oosquare 2024-09-30 15:35:17 +08:00
lz
m1/m1ddc
m2
ma
mb
mc
md
me melonDS: 0.9.5-unstable-2024-09-18 -> 0.9.5-unstable-2024-09-29 2024-09-30 14:37:18 +00:00
mf
mg
mi
mk
ml/mlx42
mo mov-cli: 4.4.12 -> 4.4.14 (#344095) 2024-09-30 21:47:54 +09:00
mp
mq
mr/mricron
ms
mu
my mycelium: 0.5.4 -> 0.5.5 2024-09-30 10:33:11 +00:00
n2/n2
n8/n8n
n9/n98-magerun2
na
nb
nc
nd/ndstrim
ne
nf
ng
nh
ni
nl
nm
nn
no
np
nr
ns
nt
nu
nv
nw
nx/nxengine-evo
nz
oa
ob
oc
od
oe/oelint-adv oelint-adv: 6.0.0 -> 6.1.0, fetch source from github, enable tests 2024-09-30 09:32:00 -04:00
of
og/oguri
oh
oi
ok
ol
om
on
oo
op openjph: 0.15.0 -> 0.17.0 (#343896) 2024-09-30 22:01:12 +09:00
oq/oqs-provider
or
os
ot
ou
ov
ow
pa
pc
pd pdi: init at 1.7.1 2024-09-30 13:29:54 +02:00
pe
pf
pg
ph
pi
pk
pl plasticity: 24.2.0 -> 24.2.3 (#343862) 2024-09-30 22:07:49 +09:00
pm
pn
po
pp/ppsspp
pq
pr
ps
pt
pu
pv
pw
px/pxder
py
pz/pzip
qa/qadwaitadecorations
qb/qbittorrent-enhanced
qc/qcm
qd
qg
qm/qmplay2
qn/qnial
qo/qodem
qp/qpoases
qq/qq
qr
qs
qt
qu
qw/qwerty-fr
r0/r0vm
r1/r10k
ra
rc
rd/rdwatool
re renode-dts2repl: 0-unstable-2024-09-20 -> 0-unstable-2024-09-27 2024-09-30 09:25:47 +00:00
rf/rfdump
rh/rHttp
ri
rk
rl/rl_json
rm
rn
ro
rp
rq
rr/rrdtool
rs
rt
ru
rw/rwpspread
rx/rxvt
ry ryujinx: Include more necessary libraries 2024-09-30 15:12:53 +00:00
s0/s0ix-selftest-tool
s3
sa
sb
sc
sd
se
sf
sg/sgfutils
sh
si
sk
sl
sm
sn
so
sp
sq
sr
ss
st
su
sv
sw
sx
sy
t-/t-rex
ta
tb/tbump
tc
td
te
tg
th
ti tinymist: 0.11.20 -> 0.11.22 2024-09-30 08:45:28 +02:00
tk
tl
tm
to
tp
tr
ts
tt
tu
tw
tx
ty
u-/u-config
ub
uc
ud
ue
ug maintainers: rename oo-infty to oosquare 2024-09-30 15:35:17 +08:00
uh/uhttpmock_1_0
ui
um/umpire
un
up
ur
us
ut
uu/uuu
uv/uv
uw
ux
va
vc
vd/vdhcoapp
ve veracrypt: 1.26.7 -> 1.26.15 (#344488) 2024-09-30 13:43:57 +02:00
vf/vfkit
vg
vi
vk
vl
vm
vn
vo
vp
vr/vrcadvert
vs
vu
vv/vvvvvv
vw/vwsfriend
vz/vzic
wa
wb
wc/wcurl
we
wf/wf-touch
wg/wg-access-server
wh
wi
wl
wo
wp
wr/wrangler
ws
wt
wu/wush
wv
wx/wxc
wy/wyoming-satellite
x1/x16
x5/x509-limbo
xa
xc
xd
xe
xf/xfs-undelete
xh/xhosts
xi
xl
xm
xn/xnlinkfinder
xo
xp
xr
xs
xt/xtf
xu/xunit-viewer
xv/xviewer
xw
ya
yc/ycmd
yd/ydotool
ye
yg
yj/yj
yo
yp/ypbind-mt
ys/ysfx
yt
yu
za
zb/zbus-xmlgen
zc
ze
zf/zfind
zi
zl/zluda
zm/zmkBATx
zo
zp python312Packages.zpp, zpp: init at 1.1.0 2024-09-30 13:29:54 +02:00
zs
zu
zw/zwave-js-server
zx
zy/zydis
zz/zziplib
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 attribute name corresponding to the package, and so is the lowercase 2-letter prefix of the attribute 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. Since it would take a lot of contributor and reviewer time to migrate all packages manually, an automated migration is planned, though it is expected to still take some time to get done. If you're interested in helping out with this effort, please see this ticket.

Since only PRs to packages in pkgs/by-name can be automatically merged, if package maintainers would like to use this feature, they are welcome to migrate their packages to pkgs/by-name. 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. 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. 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 using pkgs.python3Packages.callPackage ....

    Instead:

    • Either change the package definition to work with pkgs.callPackage.
    • Or use the category hierarchy.
  • 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-vet tool.

You can locally emulate the CI check using

$ ./ci/nixpkgs-vet.sh master

See here for more info.

Recommendation for new packages with multiple versions

These checks of the pkgs/by-name structure can cause problems in combination:

  1. New top-level packages using callPackage must be defined via pkgs/by-name.
  2. Packages in pkgs/by-name cannot refer to files outside their own directory.

This means that outside pkgs/by-name, multiple already-present top-level packages can refer to some common file. If you open a PR to another instance of such a package, CI will fail check 1, but if you try to move the package to pkgs/by-name, it will fail check 2.

This is often the case for packages with multiple versions, such as

{
  foo_1 = callPackage ../tools/foo/1.nix { };
  foo_2 = callPackage ../tools/foo/2.nix { };
}

The best way to resolve this is to not use callPackage directly, such that check 1 doesn't trigger. This can be done by using inherit on a local package set:

{
  inherit
    ({
      foo_1 = callPackage ../tools/foo/1.nix { };
      foo_2 = callPackage ../tools/foo/2.nix { };
    })
    foo_1
    foo_2
    ;
}

While this may seem pointless, this can in fact help with future package set refactorings, because it establishes a clear connection between related attributes.

Further possible refactorings

This is not required, but the above solution also allows refactoring the definitions into a separate file:

{
  inherit (import ../tools/foo pkgs)
    foo_1 foo_2;
}
# pkgs/tools/foo/default.nix
pkgs: {
  foo_1 = callPackage ./1.nix { };
  foo_2 = callPackage ./2.nix { };
}

Alternatively using callPackages if callPackage isn't used underneath and you want the same .override arguments for all attributes:

{
  inherit (callPackages ../tools/foo { })
    foo_1 foo_2;
}
# pkgs/tools/foo/default.nix
{
  stdenv
}: {
  foo_1 = stdenv.mkDerivation { /* ... */ };
  foo_2 = stdenv.mkDerivation { /* ... */ };
}

Exposing the package set

This is not required, but the above solution also allows exposing the package set as an attribute:

{
  foo-versions = import ../tools/foo pkgs;
  # Or using callPackages
  # foo-versions = callPackages ../tools/foo { };

  inherit (foo-versions) foo_1 foo_2;
}