nixpkgs/pkgs/by-name
Pol Dellaiera e6136044a9
Merge pull request #302825 from drupol/typstyle/bump/0-11-12
typstyle: 0.11.11 -> 0.11.12
2024-04-09 19:14:50 +02:00
..
_4/_4th
_6/_64gram _64gram: 1.1.15 -> 1.1.16 2024-04-04 16:18:34 +05:30
_9/_9base
a4/a4
a5/a52dec
aa
ab/aba
ac
ad adwsteamgtk: 0.6.9 -> 0.6.10 2024-03-30 02:17:10 +00:00
ae
af
ag/ags
ai
al alt-tab-macos: 6.66.0 -> 6.68.0 2024-04-05 22:47:16 +03:00
am amphetype: fix qt wrapping 2024-04-06 09:14:49 +02:00
an annextimelog: 0.5.0 -> 0.13.1 2024-04-07 09:20:18 +02:00
ao/aocl-utils
ap Merge pull request #293890 from sarcasticadmin/init-aprx 2024-03-30 23:29:44 +01:00
ar ark-pixel-font: 2023.11.26 -> 2024.04.05 2024-04-08 19:17:53 +02:00
as ast-grep: 0.20.2 -> 0.20.3 2024-04-08 06:44:36 +00:00
at athens: 0.13.1 -> 0.13.2 2024-04-02 14:50:47 +02:00
au Merge pull request #301865 from Aleksanaa/wrapGAppsHook4-fix 2024-04-07 11:12:48 +08:00
av
aw
ax/axmldec
ay
ba bat: skip file_with_invalid_utf8_filename test 2024-04-01 22:45:34 -05:00
bc/bc-ur
be bee: fix version 2024-04-01 19:35:50 +02:00
bi
bk/bk
bl bluetuith: 0.2.1 -> 0.2.2 2024-04-07 11:31:51 +00:00
bm/bmake
bn/bngblaster bngblaster: 0.8.39 -> 0.8.44 2024-03-29 19:28:17 +00:00
bo boxbuddy: 2.2.0 -> 2.2.2 2024-04-04 21:47:14 +00:00
bp/bpftop bpftop: 0.3.0 -> 0.4.0 2024-03-27 20:10:11 +00:00
br
bs bstone: init at 1.2.12 2024-04-05 12:53:51 -05:00
bt/bt-migrate
bu buckle: init at 1.1.0 2024-04-06 20:26:31 -05:00
by
c-
c2 Merge pull request #292020 from ok-nick/c2patool 2024-04-09 14:34:47 +02:00
ca Merge pull request #302673 from r-ryantm/auto-update/cargo-expand 2024-04-08 22:40:24 +00:00
cb
cc/ccache
cd
ce Merge pull request #302678 from r-ryantm/auto-update/centrifugo 2024-04-08 21:29:41 -04:00
cg
ch
ci
cl clipcat: 0.16.4 -> 0.16.5 2024-04-06 12:31:08 +00:00
cm
cn/cntb
co codeium: 1.8.16 -> 1.8.22 2024-04-06 11:01:06 +02:00
cp
cr crunchy-cli: 3.3.1 -> 3.3.4 2024-04-05 05:11:38 +00:00
cs csvkit: 1.4.0 -> 1.5.0 2024-04-03 10:26:52 +00:00
ct/ctx
cu cue: 0.8.0 -> 0.8.1 2024-04-03 12:38:59 +00:00
cv/cvemap cvemap: init at 0.0.6 2024-03-30 23:01:15 +01:00
cy
cz/czkawka
da daytona-bin: add meta.platforms 2024-04-04 21:20:11 +02:00
db/dbus-cpp
dc/dc3dd
dd
de devenv: 1.0.2 -> 1.0.3 2024-04-05 06:06:19 +01:00
dg/dgoss
dh/dhcpig dhcpig: init at 1.6 2024-04-03 20:56:51 +01:00
di dissent: 0.0.22 -> 0.0.23 2024-04-05 02:26:29 +00:00
dj/djent
dm
dn/dns2tcp
do Merge pull request #301200 from r-ryantm/auto-update/dotslash 2024-04-09 15:01:20 +02:00
dp/dpp
dr/drone-scp
ds dstep: init at 1.0.4 2024-04-06 20:48:30 +02:00
dt/dtcmp
du
dv/dvb-apps
dx
dy dynamodb-local: add java.naming module for JRE 2024-03-28 21:44:09 +01:00
ea/easyeasm
eb
ec
ed
ei
ek/eksctl
el
em
en
ep/epub-thumbnailer epub-thumbnailer: 0-unstable-2024-03-16 -> 0-unstable-2024-03-26 2024-04-03 13:31:55 +02:00
er treewide: replace wrapGAppsHook with wrapGAppsHook4 for gtk4 apps 2024-04-06 01:33:38 +08:00
es
et etlegacy: fix .desktop files 2024-04-07 09:52:04 +02:00
eu
ex
ez/eza
fa fantomas: 6.3.0 -> 6.3.1 2024-04-02 11:55:44 +02:00
fb/fbset
fc
fe
ff
fi files-cli: 2.12.46 -> 2.12.54 2024-04-05 13:52:24 +00:00
fl Merge pull request #299177 from Rucadi/flatito 2024-04-03 08:38:17 +02:00
fm
fn/fnott
fo folio: 24.09 -> 24.10 2024-04-05 03:22:29 +00:00
fr Francis: init at 1.1.0 (#298182) 2024-04-09 23:37:20 +08:00
fs
fu/fuchsia-cursor
fv fvwm3: refactor 2024-03-31 16:10:52 -03:00
fw/fwupd fwupd: 1.9.15 -> 1.9.16 2024-04-06 17:10:59 +02:00
fy/fypp
fz/fzf-make fzf-make: migrate to by-name 2024-04-03 18:05:07 +02:00
g3/g3kb-switch
ga Merge pull request #299566 from getchoo/pkgs/garnet/init 2024-04-09 19:24:18 +08:00
gb/gbar
gc treewide: remove explicit -trimpath from Go pkgs 2024-03-28 07:57:19 +01:00
ge
gf gfal2-util, python3Packages.gfal2-util: init at 1.8.1 2024-04-04 07:18:29 +08:00
gg/gg
gh Merge pull request #301263 from loicreynier/gh-f-make-standalone 2024-04-03 23:46:03 +08:00
gi git-gr: 1.2.1 -> 1.4.1 2024-04-06 19:54:59 -07:00
gl glas: 0.2.2 -> 0.2.3 2024-04-04 13:05:53 +05:30
gm
gn
go Merge pull request #301865 from Aleksanaa/wrapGAppsHook4-fix 2024-04-07 11:12:48 +08:00
gp Merge pull request #292338 from arduano/arduano/gpustat 2024-04-07 11:10:45 +08:00
gr
gt treewide: remove explicit -trimpath from Go pkgs 2024-03-28 07:57:19 +01:00
gu
gv/gvisor gvisor: 20240311.0-unstable-2024-03-25 -> 20240401.0 2024-04-07 23:14:54 +02:00
gx/gxml
h8/h8mail
ha Merge pull request #283881 from apraga/hap-py-0.3.15 2024-04-08 10:28:01 +02:00
hd/hdrop
he fix: editorconfig compliance 2024-04-07 08:19:07 +02:00
hi hidden-bar: init at 1.9 2024-04-06 15:38:55 +03:00
hj/hjson-go
ho home-manager: unstable-2024-03-31 -> unstable-2024-04-06 2024-04-07 04:20:12 +00:00
ht httpdirfs: move to pkgs/by-name 2024-03-30 17:34:47 +01:00
hu hujsonfmt: init at 0-unstable-2022-12-23 2024-04-05 20:36:33 -04:00
hy Merge pull request #283262 from bddvlpr/hyprland-monitor-attached/init 2024-04-09 23:58:24 +08:00
i3
ia
ic
id ida-free: init at 8.4.240320 2024-03-31 13:11:49 +02:00
if/ifrextractor-rs
ig igir: 2.6.1 -> 2.6.2 2024-04-07 13:02:05 +00:00
ii
im
in Merge pull request #301712 from adamcstephens/incus/6 2024-04-08 23:25:58 -04:00
io/ioq3-scion
ip
ir/ironbar
it
ja Merge pull request #299377 from khaneliman/updateScripts 2024-04-05 17:35:57 -07:00
jd/jdt-language-server
je jetbrains-toolbox: move to pkgs/by-name 2024-04-02 21:15:08 +02:00
ji
jj/jj
jn jnv: 0.1.3 -> 0.2.1 2024-04-02 07:04:14 +00:00
jo
js/jsoncons
ju
ka kakoune-lsp: 15.0.1 -> 16.0.0 2024-04-01 03:27:28 +02:00
kc
kd/kdsingleapplication
ke
kg/kgeotag
ki
kl/klog-time-tracker
km Merge pull request #292303 from Vinetos/add-kmeet 2024-03-29 10:07:56 +01:00
kn/knossosnet
ko Merge pull request #301090 from ByteSudoer/init-koji 2024-04-09 01:17:43 +08:00
kp/kplex
kr Merge pull request #285177 from lelgenio/krita-plugin-gmic-package 2024-04-07 21:42:25 +02:00
ks kshutdown: init at 5.91-beta 2024-04-02 11:39:56 -07:00
kt
ku
kx/kxstitch
ky/kyverno-chainsaw
la labwc-tweaks: unstable-2024-01-04 -> unstable-2024-04-02 2024-04-04 09:35:22 +00:00
lb
lc/lcab
ld/ldproxy ldproxy: init at 0.31.4 2024-04-07 16:49:59 +08:00
le Merge pull request #300942 from r-ryantm/auto-update/lefthook 2024-04-06 03:28:34 +02:00
li maintainers: add johnrtitor 2024-04-09 00:50:00 +05:30
ll llama-cpp: 2568 -> 2589 2024-04-04 15:32:57 +00:00
lm/lmstudio lmstudio: init at 0.2.18 2024-03-28 19:30:20 +01:00
ln/lngen
lo Merge pull request #302350 from ck3d/localai-config-cuda 2024-04-07 21:12:36 +00:00
lp
ls
lt/ltris
lu lubelogger: 1.2.8 -> 1.2.9 2024-03-29 15:09:18 +00:00
lw/lwgrp
lx lxd: rename to lxd-lts 2024-04-02 19:35:44 -04:00
lz
m2
ma maa-assistant-arknights: correct license metadata 2024-04-08 20:39:37 +02:00
mb mbusd: migrate to by-name 2024-03-29 16:01:45 +04:00
mc
md
me Merge pull request #300271 from devhell/bump-mediainfo 2024-04-04 04:29:18 +08:00
mf
mg/mgitstatus
mi Merge pull request #302744 from r-ryantm/auto-update/minijinja 2024-04-09 09:17:15 +02:00
mk
ml/mlx42
mo monophony: 2.7.0 -> 2.8.2 2024-04-04 16:32:09 +00:00
mp/mpifileutils
mq
ms
mu
my mystmd: 1.1.50 -> 1.1.52 2024-04-08 23:16:44 +00:00
n2/n2
na naps2: mark as broken on aarch64 2024-04-07 11:02:32 +03:00
nb/nbtscan
nc
nd/ndstrim
ne Merge pull request #281278 from Moraxyc/nezha-agent 2024-04-06 12:35:07 +02:00
nf/nfft
ng/ngrid ngrid: init at 0.1.0 2024-04-05 21:18:52 -04:00
nh
ni nim_lk: 20231031 -> 20240210 2024-04-02 08:59:07 +00:00
nl
nm/nmap-parse
nn/nncp
no
np
nr
ns
nt/ntfs2btrfs
nu nuclei-templates: init at 9.8.0 2024-03-31 13:29:20 +02:00
nv nvidia-container-toolkit: use autoAddDriverRunpath 2024-03-30 10:14:14 -07:00
nw nwg-hello: 0.1.8 -> 0.1.9 2024-04-08 11:54:53 +00:00
oa
ob
oc nixos/ocis: init at 5.0.0 2024-04-03 00:53:24 +05:30
oe/oelint-adv
of offat: init at 0.16.0 2024-04-01 21:03:18 +02:00
oh/oh-my-fish
oi
ol/olvid
om/omniorbpy
on Merge master into staging-next 2024-03-31 12:01:07 +00:00
op licenses: rename apsl{10,20} -> apple-psl{10,20} 2024-04-08 20:39:37 +02:00
or orchard: 0.15.2 -> 0.16.0 2024-04-04 13:29:43 +00:00
os
ot oterm: 0.2.4 -> 0.2.5 2024-04-02 19:41:32 +00:00
ou
ov
ow
pa Merge pull request #265409 from 8aed/patch-init-passt 2024-04-08 21:53:43 +02:00
pd tbb: 2021.8.0 -> 2021.11.0 (#301391) 2024-04-05 17:36:37 +02:00
pe pest: 2.34.5 -> 2.34.7 2024-04-05 12:30:43 +02:00
pf/pfft
pg pgmoneta: 0.10.0 -> 0.10.1 2024-04-05 16:24:36 +00:00
ph phpunit: 11.1.0 -> 11.1.1 2024-04-07 19:30:56 +02:00
pi pingme: init at 0.2.6 2024-04-02 12:33:50 +11:00
pk/pkcrack
pl Merge pull request #298556 from kachick/init-plemoljp-font 2024-04-04 08:37:15 +11:00
pm
pn
po pot: 2.7.4 -> 2.7.9 2024-03-29 16:59:48 +08:00
pp/ppsspp
pq
pr Merge pull request #302315 from mweinelt/django-countries-7.6 2024-04-08 21:28:16 +02:00
pt
pu pupdate: 3.9.1 -> 3.10.1 2024-04-08 02:56:22 +02:00
pv/pvsneslib pvsneslib: init at 4.2.0 2024-04-01 17:22:36 +02:00
pw pwndbg: 2022.12.19 -> 2024.02.14 2024-04-08 09:57:49 +02:00
px/pxder
py pyprland: 2.1.1 -> 2.1.4 2024-04-04 11:35:38 +01:00
pz/pzip
qa/qadwaitadecorations
qc/qcm
qd/qdirstat
qg/qgrep
qr qrtool: 0.10.6 -> 0.10.7 2024-04-09 03:27:42 +00:00
qs
qt/qtractor
qu quarkus: 3.9.1 -> 3.9.2 2024-04-07 14:16:23 +00:00
ra rabbit: 1.0.1 -> 1.0.2 2024-04-07 14:03:31 +00:00
rc rcu: init at 2024.001n 2024-03-28 09:46:37 +01:00
rd/rdwatool
re redict: init at 7.3.0 (#300049) 2024-04-09 12:58:08 +02:00
ri
rk/rkbin
rl/rl_json
rm rmenu: init at 1.2.0 2024-04-03 18:09:53 +02:00
rn/rnd-name
ro rockcraft: 1.2.2 -> 1.2.3 2024-04-07 13:56:58 +00:00
rp/rpcs3 rpcs3: 0.0.29-15726-ebf48800e -> 0.0.31-16271-4ecf8ecd0 2024-03-31 10:42:18 +10:00
rq/rqbit rqbit: 5.5.4 -> 5.6.0 2024-04-07 04:20:00 +00:00
rs rst2html5: use nixfmt 2024-04-04 10:49:10 +02:00
rt rtg-tools: init at 3.12.1 2024-04-02 23:20:30 +02:00
ru rustdesk-flutter: 1.2.3-unstable-2024-02-11 -> 1.2.3-2 2024-04-08 10:34:50 +02:00
rw/rwpspread rwpspread: 0.2.4 -> 0.2.5 2024-04-03 11:15:01 +00:00
ry/ryujinx ryujinx: 1.1.1242 -> 1.1.1248 2024-03-29 17:07:50 +00:00
s3
sa Merge pull request #301199 from Luflosi/update/satellite 2024-04-05 18:43:19 -05:00
sc Merge pull request #296435 from iynaix/init-scope-tui 2024-04-08 00:38:12 +08:00
sd
se Merge pull request #299618 from TomaSajt/dub-support 2024-04-04 11:52:57 +02:00
sg/sgfutils
sh shopware-cli: 0.4.33 -> 0.4.34 2024-04-08 21:10:42 +00:00
si Merge pull request #302512 from r-ryantm/auto-update/simplotask 2024-04-09 09:50:37 +04:00
sl
sm
sn sn-pro: init at 1.1.0 2024-03-31 15:20:54 -07:00
so
sp Merge pull request #300441 from aaronjheng/spirit 2024-04-06 01:32:51 +02:00
sq Merge pull request #293588 from ambroisie/bt-migrate 2024-03-28 00:48:00 +01:00
sr Merge pull request #296418 from donovanglover/srb2-cleanup 2024-04-06 21:18:37 +02:00
ss
st Merge pull request #302763 from r-ryantm/auto-update/stirling-pdf 2024-04-09 09:12:16 +02:00
su
sv
sw swaymux: 1.0 -> 1.1 2024-04-02 21:30:18 +02:00
sx
sy Merge pull request #301741 from pmiddend/syslogng-build-fix 2024-04-07 19:42:36 +00:00
t-/t-rex
ta tangerine: init at 2024-04-05 2024-04-05 11:52:53 +11:00
tc/tcsh
td/tdl
te tenv: 1.4.0 -> 1.7.0 2024-04-09 10:02:38 +00:00
tg/tgpt tgpt: 2.7.2 -> 2.7.3 2024-03-30 12:38:17 +00:00
th
ti tinymist: 0.11.1 -> 0.11.3 2024-04-07 11:50:21 +02:00
tk/tkdiff
tl tlrc: 1.9.0 -> 1.9.1 2024-03-28 21:47:17 +01:00
tm/tmuxifier
to toxic: fix license 2024-04-01 00:10:33 +02:00
tp Merge pull request #302604 from r-ryantm/auto-update/tpnote 2024-04-09 08:29:36 +02:00
tr treedome: 0.4.3 -> 0.4.5 2024-03-29 11:41:10 +07:00
tt/ttop
tu Merge pull request #300904 from ehmry/tup 2024-04-06 03:29:20 +02:00
tx/txr
ty typstyle: 0.11.11 -> 0.11.12 2024-04-09 14:52:01 +02:00
uc
ud
ue tbb: 2021.8.0 -> 2021.11.0 (#301391) 2024-04-05 17:36:37 +02:00
ug/ugrep-indexer
ui uiua: 0.10.0 -> 0.10.1 2024-04-07 22:34:22 +02:00
um/umpire
un Merge pull request #297525 from r-ryantm/auto-update/unciv 2024-03-30 18:23:21 +01:00
up updatecli: 0.74.0 -> 0.75.0 2024-04-06 22:51:58 +00:00
us/usql usql: 0.17.5 -> 0.18.1 2024-03-29 20:59:47 +01:00
ut ut1999: add aarch64_linux support 2024-03-31 19:20:10 +03:00
uu/uuu
uv/uv
uw/uwhoisd
ux/uxn uxn: unstable-2024-03-18 -> unstable-2024-03-30 2024-04-01 20:33:53 +00:00
va
vc vcpkg: 2024.03.19 -> 2024.03.25 2024-03-31 22:30:34 +00:00
ve vencord: 1.7.3 -> 1.7.4 2024-03-30 14:37:43 +01:00
vg/vgm2x
vi victoriametrics: 1.99.0 -> 1.100.0 2024-04-04 17:44:58 +00:00
vl
vu vunnel: format with nixfmt 2024-04-07 10:59:32 +02:00
vv/vvvvvv vvvvvv: move to pkgs/by-name 2024-03-29 22:43:41 +01:00
wa Merge pull request #299377 from khaneliman/updateScripts 2024-04-05 17:35:57 -07:00
wb/wb32-dfu-updater
we Merge pull request #293730 from pokon548/add-wechat-uos 2024-03-28 11:00:10 +01:00
wh where-is-my-sddm-theme: add meta.platforms 2024-04-09 11:09:59 +05:00
wi wit-bindgen: 0.23.0 -> 0.24.0 2024-04-05 04:22:13 +00:00
wl wlx-overlay-s: init at 0.3.2 2024-03-28 23:58:53 +01:00
wo workout-tracker: 0.10.5 -> 0.11.2 2024-04-07 07:29:01 +00:00
wp/wp-cli
ws Merge pull request #300320 from fabaff/wsrepl 2024-03-31 11:28:30 +02:00
wt/wtfis
wy/wyoming-satellite wyoming-satellite: init at 1.2.0 2024-03-29 03:04:43 +01:00
x1/x16 Merge pull request #300371 from r-ryantm/auto-update/x16-emulator 2024-03-31 03:04:43 +00:00
x5/x509-limbo
xa/xarcan
xc
xd
xe xeol: 0.9.13 -> 0.9.14 2024-04-05 07:36:34 +00:00
xf/xfs-undelete
xi xiu: 0.12.5 -> 0.12.6 2024-04-04 01:59:13 +00:00
xm
xo Revert "xonsh: set dontWrapPythonPrograms" 2024-04-04 13:53:29 +08:00
xp/xplr
xr/xr-hardware
xs
xw/xwayland-run
ya yazi-unwrapped: install desktop file and icon 2024-04-02 17:44:33 -04:00
yc/ycmd ycmd: Migrate to by-name 2024-03-27 22:54:49 +01:00
ye yesplaymusic: move to by-name 2024-04-01 01:15:07 +08:00
yg/yggdrasil
yj/yj
yo
ys/ysfx
yt
yu
za Merge pull request #294036 from r-ryantm/auto-update/zabbix-agent2-plugin-postgresql 2024-03-31 14:53:06 +00:00
zb/zbus-xmlgen zbus-xmlgen: 4.0.1 -> 4.1.0 2024-04-01 09:36:23 +02:00
zc/zcfan
ze zed-editor: init at 0.129.2 2024-04-04 15:54:34 +02:00
zi zircolite: refactor 2024-03-29 10:17:14 +01:00
zo/zola
zp
zs
zu/zug
zw/zwave-js-server
zx
README.md treewide: Fix all Nix ASTs in all markdown files 2024-03-28 09:28:12 +01:00

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