nixpkgs/pkgs/by-name
2024-11-07 15:37:34 -06:00
..
_0
_1
_2/_2ship2harkinian
_3/_389-ds-base
_4
_6/_64gram {kotatogram-desktop,_64gram,materialgram}: fix overriding withWebkit 2024-11-03 20:37:07 -05:00
_9
a4/a4
a5/a52dec
aa
ab
ac actionlint: 1.7.3 -> 1.7.4 (#353847) 2024-11-06 10:00:35 +01:00
ad
ae
af
ag pkgs/by-name/[ab].+: migrate to new apple sdk (#354097) 2024-11-07 05:50:23 +00:00
ai aider-chat: 0.61.0 -> 0.62.0 2024-11-05 22:53:38 -05:00
al alpaca: 2.6.5 -> 2.7.0 (#353808) 2024-11-06 19:47:38 +01:00
am treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
an pkgs/by-name/[ab].+: migrate to new apple sdk (#354097) 2024-11-07 05:50:23 +00:00
ao/aocl-utils
ap treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
aq/aquamarine
ar arrow-cpp: 17.0.0 -> 18.0.0 (#351868) 2024-11-07 16:14:20 -05:00
as asm-lsp: migrate to new apple sdk structure 2024-11-06 20:05:20 -08:00
at atuin: migrate to new darwin SDK pattern 2024-11-07 09:41:56 -08:00
au
av avalanchego: 1.11.11 -> 1.12.0-initial-poc.6 (#351441) 2024-11-07 08:21:00 -06:00
aw treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
ax
ay
az
b3/b3sum
ba bacon: migrate to new apple sdk structure 2024-11-06 20:05:20 -08:00
bc
bd
be berry: fix darwin build 2024-11-05 13:50:13 -06:00
bi bitwarden-desktop: further simplify checkPhase (#349554) 2024-11-07 14:37:53 +01:00
bk/bk
bl treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
bm
bn/bngblaster
bo bootc: 1.1.0 -> 1.1.2 2024-11-07 12:25:32 +00:00
bp
bq/bqn
br bruno: switch to apple-sdk_11 2024-11-04 16:27:05 -06:00
bs
bt
bu pkgs/by-name/[ab].+: migrate to new apple sdk (#354097) 2024-11-07 05:50:23 +00:00
by
c2
c3/c3-lsp
c-
ca treewide: use getLib when accessing clang / libclang / stdenv.cc.cc (#354197) 2024-11-07 18:16:05 +00:00
cb cbconvert: init at 1.0.4 2024-11-04 07:24:14 -06:00
cc treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
cd
ce cemu: 2.0-92 -> 2.2 2024-11-05 13:42:32 -03:00
cf
cg
ch treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
ci
cj/cjs
cl clerk: 4.0.5-unstable-2023-10-07 -> 0-unstable-2024-02-20 (#353247) 2024-11-06 15:17:48 +00:00
cm
cn
co treewide: cleanup own packages to utilize the new apple-sdk (#352699) 2024-11-07 02:22:10 +01:00
cp
cq/cq
cr
cs
ct
cu culvert: init at 0.4.0.unstable-2024-10-16 (#349150) 2024-11-07 17:21:48 +00:00
cv/cvemap
cw/cwe-client-cli
cy
cz/czkawka
da
db
dc
dd
de treewide: fix build by pinning Go 1.22 for now (#353895) 2024-11-07 11:26:28 +08:00
dg dgen-sdl: fix darwin build 2024-11-04 05:02:23 +01:00
dh/dhcpig
di dialect: 2.4.2 -> 2.5.0 (#353294) 2024-11-05 05:42:41 +01:00
dj/djent
dm
dn dnsdiag: 2.5.0 -> 2.6.0 2024-11-04 09:26:36 +01:00
do dotbot: fix build (#351656) 2024-11-04 10:06:05 +08:00
dp
dq/dq
dr
ds
dt
du duplicacy: 3.2.3 -> 3.2.4 (#353949) 2024-11-06 08:33:31 -05:00
dv
dw
dx
dy treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
e1/e1s
ea earbuds: init at 0.1.9-unstable-2024-06-28 (#351860) 2024-11-07 21:25:24 +08:00
eb
ec treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
ed edk2: 202408 -> 202408.01 2024-11-07 07:18:36 +00:00
ee/eepers
ef efmt: init at 0.18.2 (#341138) 2024-11-07 06:13:00 +11:00
eg/eg25-manager
ei
ej ejabberd: 24.07 -> 24.10; add updateScript (#352790) 2024-11-04 05:19:56 -05:00
ek
el
em empty-epsilon: 2024.06.20 -> 2024.08.09 (#353008) 2024-11-06 08:05:08 +01:00
en ente-cli: init at 0.2.2 (#343618) 2024-11-07 10:03:17 +08:00
eo/eog
ep
eq treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
er treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
es
et
eu
ev GNOME updates 2024-11-02 (#353154) 2024-11-05 20:39:01 +08:00
ew
ex
ey/eyewitness
ez/eza eza: 0.20.6 -> 0.20.7 2024-11-07 10:22:21 +01:00
f2/f2fs-tools
fa fahrplan: init at 1.1.2 (#349904) 2024-11-06 18:45:52 +08:00
fb/fbset
fc
fd/fdroidserver
fe treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
ff
fg/fgqcanvas
fi fish-lsp: init at 1.0.8-1 (#330996) 2024-11-05 08:18:47 +01:00
fj/fjo
fl florist: init at 24.2 (#350193) 2024-11-05 12:07:23 +08:00
fm
fn fna3d: init at 24.11 (#266200) 2024-11-03 09:56:18 +01:00
fo treewide: remove refs/tags/ from github release meta.changelog (#353000) 2024-11-06 22:16:20 +08:00
fp
fr fritz-exporter: add attrs to relaxed deps 2024-11-04 19:11:23 +01:00
fs
ft
fu
fv
fw/fwupd
fx/fx
fy
fz
g3/g3kb-switch
g-/g-wrap
ga garble: add passthru.updateScript; 0.8.0 -> 0.13.0; add bot-wxt1221 as maintainers 2024-11-03 17:27:15 +08:00
gb
gc
gd
ge
gf
gg/gg
gh gh-contribs: init at 0.9.0 (#352927) 2024-11-05 21:08:25 +01:00
gi git-backup-go: 1.6.0 -> 1.6.1 (#354239) 2024-11-07 13:24:31 -05:00
gk/gk-cli
gl
gm gmt: fix build (#343919) 2024-11-03 17:24:18 +01:00
gn gnome-firmware: 46.0 -> 47.0 2024-11-06 15:52:55 +01:00
go treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
gp
gr gruvbox-gtk-theme: 0-unstable-2024-10-29 -> 0-unstable-2024-11-06 (#354072) 2024-11-07 13:33:32 -05:00
gs
gt
gu treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
gv/gvisor
gw/gweled
gx
gz/gzdoom
h2/h2
h5/h5utils
h8/h8mail
ha
hb/hb-honeypot
hc/hclfmt
hd
he
hi
hj/hjson-go
hn/hn-text
ho hof: 0.6.9-beta.1 -> 0.6.9 (#346747) 2024-11-06 02:50:33 +01:00
hp
hr/hred
ht
hu
hv/hvm
hw/hwinfo
hx/hxtools
hy hyprgui: 0.1.6 -> 0.1.7 (#353308) 2024-11-04 02:33:29 +05:30
i2/i2p
i3
ia
ic icloudpd: 1.24.0 -> 1.24.3 2024-11-05 16:37:43 +00:00
id
if
ig treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
ii
ij
im immich: comment reasoning for jellyfin-ffmpeg 2024-11-03 14:43:49 +01:00
in treewide: use getLib when accessing clang / libclang / stdenv.cc.cc (#354197) 2024-11-07 18:16:05 +00:00
io
ip
ir
is treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
it it-tools: init at 2024.10.22-7ca5933 2024-11-06 00:38:38 +00:00
iu/iucode-tool
iv treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
iw
iz/izrss
j/j
ja
jc/jcli
jd/jdt-language-server
je jellyfin: 10.10.0 -> 10.10.1 2024-11-07 15:37:34 -06:00
ji
jj/jj
jn
jo
jp/jp-zip-codes
jq
jr
js
jt
ju jujutsu: 0.22.0 -> 0.23.0 2024-11-07 05:10:17 +00:00
jw/jwasm
k8
ka treewide: cleanup own packages to utilize the new apple-sdk (#352699) 2024-11-07 02:22:10 +01:00
kb/kbld
kc
kd
ke
kg/kgeotag
ki
kl
km
kn
ko treewide: remove refs/tags/ from github release meta.changelog (#353000) 2024-11-06 22:16:20 +08:00
kp/kplex
kr
ks
kt
ku
kv/kvmarwaita
kw/kwok
kx
ky kyverno-chainsaw: 0.2.8 -> 0.2.11 2024-11-05 10:45:49 -06:00
la lazysql: fix incorrect version output (#353654) 2024-11-05 12:28:16 +01:00
lb
lc
ld ld64: set Darwin team as maintainers 2024-11-04 23:01:29 +00:00
le Revert "less: Fix withSecure regression" 2024-11-04 12:00:21 +01:00
lg/lgogdownloader
li light: fetch source from gitlab (#344563) 2024-11-06 01:34:23 +01:00
lk/lk-jwt-service
ll
lm
ln/lngen
lo treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
lp
lr/lrcget
ls lsd: switch to apple-sdk_11 2024-11-05 10:46:53 +10:00
lt/ltris
lu treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
lv/lv_font_conv
lw
lx treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
lz
m1/m1ddc
m2
ma matrix-gtk-theme: 0-unstable-2024-10-29 -> 0-unstable-2024-11-06 (#354075) 2024-11-07 13:32:01 -05:00
mb
mc
md
me melos: init at 6.2.0 (#334461) 2024-11-07 21:58:07 +01:00
mf
mg
mi treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
mj/mjmap
mk
ml/mlx42
mm
mo treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
mp
mq
mr/mricron
ms treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
mt
mu mujoco: 3.2.4 -> 3.2.5 2024-11-05 12:53:22 +01:00
mv/mvt
my
n2/n2
n8/n8n
n9/n98-magerun2
na
nb
nc
nd
ne treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
nf
ng
nh
ni nightfox-gtk-theme: 0-unstable-2024-10-29 -> 0-unstable-2024-11-06 2024-11-06 20:44:17 +01:00
nl
nm
nn
no
np
nr
ns
nt
nu treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
nv
nw nwg-dock-hyprland: 0.2.2 -> 0.3.2 2024-11-07 13:40:56 +08:00
nx/nxengine-evo
ny/nym
nz
oa haskellPackages.twain: build with up to date dependencies 2024-11-03 12:48:51 +01:00
ob maintainers: remove ianmjones 2024-11-05 20:47:26 +00:00
oc
od
oe/oelint-adv
of
og/oguri
oh
oi
ok
ol
om
on
oo
op
oq/oqs-provider
or GNOME updates 2024-11-02 (#353154) 2024-11-05 20:39:01 +08:00
os
ot oterm: 0.4.2 -> 0.6.1 2024-11-03 22:14:45 +01:00
ou
ov
ow
p3/p3x-onenote
pa treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
pb/pb
pc
pd
pe performous: fix build with ffmpeg 7 2024-11-07 04:05:47 +01:00
pf
pg
ph phpactor: 2024.06.30.0 -> 2024.11.05.0 (#354051) 2024-11-07 19:49:58 +01:00
pi pik: init at 0.9.0 (#350269) 2024-11-06 18:59:00 +08:00
pk
pl treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
pm
pn
po powerpipe: 0.4.4 -> 1.0.0 (#353638) 2024-11-07 13:39:53 -05:00
pp/ppsspp ppsspp: 1.17.1 -> 1.18 2024-11-03 15:24:32 +00:00
pq
pr treewide: use getLib when accessing clang / libclang / stdenv.cc.cc (#354197) 2024-11-07 18:16:05 +00:00
ps
pt
pu treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
pv
pw
px/pxder
py treewide: cleanup own packages to utilize the new apple-sdk (#352699) 2024-11-07 02:22:10 +01:00
pz/pzip
q2/q2pro
qa/qadwaitadecorations
qb/qbittorrent-enhanced
qc/qcm
qd
qe/qemu_xen
qg
qm
qn/qnial
qo/qodem
qp/qpoases
qq/qq
qr
qs
qt
qu quick-lookup: 2.1.1 -> 2.1.2 2024-11-04 03:37:57 +00:00
qw/qwerty-fr
r0/r0vm
r1/r10k
ra treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
rc
rd/rdwatool
re recordbox: init at 0.8.3 2024-11-05 15:54:37 -05:00
rf/rfdump
rh
ri treewide: cleanup own packages to utilize the new apple-sdk (#352699) 2024-11-07 02:22:10 +01:00
rk
rl/rl_json
rm
rn
ro
rp rpiboot: add updateScript (#351604) 2024-11-06 00:06:56 +02:00
rq
rr/rrdtool
rs
rt rtorrent: Fix build on darwin 2024-11-03 19:40:15 +08:00
ru
rw/rwpspread
rx/rxvt
ry
s0/s0ix-selftest-tool
s3
s7/s7
sa sanjuuni: fix build with FFmpeg 7 (#354089) 2024-11-07 03:15:02 +00:00
sb
sc maintainers: remove ianmjones 2024-11-05 20:47:26 +00:00
sd SDL_gpu: Fix build on clang 16 2024-11-04 20:01:29 +08:00
se treewide: use getLib when accessing clang / libclang / stdenv.cc.cc (#354197) 2024-11-07 18:16:05 +00:00
sf
sg/sgfutils
sh shadps4: 0.3.0-unstable-2024-10-14 -> 0.4.0 (#352770) 2024-11-04 14:33:05 +01:00
si signalbackup-tools: 20241105-2 -> 20241106-1 2024-11-06 10:49:36 -08:00
sk treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
sl slackdump: 2.5.11 -> 2.6.0 (#354206) 2024-11-07 13:20:25 -05:00
sm
sn maintainers: remove ianmjones (#353908) 2024-11-05 23:51:15 -06:00
so solana: 1.17.31 -> 1.18.26 2024-11-03 16:06:11 +04:00
sp spacebar: move to by-name 2024-11-04 21:06:04 -06:00
sq sqruff: 0.17.0 → 0.20.2 2024-11-03 15:20:29 +01:00
sr
ss
st treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
su treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
sv treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
sw swayosd: 0-unstable-2024-04-15 -> 0.1.0 (#353591) 2024-11-06 00:39:51 +08:00
sx
sy systemd-netlogd: init at 1.4.2 2024-11-05 14:34:33 -05:00
t-/t-rex
ta tailscale: 1.76.3 -> 1.76.6 (#354112) 2024-11-06 23:45:58 -06:00
tb/tbump
tc/tcsh
td tdl: 0.17.5 -> 0.17.7 2024-11-03 22:22:04 +00:00
te
tf/tflint
tg
th
ti
tk
tl
tm
to tokyonight-gtk-theme: 0-unstable-2024-10-29 -> 0-unstable-2024-11-06 2024-11-06 20:57:52 +01:00
tp treewide: use getLib when accessing clang / libclang / stdenv.cc.cc (#354197) 2024-11-07 18:16:05 +00:00
tr treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
ts tsukimi: 0.16.7 -> 0.16.9 2024-11-06 13:39:41 +01:00
tt
tu tuxguitar: Update homepage URL (#353695) 2024-11-06 22:17:13 +08:00
tw
tx
ty treewide: remove refs/tags/ from github release meta.changelog (#353000) 2024-11-06 22:16:20 +08:00
u-
ub
uc
ud
ue
ug
uh/uhttpmock_1_0
ui
um/umpire
un Cleanup helsinki maintainer (#353611) 2024-11-04 12:59:26 +01:00
up
ur
us usql: 0.19.3 -> 0.19.12 2024-11-03 18:32:32 +01:00
ut
uu/uuu
uv/uv uv: 0.4.29 -> 0.4.30 2024-11-05 12:43:32 +01:00
uw
ux
va
vc
vd/vdhcoapp
ve treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
vf/vfkit
vg
vi video-trimmer: 0.8.2 -> 0.9.0 (#353303) 2024-11-04 09:11:57 +02:00
vk
vl
vm
vn
vo
vp
vr/vrcadvert
vs
vt/vt323
vu
vv/vvvvvv
vw/vwsfriend
vy
vz/vzic
wa treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
wb
wc
we wechat-uos: Add hidpi scale support 2024-11-06 14:46:40 +08:00
wf/wf-touch
wg
wh
wi treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
wl treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
wo woomer: init at 0.1.0 2024-11-05 16:01:55 -05:00
wp
wr
ws
wt
wu/wush
wv
wx/wxc
wy/wyoming-satellite
x1/x16
x4/x4
xa xandikos: 0.12.1 -> 0.12.2 (#352604) 2024-11-06 15:31:15 +01:00
xc
xd xdg-desktop-portal-cosmic: inline pname 2024-11-03 23:15:27 +01:00
xe
xf/xfs-undelete
xh/xhosts
xi
xl
xm
xn/xnlinkfinder
xo
xp
xr
xs
xt/xtf
xu/xunit-viewer
xv/xviewer
xw
ya treewide: use getLib when accessing clang / libclang / stdenv.cc.cc 2024-11-07 10:27:41 +00:00
yc/ycmd
yd/ydotool
ye
yg
yj/yj
yo
yp/ypbind-mt
ys/ysfx
yt ytdl-sub: 2024.10.27.post5 -> 2024.11.6 2024-11-07 19:05:08 +01:00
yu
za python3.pkgs.home-assistant-chip-*: build from source (#348149) 2024-11-07 03:37:12 +01:00
zb/zbus-xmlgen
zc
ze zellij: 0.40.1 -> 0.41.1 (#353630) 2024-11-07 21:09:22 +01:00
zf
zi zizmor: 0.1.4 -> 0.2.1 2024-11-07 14:45:46 +00:00
zl/zluda
zm/zmkBATx
zo
zp
zs
zu
zv/zvbi
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 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;
}