nixpkgs/pkgs/by-name
2024-12-06 10:12:01 +00:00
..
_0
_1
_2
_3
_4
_5/_5etools
_6
_7
_9
a2
a4/a4
a5/a52dec
aa
ab
ac act: 0.2.68 -> 0.2.70 2024-12-05 11:25:43 +09:00
ad
ae
af treewide: replace --enable-wayland-ime with --enable-wayland-ime=true for the arguments to properly work (#361341) 2024-12-05 00:06:22 +05:30
ag
ah
ai
aj/aj-snapshot
ak/akira-unstable
al alt-tab-macos: 7.4.0 -> 7.7.0 (#361890) 2024-12-05 09:29:21 -05:00
am
an angular-language-server: 18.2.0 -> 19.0.3 (#360805) 2024-12-05 09:58:31 +01:00
ao/aocl-utils
ap
aq
ar argocd: 2.12.6 -> 2.13.1; add fish completions (#358264) 2024-12-06 09:51:38 +08:00
as treewide: adopt/co-maintain some packages (#355700) 2024-12-05 09:29:28 +01:00
at
au auto-editor: init at 25.3.0 (#317557) 2024-12-05 21:21:38 +08:00
av
aw
ax
ay
az
b3/b3sum
b4
b6/b612
ba basex: 11.4 -> 11.6 2024-12-06 06:52:50 +01:00
bb
bc
bd
be beedii: init at 1.0.0 (#349097) 2024-12-06 09:38:08 +08:00
bf
bg
bi bitbox: init at 4.46.3 (#267064) 2024-12-05 13:24:19 +08:00
bj/bjumblr
bk
bl blendfarm: update to net8, apply upstream fixes (#359357) 2024-12-05 10:44:58 +08:00
bm
bn/bngblaster
bo
bp
bq
br treewide: replace --enable-wayland-ime with --enable-wayland-ime=true for the arguments to properly work (#361341) 2024-12-05 00:06:22 +05:30
bs
bt
bu butt: 1.42.0 -> 1.44.0 (#362013) 2024-12-05 20:40:20 -08:00
bv
bw
by
bz/bzrtp
c2
c3
c6/c64-debugger
c-
ca cargo-sort: 1.0.9 -> 1.1.0 2024-12-06 10:12:01 +00:00
cb
cc
cd
ce
cf
cg
ch treewide: replace --enable-wayland-ime with --enable-wayland-ime=true for the arguments to properly work (#361341) 2024-12-05 00:06:22 +05:30
ci treewide: replace --enable-wayland-ime with --enable-wayland-ime=true for the arguments to properly work (#361341) 2024-12-05 00:06:22 +05:30
cj
ck
cl clash-rs: 0.7.1 -> 0.7.3 (#359917) 2024-12-06 13:47:19 +08:00
cm
cn treewide: adopt/co-maintain some packages (#355700) 2024-12-05 09:29:28 +01:00
co copacetic: init at 0.9.0 2024-12-05 19:05:32 -06:00
cp
cq/cq
cr treewide: adopt/co-maintain some packages (#355700) 2024-12-05 09:29:28 +01:00
cs
ct
cu
cv
cw
cx
cy
cz
d2
d-
da
db dbip-{country,city,asn}-lite: 2024-11 -> 2024-12 (#360890) 2024-12-04 10:06:18 -05:00
dc dclock: init at 0.1.0 2024-12-04 13:30:55 -07:00
dd
de dependency-track: 4.12.1 -> 4.12.2 (#361783) 2024-12-05 09:06:46 -05:00
df
dg
dh
di digikam: add conditional cmake flag for cudaSupport (#356596) 2024-12-04 23:05:23 -06:00
dj
dk
dl
dm
dn
do docker-init: init at v1.30.0 (#356191) 2024-12-05 18:49:59 +01:00
dp dprint: add shell completions 2024-12-06 10:43:06 +09:00
dq
dr
ds
dt
du treewide: adopt/co-maintain some packages (#355700) 2024-12-05 09:29:28 +01:00
dv
dw
dx
dy
dz/dzen2
e1
e2
ea
eb
ec
ed
ee/eepers
ef
eg
ei
ej
ek
el element-call: 0.6.3 -> 0.7.1 (#361044) 2024-12-05 18:01:25 +01:00
em
en enkei: init at 0.9.3 (#233095) 2024-12-05 02:38:02 +01:00
eo
ep
eq treewide: replace --enable-wayland-ime with --enable-wayland-ime=true for the arguments to properly work (#361341) 2024-12-05 00:06:22 +05:30
er treewide: adopt/co-maintain some packages (#355700) 2024-12-05 09:29:28 +01:00
es
et
eu
ev
ew
ex expr: update repository owner 2024-12-05 14:06:39 +09:00
ey
ez eza: 0.20.10 -> 0.20.11 2024-12-05 12:03:09 +01:00
f1
f2
f3/f3
f5/f5_6
fa famistudio: remove with lib; 2024-12-04 21:14:15 +01:00
fb
fc
fd
fe tiddit: init at 3.6.1 (#312995) 2024-12-05 15:50:06 +08:00
ff
fg
fh
fi treewide: replace --enable-wayland-ime with --enable-wayland-ime=true for the arguments to properly work (#361341) 2024-12-05 00:06:22 +05:30
fj/fjo
fl flake-checker: 0.2.0 -> 0.2.1 (#362074) 2024-12-05 20:36:51 -08:00
fm
fn
fo forgejo.updateScript: fix the regex escape (#361871) 2024-12-04 19:23:07 -05:00
fp
fq/fq
fr free42: 3.1.8 -> 3.1.10 (#361219) 2024-12-06 01:45:51 +00:00
fs
ft
fu
fv
fw
fx
fy
fz
g1/g15daemon
g2/g203-led
g3/g3kb-switch
g8/g810-led
g9/g933-utils
g-/g-wrap
ga
gb
gc
gd
ge treewide: expose pname and version in some more packages (#361250) 2024-12-04 23:07:23 +00:00
gf treewide: replace --enable-wayland-ime with --enable-wayland-ime=true for the arguments to properly work (#361341) 2024-12-05 00:06:22 +05:30
gg
gh
gi git-open: 3.0.0 -> 3.1.0 (#362111) 2024-12-05 20:35:59 -08:00
gj
gk/gk-cli
gl
gm
gn gnome-online-accounts-gtk: 3.50.4 -> 3.50.5 2024-12-06 01:40:48 +00:00
go google-alloydb-auth-proxy: init at 1.11.3 (#357420) 2024-12-05 15:51:20 +01:00
gp
gq gqmqtt: init at 0.2.0-alpha (#360312) 2024-12-05 17:04:58 -05:00
gr graphene-hardened-malloc: add updateScript (#360468) 2024-12-05 18:13:03 -05:00
gs
gt
gu
gv
gw
gx
gy
gz
h2
h5/h5utils
h8/h8mail
ha handbrake: 1.8.2 -> 1.9.0 2024-12-05 17:11:57 +01:00
hb
hc hck: 0.10.1 -> 0.11.0 2024-12-04 20:30:42 +00:00
hd
he
hf
hh
hi hiddify-app: 2.5.7-unstable-2024-10-30 -> 2.5.7-unstable-2024-11-18 (#360605) 2024-12-05 19:33:51 +08:00
hj/hjson-go
hl/hledger-check-fancyassertions
hm
hn
ho
hp
hq/hqplayerd
hr
hs
ht treewide: replace --enable-wayland-ime with --enable-wayland-ime=true for the arguments to properly work (#361341) 2024-12-05 00:06:22 +05:30
hu hugo: enable doCheck with skipping failing tests 2024-12-05 15:22:20 +09:00
hv/hvm
hw
hx/hxtools
hy hyprlauncher: 0.2.2 -> 0.2.7 (#360940) 2024-12-05 17:14:25 +08:00
i2
i3
i8/i810switch
i-/i-dot-ming
ia
ib
ic
id
if
ig
ih/ihp-new
ii
ij
ik
il
im
in intel-gmmlib: 22.5.2 -> 22.5.4 2024-12-05 10:48:18 +00:00
io
ip
iq
ir
is
it treewide: replace --enable-wayland-ime with --enable-wayland-ime=true for the arguments to properly work (#361341) 2024-12-05 00:06:22 +05:30
iu/iucode-tool
iv
iw
ix/ix
iz/izrss
j/j
j4/j4-dmenu-desktop
ja jazz2: 2.9.1 -> 3.0.0 (#360909) 2024-12-05 18:35:58 -05:00
jb
jc
jd
je
jf
jg/jgmenu
jh
ji treewide: replace --enable-wayland-ime with --enable-wayland-ime=true for the arguments to properly work (#361341) 2024-12-05 00:06:22 +05:30
jj/jj
jm
jn
jo joplin-desktop: fix unpacking on x86_64-darwin with 7zz (#361912) 2024-12-05 23:53:56 +01:00
jp
jq jq-lsp: 0.1.4 -> 0.1.9 2024-12-05 08:46:31 +00:00
jr
js
jt
ju
jw
jx
jy/jython
k0/k0sctl
k2
k3
k4/k40-whisperer
k6/k6
k8
k9/k9s
ka treewide: replace --enable-wayland-ime with --enable-wayland-ime=true for the arguments to properly work (#361341) 2024-12-05 00:06:22 +05:30
kb
kc
kd
ke
kf/kfilt
kg/kgeotag
kh
ki kind: 0.2.4 -> 0.2.5 (#355534) 2024-12-06 13:12:43 +08:00
kl
km
kn
ko kopia: add shell completion scripts (#360216) 2024-12-06 13:31:10 +08:00
kp
kr
ks
kt
ku kuttl: 0.19.0 -> 0.20.0 (#361906) 2024-12-04 19:44:09 -05:00
kv
kw
kx
ky
l2/l2md
la treewide: adopt/co-maintain some packages (#355700) 2024-12-05 09:29:28 +01:00
lb
lc
ld
le treewide: replace --enable-wayland-ime with --enable-wayland-ime=true for the arguments to properly work (#361341) 2024-12-05 00:06:22 +05:30
lf/lftp
lg
lh
li libdeltachat: 1.151.2 -> 1.151.4 (#361551) 2024-12-04 17:22:45 -08:00
lk
ll
lm
ln
lo logrotate: disable acl on non-Linux platforms (#283483) 2024-12-06 08:21:17 +08:00
lp
lr
ls
lt
lu lunacy: 10.0.1 -> 10.9.0 2024-12-05 08:45:22 +00:00
lv
lw
lx treewide: replace --enable-wayland-ime with --enable-wayland-ime=true for the arguments to properly work (#361341) 2024-12-05 00:06:22 +05:30
ly lynx: 2.9.0dev.12 -> 2.9.2 2024-12-05 20:12:41 +00:00
lz
m1
m2
m3/m33-linux
m4
m8/m8c m8c: init at 1.7.8 2024-12-05 15:07:01 +07:00
m-/m-cli
ma mailspring: 1.13.3 -> 1.14.0 (#361876) 2024-12-06 11:11:23 +08:00
mb
mc mchprs: remove unused clang from build closure 2024-12-06 08:56:13 +08:00
md
me
mf
mg
mh/mhddfs
mi minimal-grub-theme: init at 0.3.0 (#361311) 2024-12-06 11:02:38 +08:00
mj
mk
ml
mm
mn
mo
mp
mq treewide: replace --enable-wayland-ime with --enable-wayland-ime=true for the arguments to properly work (#361341) 2024-12-05 00:06:22 +05:30
mr
ms msgraph-cli: init a 1.9.0 (#314619) 2024-12-05 10:11:49 +01:00
mt
mu treewide: adopt/co-maintain some packages (#355700) 2024-12-05 09:29:28 +01:00
mv
mw/mw
mx
my
n2
n3/n3
n8/n8n
n9
na nanopb: 0.4.9 -> 0.4.9.1 2024-12-05 10:03:54 +00:00
nb
nc
nd ndcurves: init at 1.4.1 (#347703) 2024-12-05 13:22:16 +08:00
ne nexttrace: build with go 1.22 to fix darwin build (#352581) 2024-12-05 12:34:18 +08:00
nf
ng
nh
ni nimdow: 0.7.39 -> 0.7.40 (#361989) 2024-12-05 09:41:24 -05:00
nj/njam
nk
nl
nm
nn
no
np
nq
nr
ns
nt
nu
nv
nw
nx
ny
nz
oa
ob treewide: replace --enable-wayland-ime with --enable-wayland-ime=true for the arguments to properly work (#361341) 2024-12-05 00:06:22 +05:30
oc
od
oe
of
og ogen: init at 1.4.1 (#335762) 2024-12-04 20:49:54 +08:00
oh oh-my-posh: 23.20.3 -> 24.11.4 2024-12-05 19:18:53 +00:00
oi
ok
ol
om
on oneanime: init at 1.3.6 2024-12-06 00:41:54 +08:00
oo
op openseeface: init at 1.20.4-unstable-2024-09-21 (#289617) 2024-12-05 22:06:15 +02:00
oq
or
os
ot
ou
ov
ow
ox
p0/p0f
p1/p11-kit
p2/p2pool
p3/p3x-onenote
p4/p4d
p9/p910nd
pa treewide: replace --enable-wayland-ime with --enable-wayland-ime=true for the arguments to properly work (#361341) 2024-12-05 00:06:22 +05:30
pb
pc
pd pdfium-binaries: 6721 -> 6872 (#359931) 2024-12-05 18:27:19 -05:00
pe
pf
pg
ph photoqt: 4.6 -> 4.7 (#361171) 2024-12-05 03:11:51 +01:00
pi
pk
pl plasticity: 24.2.4 -> 24.2.6 (#357411) 2024-12-05 08:34:32 +01:00
pm
pn
po treewide: replace --enable-wayland-ime with --enable-wayland-ime=true for the arguments to properly work (#361341) 2024-12-05 00:06:22 +05:30
pp
pq
pr prometheus-libvirt-exporter: init at 2.3.3 and add the prometheus module (#283985) 2024-12-05 03:25:25 +01:00
ps
pt ptyxis: 47.4 -> 47.5 2024-12-05 11:48:53 +00:00
pu
pv pv: 1.8.14 -> 1.9.7 2024-12-05 12:14:57 +00:00
pw
px
py
pz/pzip
q2/q2pro
q-/q-text-as-data
qa
qb
qc
qd
qe
qg
qh qhexedit2: init at 0.8.9 2024-12-05 09:59:29 -08:00
qi/qidi-slicer-bin
qm
qn/qnial
qo
qp
qq treewide: replace --enable-wayland-ime with --enable-wayland-ime=true for the arguments to properly work (#361341) 2024-12-05 00:06:22 +05:30
qr
qs
qt
qu
qw/qwerty-fr
r0/r0vm
r1
r2 treewide: replace --enable-wayland-ime with --enable-wayland-ime=true for the arguments to properly work (#361341) 2024-12-05 00:06:22 +05:30
r5/r53-ddns
ra raycast: 1.86.0 -> 1.87.2 2024-12-04 22:04:15 +00:00
rb
rc
rd
re resources: 1.6.0 -> 1.7.0 (#362143) 2024-12-06 10:48:03 +08:00
rf
rg
rh
ri ripasso-cursive: cosmetic changes (#361736) 2024-12-05 00:39:19 +01:00
rk
rl
rm
rn
ro roslyn-ls: 4.12.0-3.24470.4 -> 4.13.0-3.24577.4 (#357963) 2024-12-05 09:39:42 -04:00
rp rpPPPoE: 3.12 -> 4.0 (#349480) 2024-12-05 16:02:51 +02:00
rq
rr
rs
rt
ru rustfinity: init at 0.2.13 (#360239) 2024-12-05 16:23:05 +08:00
rv/rvvm
rw
rx
ry
rz/rzip
s0/s0ix-selftest-tool
s2
s3
s4/s4cmd
s5
s7/s7
s9/s9fes
s-
sa sakura: 3.8.7 -> 3.8.8 2024-12-05 06:14:16 +00:00
sb
sc Revert "scarab: remove nuget patch" 2024-12-05 11:43:32 -04:00
sd
se treewide: adopt/co-maintain some packages (#355700) 2024-12-05 09:29:28 +01:00
sf
sg
sh
si treewide: replace --enable-wayland-ime with --enable-wayland-ime=true for the arguments to properly work (#361341) 2024-12-05 00:06:22 +05:30
sj/sjasmplus
sk
sl
sm smug: 0.3.5 -> 0.3.6 2024-12-05 04:04:53 +00:00
sn
so soundsource: 5.7.3 -> 5.7.4, quote paths, refactor meta (#361892) 2024-12-05 09:28:25 -05:00
sp sptlrx: 1.1.0 -> 1.2.2 (#360405) 2024-12-05 17:36:16 -05:00
sq
sr
ss
st stylua: 0.20.0 -> 2.0.1 2024-12-06 15:08:42 +10:00
su subread: 2.0.7 -> 2.0.8 (#361977) 2024-12-06 11:45:04 +11:00
sv
sw
sx
sy
sz
t1
t4/t4kcommon
t-/t-rex
ta tailscale: 1.78.0 -> 1.78.1 2024-12-05 20:58:43 -05:00
tb
tc
td
te termshot: 0.2.8 -> 0.2.12 (#361852) 2024-12-05 16:30:41 +01:00
tf
tg tgt: 1.0.93 -> 1.0.94 2024-12-04 16:42:39 +00:00
th
ti timeular: 6.8.4 -> 6.8.5 (#362029) 2024-12-05 09:50:10 -05:00
tk
tl
tm
tn
to
tp treewide: remove unused {lib,}clang from more build closures (#361298) 2024-12-06 10:21:43 +08:00
tq/tqsl
tr traccar: init at 6.5 (#354732) 2024-12-05 08:56:33 +01:00
ts
tt ttfb: 1.13.0 -> 1.14.0 2024-12-05 07:55:10 +00:00
tu turbo: 2.3.0 -> 2.3.3 2024-12-04 19:37:54 -05:00
tv
tw
tx
ty typstyle: 0.12.6 -> 0.12.7 2024-12-05 01:14:08 +01:00
tz
u0/u001-font
u2/u2ps
u3/u3-tool
u9/u9fs
u-
ua
ub
uc
ud
ue
uf
ug
uh treewide: replace --enable-wayland-ime with --enable-wayland-ime=true for the arguments to properly work (#361341) 2024-12-05 00:06:22 +05:30
ui
uk/ukmm
ul
um
un unnamed-sdvx-clone: init at 0.6.0 (#345325) 2024-12-04 22:37:04 +02:00
up dotnet: improve buildDotnetGlobalTool (#361464) 2024-12-04 23:16:16 -06:00
uq
ur urh: 2.9.6 -> 2.9.8; install desktop file (#357930) 2024-12-05 16:35:56 +08:00
us
ut
uu
uv
uw
ux
v2
v4/v4l2-relayd
va
vb
vc
vd
ve treewide: replace --enable-wayland-ime with --enable-wayland-ime=true for the arguments to properly work (#361341) 2024-12-05 00:06:22 +05:30
vf/vfkit
vg
vh
vi
vk
vl
vm
vn
vo
vp
vr
vs
vt
vu
vv
vw
vx/vxl
vy
vz/vzic
w3/w3m
w_
wa warp-terminal: 0.2024.11.19.08.02.stable_01 -> 0.2024.11.19.08.02.stable_03 (#359940) 2024-12-04 16:43:43 -05:00
wb
wc
wd
we nodePackages.webpack-cli: drop; webpack-cli: init at 5.1.4 (#361616) 2024-12-05 00:34:16 -08:00
wf
wg wgpu-native: init at 22.1.0.5 2024-12-05 13:16:31 +01:00
wh
wi wikiman: init at 2.13.2 (#359410) 2024-12-05 21:19:31 +08:00
wk/wkhtmltopdf
wl
wm
wo wordbook: unstable-2022-11-02 -> 0.4.0 (#361748) 2024-12-05 19:31:52 +08:00
wp
wq
wr
ws
wt
wu
wv
ww/wwcd
wx
wy
x1
x2
x3/x3270
x4
x8/x86info
x-/x-create-mouse-void
xa xapp: 2.8.6 -> 2.8.7 2024-12-05 12:39:57 +00:00
xb
xc
xd
xe xed-editor: 3.6.7 -> 3.6.9 (#361791) 2024-12-05 09:05:45 -05:00
xf
xg
xh
xi
xj
xk
xl
xm
xn
xo
xp
xq
xr xreader: 4.2.2 -> 4.2.3 2024-12-05 12:35:10 +00:00
xs
xt
xu
xv
xw
xx
xy/xylib
xz
ya
yc/ycmd
yd
ye
yg
yj/yj
yl/yle-dl
ym
yo
yp/ypbind-mt
yq/yq-go
ys/ysfx
yt ytdl-sub: relax yt-dlp dependency (#361694) 2024-12-05 21:32:26 +08:00
yu
yx/yx
yy/yyjson
z8/z88dk
z-/z-lua
za zapret: 67 -> 69.5 2024-12-04 17:02:53 +03:00
zb
zc
zd
ze treewide: remove unused {lib,}clang from more build closures (#361298) 2024-12-06 10:21:43 +08:00
zf
zg
zi
zk
zl
zm
zn
zo treewide: expose pname and version in some more packages (#361250) 2024-12-04 23:07:23 +00:00
zp
zr
zs
zt
zu treewide: replace --enable-wayland-ime with --enable-wayland-ime=true for the arguments to properly work (#361341) 2024-12-05 00:06:22 +05:30
zv/zvbi
zw/zwave-js-server
zx
zy/zydis
zz
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 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, 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.

Definitions like the following however, can be transitioned:

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

  • 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;
}