nixpkgs/pkgs/by-name
nixpkgs-merge-bot[bot] 7d0551855b
Merge pull request #331012 from r-ryantm/auto-update/maa-assistant-arknights
maa-assistant-arknights: 5.4.1 -> 5.5.0
2024-07-30 17:33:30 +00:00
..
_0/_0xpropo
_2/_2ship2harkinian pkgs/by-name: remove unused arguments 2024-07-26 10:11:07 +02:00
_4 treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
_6/_64gram
_9/_9base
a4/a4
a5/a52dec
aa
ab
ac
ad
ae aerc: remove excess quotes 2024-07-30 10:25:16 +12:00
af pkgs/by-name: remove unused arguments 2024-07-26 10:11:07 +02:00
ag agate: 3.3.7 → 3.3.8 2024-07-26 23:49:37 +04:00
ai
al pkgs/by-name: remove unused arguments 2024-07-26 10:11:07 +02:00
am pkgs/by-name: remove unused arguments 2024-07-26 10:11:07 +02:00
an ananicy-cpp: make bpf support optional 2024-07-28 01:16:48 +05:30
ao/aocl-utils
ap pkgs/by-name: remove unused arguments 2024-07-26 10:11:07 +02:00
aq/aquamarine
ar Merge pull request #324545 from paparodeo/treewide-strict-deps-fixes 2024-07-27 22:19:23 +03:00
as
at pkgs/by-name: remove unused arguments 2024-07-26 10:11:07 +02:00
au Merge remote-tracking branch 'origin/master' into staging-next 2024-07-26 18:05:04 +02:00
av
aw
ax
ay
az azure-cli-extensions.oracle-database: init at 1.0.0b1 2024-07-29 11:22:55 -03:00
b3/b3sum
ba balls: init 5.4.0 2024-07-29 16:54:23 +00:00
bc
bd
be treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
bi bitwarden-cli: 2024.6.1 -> 2024.7.1 2024-07-29 12:51:55 -07:00
bk/bk
bl Merge remote-tracking branch 'origin/master' into staging-next 2024-07-26 18:05:04 +02:00
bm/bmake
bn/bngblaster
bo speechd: introduce minimal variant, use it everywhere 2024-07-26 15:48:11 +03:00
bp bpftop: 0.5.1 -> 0.5.2 2024-07-29 12:41:09 +00:00
bq/bqn
br
bs bsd-finger: adopt and refactor 2024-07-29 23:22:01 -03:00
bt pkgs/by-name: remove unused arguments 2024-07-26 10:11:07 +02:00
bu
by
c-
c2
ca Merge pull request #326497 from getchoo/pkgs/cartridges/search-provider 2024-07-29 00:36:51 +02:00
cb
cc
cd
ce treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
cg
ch
ci
cj/cjs cjs: fix cross compilation, set strictDeps 2024-07-27 15:47:48 -04:00
cl treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
cm
cn/cntb
co coc-diagnostic: migrate from nodePackages 2024-07-29 01:17:33 -04:00
cp
cq/cq
cr treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
cs
ct/ctx
cu treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
cv/cvemap
cy
cz/czkawka
da
db
dc
dd
de Merge pull request #329589 from BirdeeHub/updateDepTree 2024-07-30 17:14:20 +02:00
dg/dgoss
dh/dhcpig
di Merge branch 'master' into staging-next 2024-07-27 09:18:58 +02:00
dj/djent
dm
dn
do Merge pull request #330518 from khaneliman/dooit 2024-07-30 10:49:59 +02:00
dp pkgs/by-name: remove unused arguments 2024-07-26 10:11:07 +02:00
dr Merge pull request #219942 from vsharathchandra/druid_nix_module 2024-07-28 11:02:06 +02:00
ds
dt
du dust: 1.1.0 -> 1.1.1 2024-07-26 22:03:13 +00:00
dv/dvb-apps
dx
dy
e1/e1s
ea
eb
ec
ed Merge remote-tracking branch 'origin/master' into staging-next 2024-07-26 18:05:04 +02:00
ee/eepers
ef/efibootmgr
ei treewide: remove unused lib (and other) arguments 2024-07-26 11:18:09 +02:00
ej/ejsonkms
ek/eksctl
el Merge remote-tracking branch 'origin/master' into staging-next 2024-07-26 18:05:04 +02:00
em
en
eo/eog
ep
er
es
et pkgs/by-name: remove unused arguments 2024-07-26 10:11:07 +02:00
eu
ev
ew/eww
ex ext4fuse: init at 0.1.3 2024-07-27 23:21:01 +02:00
ey/eyewitness pkgs/by-name: remove unused arguments 2024-07-26 10:11:07 +02:00
ez/eza
f2/f2fs-tools
fa Merge pull request #330664 from Mic92/empty-with 2024-07-29 15:01:57 +08:00
fb/fbset
fc
fe fedimint: 0.3.2 -> 0.3.3 2024-07-26 11:20:45 +00:00
ff treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
fg/fgqcanvas treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
fi pkgs/by-name: remove unused arguments 2024-07-26 10:11:07 +02:00
fj/fjo
fl flexget: add missing dependency 2024-07-29 00:15:18 -07:00
fm
fn/fnott
fo pkgs/by-name: remove unused arguments 2024-07-26 10:11:07 +02:00
fr treewide: remove viric from meta.maintainers [no orphans] 2024-07-28 10:47:12 -03:00
fs
ft/fte
fu
fv
fw/fwupd fwupd: 1.9.21 -> 1.9.22 2024-07-27 12:28:34 +02:00
fx/fx
fy/fypp
fz fzf: 0.54.1 -> 0.54.2 2024-07-27 19:36:15 +02:00
g3/g3kb-switch
ga gapless: add aleksana to maintainers 2024-07-26 16:53:13 +02:00
gb
gc
gd
ge geoserver: migrate to by-name 2024-07-26 21:12:29 +04:00
gf pkgs/by-name: remove unused arguments 2024-07-26 10:11:07 +02:00
gg/gg
gh ghciwatch: 1.0.0 -> 1.0.1 2024-07-28 08:30:37 +00:00
gi gitu: 0.23.0 -> 0.23.1 2024-07-28 20:05:34 +00:00
gl
gm
gn treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
go google-chrome: add changelog link to make it easier for reviewers 2024-07-28 23:37:37 +05:30
gp Merge remote-tracking branch 'origin/master' into staging-next 2024-07-26 18:05:04 +02:00
gr Merge pull request #326577 from arikgrahl/move-to-by-name-hierarchy 2024-07-26 00:21:24 +02:00
gt
gu
gv/gvisor
gx/gxml
h2/h2
h5/h5utils
h8/h8mail
ha Merge pull request #312213 from onemoresuza/hare-refactor-cross-comp-tests 2024-07-28 23:40:44 +02:00
hb/hb-honeypot
hd
he pkgs/by-name: remove unused arguments 2024-07-26 10:11:07 +02:00
hi treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
hj/hjson-go
hn/hn-text
ho
hp/hpp2plantuml
ht treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
hu
hv/hvm
hy
i2/i2p
i3
ia
ic
id
if/ifrextractor-rs
ig
ii
ij/ijhttp
im Merge pull request #323501 from eclairevoyant/imhex-fix 2024-07-29 07:40:53 +02:00
in treewide: remove trailing space in description 2024-07-26 03:38:50 +02:00
io pkgs/by-name: remove unused arguments 2024-07-26 10:11:07 +02:00
ip treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
ir treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
is treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
it pkgs/by-name: remove unused arguments 2024-07-26 10:11:07 +02:00
iv/iverilog
iw/iw
iz/izrss
ja treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
jd/jdt-language-server
je
ji
jj/jj
jn pkgs/by-name: remove unused arguments 2024-07-26 10:11:07 +02:00
jo
jq/jq-zsh-plugin
jr/jrl-cmakemodules
js
jt/jtdx
ju
jw/jwasm
ka kanidm: allow dead code warnings 2024-07-26 10:20:16 +03:00
kc kcl,kclvm,kclvm_cli: remove darwin.cctools 2024-07-26 08:28:21 +00:00
kd
ke
kg/kgeotag
ki
kl
km
kn
ko koboldcpp: add separator to the prefix option of makeWrapper 2024-07-26 08:14:13 +08:00
kp/kplex
kr
ks
kt treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
ku
kv/kvmarwaita
kx
ky
la lan-mouse: 0.8.0 -> 0.9.1 2024-07-30 13:13:33 +02:00
lb
lc
ld ld64: fix cross-compilation install check phase 2024-07-29 21:24:13 -04:00
le lexical: 0.6.1 -> 0.7.0 2024-07-28 22:53:40 +02:00
lg/lgogdownloader
li treewide: normalize maintainers list formatting 2024-07-30 16:26:22 +02:00
lk/lk-jwt-service
ll Merge pull request #326131 from nwhirschfeld/lldap-cli 2024-07-28 22:40:10 +02:00
lm treewide: remove unused lib (and other) arguments 2024-07-26 11:18:09 +02:00
ln/lngen
lo treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
lp treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
ls
lt/ltris
lu
lv/lv_font_conv
lw/lwgrp
lx
lz
m1/m1ddc
m2
ma Merge pull request #331012 from r-ryantm/auto-update/maa-assistant-arknights 2024-07-30 17:33:30 +00:00
mb
mc
md mdbook-alerts: 0.6.0 -> 0.6.1 2024-07-29 22:35:01 +00:00
me meson.meta.maintainers: add myself 2024-07-29 11:26:10 +02:00
mf pkgs/by-name: remove unused arguments 2024-07-26 10:11:07 +02:00
mg
mi miracle-wm: 0.2.1 -> 0.3.0 2024-07-29 15:19:47 +02:00
mk
ml/mlx42
mo treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
mp
mq
mr/mricron
ms
mu
my
n2/n2
n8/n8n
na Merge pull request #329768 from r-ryantm/auto-update/narsil 2024-07-25 18:46:29 -04:00
nb treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
nc Merge pull request #326174 from t4ccer/t4/sratoolkit-3.1.1 2024-07-29 21:16:34 +02:00
nd/ndstrim
ne treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
nf
ng
nh treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
ni Merge remote-tracking branch 'origin/master' into staging-next 2024-07-26 18:05:04 +02:00
nl
nm
nn
no
np
nr nrr: 0.9.3 -> 0.9.4 2024-07-27 07:40:17 +00:00
ns
nt
nu Merge pull request #326742 from r-ryantm/auto-update/nuclei-templates 2024-07-26 21:08:51 +02:00
nv pkgs/by-name: remove unused arguments 2024-07-26 10:11:07 +02:00
nw nwg-panel: 0.9.34 -> 0.9.36 2024-07-27 18:18:14 +00:00
nx/nxengine-evo
oa
ob obj-magic: init at unstable-2020-09-20 (#306627) 2024-07-28 22:33:37 +02:00
oc treewide: remove trailing space in description 2024-07-26 03:38:50 +02:00
od
oe/oelint-adv
of offat: 0.18.0 -> 0.19.1 2024-07-28 04:44:27 +00:00
oh treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
oi
ok/okolors
ol ollama: 0.3.0 -> 0.3.1 2024-07-30 06:35:18 -04:00
om
on Merge pull request #324301 from leon-erd/drop_onlyoffice_7.2.0 2024-07-26 21:37:52 +02:00
oo pkgs/by-name: remove unused arguments 2024-07-26 10:11:07 +02:00
op Merge pull request #329122 from r-ryantm/auto-update/openvas-scanner 2024-07-28 23:59:34 +02:00
or speechd: introduce minimal variant, use it everywhere 2024-07-26 15:48:11 +03:00
os
ot
ou
ov
ow
pa Merge pull request #330772 from r-ryantm/auto-update/parallel-disk-usage 2024-07-29 15:07:12 -04:00
pc
pd Merge remote-tracking branch 'origin/master' into staging-next 2024-07-26 18:05:04 +02:00
pe treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
pf/pfft
pg treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
ph phpunit: 11.2.7 -> 11.2.8 2024-07-26 19:50:11 +00:00
pi pizauth: 1.0.4 -> 1.0.5 2024-07-29 12:41:19 +00:00
pk
pl plasmusic-toolbar: 1.3.0 -> 1.4.0 2024-07-29 07:09:36 +00:00
pm
pn
po treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
pp/ppsspp
pq
pr Merge pull request #330731 from Shawn8901/update_proton 2024-07-29 13:42:05 +02:00
ps
pt
pu pupdate: 3.10.3 -> 3.11.0 2024-07-27 14:50:37 +00:00
pv
pw pkgs/by-name: remove unused arguments 2024-07-26 10:11:07 +02:00
px/pxder
py pyright: 1.1.370 -> 1.1.373 2024-07-26 21:37:24 +00:00
pz/pzip
qa/qadwaitadecorations
qb/qbittorrent-enhanced
qc/qcm
qd
qg/qgrep
qn/qnial
qo/qodem
qp/qpoases
qr
qs
qt/qtractor
qu Merge pull request #316404 from odygrd/quill_init 2024-07-29 16:40:24 +02:00
qw/qwerty-fr
r0/r0vm
r1/r10k
ra Merge pull request #330357 from gador/radicle-httpd-0.15.0 2024-07-30 09:35:41 +02:00
rc
rd/rdwatool
re Merge pull request #330675 from r-ryantm/auto-update/regols 2024-07-29 15:33:46 -04:00
rh/rHttp
ri river: 0.3.4 -> 0.3.5 2024-07-30 08:02:48 -04:00
rk
rl/rl_json
rm rmpc: init at 0.2.1 2024-07-27 20:28:19 -04:00
rn rnote: 0.10.2 -> 0.11.0 2024-07-26 14:42:53 -07:00
ro roslyn-ls: 4.10.0-2.24124.2 -> 4.12.0-1.24359.11 2024-07-29 18:17:45 +02:00
rp/rpcs3
rq
rs pkgs/by-name: remove unused arguments 2024-07-26 10:11:07 +02:00
rt
ru
rw/rwpspread
ry
s0/s0ix-selftest-tool
s3
sa satty: 0.13.0 -> 0.14.0 2024-07-29 05:52:30 +00:00
sb
sc {scenefx,swayfx-unwrapped}: depend on wlroots_0_17 2024-07-29 15:26:27 +08:00
sd treewide: remove unused lib (and other) arguments 2024-07-26 11:18:09 +02:00
se treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
sf/sfwbar
sg/sgfutils
sh
si
sk Merge pull request #330575 from r-ryantm/auto-update/skypilot 2024-07-29 15:37:56 -04:00
sl
sm Merge pull request #330378 from Aleksanaa/smile 2024-07-28 10:58:00 +02:00
sn pkgs/by-name: remove unused arguments 2024-07-26 10:11:07 +02:00
so
sp treewide: remove unused lib (and other) arguments 2024-07-26 11:18:09 +02:00
sq sqlite-vss: mark broken 2024-07-27 19:51:14 +00:00
sr Merge pull request #326174 from t4ccer/t4/sratoolkit-3.1.1 2024-07-29 21:16:34 +02:00
ss Merge pull request #329929 from flohessling/fix-sessionmanagerplugin-build 2024-07-29 23:55:44 +02:00
st Merge pull request #329241 from r-ryantm/auto-update/stu 2024-07-29 08:41:45 +02:00
su
sv treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
sw {scenefx,swayfx-unwrapped}: depend on wlroots_0_17 2024-07-29 15:26:27 +08:00
sx
sy syndicate_utils: 20231130 -> 20240509 2024-07-29 13:58:39 +00:00
t-/t-rex
ta Merge pull request #320800 from xanderio/tailscale-gitops-pusher 2024-07-28 23:22:49 +02:00
tb/tbump
tc/tcsh
td
te Merge pull request #330579 from r-ryantm/auto-update/tenv 2024-07-28 10:43:11 -04:00
tg
th treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
ti Merge pull request #330841 from soopyc/tiny-dfr 2024-07-29 22:11:13 +05:30
tk
tl tlrc: 1.9.2 -> 1.9.3 2024-07-29 15:35:31 +02:00
tm
to Merge pull request #327803 from Sigmanificient/toolong 2024-07-27 10:17:28 +09:00
tp
tr trrntzip: remove TheBrainScrambler as maintainer 2024-07-30 10:59:53 +02:00
ts/tsm-client
tt ttf-indic: init at 0.2 2024-07-26 19:03:45 +09:00
tu Merge remote-tracking branch 'origin/master' into staging-next 2024-07-26 18:05:04 +02:00
tw
tx/txr
ty
ub ubuntu-sans-mono: 1.004 -> 1.006 2024-07-28 04:07:34 +00:00
uc treewide: remove unused lib (and other) arguments 2024-07-26 11:18:09 +02:00
ud
ue
ug
uh/uhttpmock_1_0
ui
um/umpire
un treewide: remove viric from meta.maintainers [no orphans] 2024-07-28 10:47:12 -03:00
up
ur/urban-cli
us ustr: remove overuse of with lib; 2024-07-26 01:20:06 +02:00
ut
uu/uuu
uv/uv
uw uwsm: also wrap sway and hyprland's paths 2024-07-29 19:10:46 +05:30
ux uxn: 1.0-unstable-2024-06-15 -> 1.0-unstable-2024-07-26 2024-07-26 21:29:29 +00:00
va Merge pull request #329794 from ThePuzzlemaker/add-vatprism 2024-07-28 12:15:11 +05:30
vc Merge pull request #329033 from Jayman2000/fix-317553 2024-07-28 21:44:55 +02:00
vd/vdhcoapp
ve
vg/vgm2x
vi Merge pull request #330042 from Sigmanificient/remove-leading-space-description 2024-07-26 23:48:02 +08:00
vk/vkd3d
vl
vm
vn
vo
vp
vs/vscode-js-debug
vu
vv/vvvvvv treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
vw/vwsfriend
vz/vzic
wa Merge remote-tracking branch 'origin/master' into staging-next 2024-07-26 18:05:04 +02:00
wb
wc/wcurl
we
wf/wf-touch
wg/wg-access-server
wh
wi wiremock: 3.8.0 -> 3.9.1 2024-07-27 18:47:54 +00:00
wl Merge remote-tracking branch 'origin/master' into staging-next 2024-07-26 18:05:04 +02:00
wo
wp
wr/wrangler
ws
wt
wv wvdial: init at unstable-2016-06-15 2024-07-27 19:11:02 +03:00
wx/wxc
wy/wyoming-satellite
x1/x16
x5/x509-limbo Merge pull request #330042 from Sigmanificient/remove-leading-space-description 2024-07-26 23:48:02 +08:00
xa
xc
xd
xe xeve: Link libm into shared library 2024-07-29 13:30:49 +02:00
xf/xfs-undelete
xh/xhosts
xi xilinx-bootgen: move to pkgs/by-name 2024-07-29 08:53:06 -07:00
xl
xm treewide: fix some comments (#330407) 2024-07-27 22:05:18 +08:00
xn/xnlinkfinder
xo
xp
xr
xs
xu/xunit-viewer
xv/xviewer
xw
ya yazi-unwrapped: auto update version, build date & hash 2024-07-28 13:06:52 +01:00
yc/ycmd
yd/ydotool
ye treewide: remove unused lib (and other) arguments 2024-07-26 11:18:09 +02:00
yg/yggdrasil
yj/yj
yo
ys/ysfx
yt yt-dlp: add curl impersonation support 2024-07-26 09:32:23 -04:00
yu pkgs/by-name: remove unused arguments 2024-07-26 10:11:07 +02:00
za pkgs/by-name: remove unused arguments 2024-07-26 10:11:07 +02:00
zb/zbus-xmlgen
zc/zcfan
ze zed-editor: 0.144.4 -> 0.145.1 2024-07-28 14:05:10 +02:00
zf/zfind
zi
zl/zluda
zm/zmkBATx
zo
zp
zs
zu/zug pkgs/by-name: remove unused arguments 2024-07-26 10:11:07 +02:00
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.

  1. 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.

  2. Manual migrations should only be lightly encouraged if the relevant code is being worked on anyways. For example with a package update or refactoring.

  3. 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 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-check-by-name tool.

You can locally emulate the CI check using

$ ./maintainers/scripts/check-by-name.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;
}