nixpkgs/pkgs/by-name
2024-07-17 19:38:41 +02:00
..
_0/_0xpropo
_2/_2ship2harkinian
_4
_6/_64gram
_9/_9base
a4/a4
a5/a52dec
aa
ab ab-av1: 0.7.15 -> 0.7.16 2024-07-13 09:34:59 +00:00
ac
ad
ae
af
ag
ai
al treewide: remove unused occurence of stdenv (and other) arguments 2024-07-14 04:32:56 +02:00
am
an ananicy-rules-cachyos: 0-unstable-2024-07-03 -> 0-unstable-2024-07-11 2024-07-16 08:13:53 +00:00
ao/aocl-utils
ap
ar Merge pull request #327081 from DontEatOreo/update-arc-browser 2024-07-15 22:03:31 +05:30
as ascii-draw: 0.3.4 -> 0.4.0 2024-07-15 17:26:00 +08:00
at atlauncher: 3.4.36.9 -> 3.4.36.10 2024-07-15 12:51:51 +04:00
au autotools-language-server: fix evaluation by using python311 2024-07-11 12:21:24 +03:00
av
aw Merge pull request #326572 from devusb/aws-sso 2024-07-14 18:28:37 +02:00
ax
ay
az azure-cli-extensions.vm-repair: 1.0.6 -> 1.0.7 2024-07-17 18:14:16 +02:00
ba basedpyright: 1.13.3 -> 1.14.0 2024-07-17 13:53:30 +02:00
bc bcachefs-tools: 1.9.2 -> 1.9.3 2024-07-15 15:12:10 -07:00
bd
be Merge pull request #327080 from Aleksanaa/fetchgit-sha256-fix 2024-07-14 20:56:04 +08:00
bi bitwarden-cli: 2024.6.1 -> 2024.7.0 2024-07-16 04:40:16 +00:00
bk/bk
bl Merge pull request #325811 from Naxdy/work/blackmagic 2024-07-15 16:41:11 +02:00
bm/bmake bmake: 20240625 -> 20240711 2024-07-15 01:03:17 +00:00
bn/bngblaster
bo
bp Merge pull request #327611 from oldshensheep/pkgs/bpftop 2024-07-16 16:56:00 -04:00
bq/bqn
br bruno: 1.20.4 -> 1.21.0 2024-07-16 11:31:47 -03:00
bs treewide: remove unused occurence of stdenv (and other) arguments 2024-07-14 04:32:56 +02:00
bt
bu budgie-desktop: passthru nixosTests.budgie 2024-07-14 15:38:11 -04:00
by
c-
c2 treewide: fix uses of repo = finalAttrs.pname 2024-07-12 20:18:43 -04:00
ca fetchCrate: sha256 -> hash 2024-07-14 13:48:13 -04:00
cb treewide: remove unused occurence of stdenv (and other) arguments 2024-07-14 04:32:56 +02:00
cc
cd
ce
cg
ch Merge pull request #327555 from r-ryantm/auto-update/chezmoi 2024-07-16 21:15:20 +00:00
ci
cl clipper2: use lib.platforms.all 2024-07-17 03:53:34 +02:00
cm
cn/cntb
co collector: init at 1.0.1 2024-07-15 21:52:27 +05:30
cp cpuinfo: 0-unstable-2024-06-02 -> 0-unstable-2024-07-10 2024-07-12 01:09:55 +00:00
cq/cq
cr
cs
ct/ctx
cu
cv/cvemap
cy
cz/czkawka
da Merge pull request #323877 from Luflosi/update/darling-dmg 2024-07-15 22:40:06 +05:30
db
dc
dd
de dediprog-sf100: init at 1.14.20.x 2024-07-16 13:14:35 +02:00
dg/dgoss
dh/dhcpig
di Merge pull request #326263 from katexochen/distribution/3-beta 2024-07-16 00:06:42 +08:00
dj/djent
dm
dn
do downonspot: unstable-2024-04-30 -> 0.5.0 2024-07-15 12:10:01 +02:00
dp
dr
ds
dt
du dub: 1.38.0 -> 1.38.1 2024-07-14 06:41:58 +00:00
dv/dvb-apps
dx
dy
e1/e1s treewide: remove unused occurence of stdenv (and other) arguments 2024-07-14 04:32:56 +02:00
ea
eb
ec treewide: sha256 -> hash attribute for gitlab.com fetchers 2024-07-13 22:28:37 +08:00
ed
ee/eepers
ef/efibootmgr
ei
ej/ejsonkms
ek/eksctl eksctl: 0.184.0 -> 0.186.0 2024-07-14 07:44:36 +00:00
el
em empty-epsilon: move to pkgs/by-name 2024-07-14 21:22:12 +02:00
en envision-unwrapped: 0-unstable-2024-06-25 -> 0-unstable-2024-07-03 2024-07-15 05:43:18 +00:00
eo/eog
ep
er
es
et
eu
ev evil-helix: 20240618 -> 20240716 2024-07-17 00:25:24 +00:00
ew/eww
ex Merge pull request #324022 from r-ryantm/auto-update/python311Packages.f3d 2024-07-12 15:02:23 +09:00
ey/eyewitness
ez/eza
f2/f2fs-tools
fa fantomas: 6.3.9 -> 6.3.10 2024-07-15 23:52:44 +02:00
fb/fbset
fc
fe
ff fflogs: 8.5.25 -> 8.6.0 2024-07-13 09:06:05 +00:00
fg/fgqcanvas
fi
fj/fjo
fl fluxcd: refactor shell completion 2024-07-15 12:03:40 -03:00
fm treewide: remove unused occurence of stdenv (and other) arguments 2024-07-14 04:32:56 +02:00
fn/fnott
fo
fr Merge pull request #326595 from squalus/freecad 2024-07-17 19:38:41 +02:00
fs
ft/fte
fu
fv
fw/fwupd
fx/fx
fy/fypp
fz
g3/g3kb-switch
ga Merge pull request #326868 from devusb/gamescopereaper 2024-07-13 22:26:28 +03:00
gb
gc
gd
ge geographiclib: migrate to by-name 2024-07-15 13:43:24 +04:00
gf
gg/gg
gh
gi Merge pull request #326274 from flandweber/gittuf-update 2024-07-15 17:16:55 +03:00
gl
gm
gn gnuastro: migrate to by-name 2024-07-17 10:52:16 +04:00
go gotenberg: init at 8.8.0 2024-07-17 10:35:57 +02:00
gp
gr grype: 0.79.2 -> 0.79.3 2024-07-16 05:20:42 +00:00
gt
gu
gv/gvisor
gx/gxml
h5/h5utils h5utils: remove more 'with lib' 2024-07-14 14:09:56 +02:00
h8/h8mail
ha Merge pull request #325334 from onemoresuza/hare-0.24.2 2024-07-16 22:48:20 +02:00
hb/hb-honeypot
hd
he Merge pull request #324795 from AkechiShiro/init-hextazy 2024-07-13 21:07:49 +02:00
hi
hj/hjson-go
hn/hn-text
ho home-manager: 0-unstable-2024-07-05 -> 0-unstable-2024-07-11 2024-07-15 10:01:53 +00:00
hp/hpp2plantuml
ht
hu humioctl: 0.35.0 -> 0.35.1 2024-07-12 07:32:44 +00:00
hv/hvm
hy hyprspace: reinit at 0.10.2 2024-07-16 09:20:50 -04:00
i2/i2p
i3 i3pystatus: applying fixes from reviews 2024-07-16 11:43:55 -03:00
ia
ic treewide: sha256 -> hash attribute for fetchgit 2024-07-14 19:10:08 +08:00
id treewide: fix uses of finalAttrs.pname in source urls 2024-07-12 20:23:39 -04:00
if/ifrextractor-rs
ig ignite-cli: 28.4.0 -> 28.5.0 2024-07-16 03:10:42 +00:00
ii
ij/ijhttp
im Merge pull request #327245 from r-ryantm/auto-update/immich-go 2024-07-16 21:36:13 +00:00
in Merge pull request #326620 from bbigras/incus 2024-07-15 14:47:18 -04:00
io ios-webkit-debug-proxy: 1.9.0 -> 1.9.1 2024-07-13 23:11:17 +03:00
ip
ir
is
it itsycal: rfc format; itsycal: add meta.changelog; ityscal: 0.15.3 -> 0.15.4 (#326327) 2024-07-13 00:08:13 +05:30
iw/iw
iz/izrss
ja
jd/jdt-language-server
je jextract-21: convert to gradle setup hook 2024-07-12 21:36:18 +07:00
ji
jj/jj
jn
jo
jq/jq-zsh-plugin
jr/jrl-cmakemodules
js
jt/jtdx
ju just: 1.30.1 -> 1.31.0 2024-07-15 23:55:59 +02:00
jw/jwasm
ka
kc
kd
ke Merge pull request #321743 from getchoo/pkgs/key-rack/init 2024-07-12 10:08:50 +08:00
kg/kgeotag
ki
kl/klog-time-tracker klog-time-tracker: 6.3 -> 6.4 2024-07-17 00:58:35 +00:00
km treewide: remove unused occurence of stdenv (and other) arguments 2024-07-14 04:32:56 +02:00
kn treewide: remove unused occurence of stdenv (and other) arguments 2024-07-14 04:32:56 +02:00
ko Merge pull request #325540 from DontEatOreo/fix-cuda-koboldcppp 2024-07-14 15:58:28 +03:00
kp/kplex
kr kryptor: init at 4.1.0 (#326334) 2024-07-16 13:43:40 +02:00
ks
kt
ku
kv/kvmarwaita
kx
ky kyverno-chainsaw: add shell completion, version test, update script 2024-07-15 12:00:39 -03:00
la lan-mouse: switch to cargoHash 2024-07-16 17:37:19 +08:00
lb
lc
ld
le Merge pull request #327767 from r-ryantm/auto-update/lexido 2024-07-17 14:43:38 +02:00
lg/lgogdownloader
li Merge pull request #327370 from arthsmn/lime3ds-update 2024-07-16 13:54:37 +02:00
lk/lk-jwt-service
ll
lm
ln/lngen
lo localsend: 1.14.0 -> 1.15.0 2024-07-16 20:49:09 +08:00
lp
ls
lt/ltris
lu lubelogger: 1.3.1 -> 1.3.5 and switch license to MIT 2024-07-11 16:05:29 -06:00
lv/lv_font_conv
lw/lwgrp
lx Merge pull request #326620 from bbigras/incus 2024-07-15 14:47:18 -04:00
lz
m1/m1ddc
m2
ma Merge pull request #325642 from emilioziniades/init-maelstrom 2024-07-17 19:19:42 +02:00
mb
mc refactor: move mcfly to by-name 2024-07-16 11:01:49 +02:00
md Merge pull request #324432 from jalil-salame/update-mdbook 2024-07-16 23:49:17 +05:30
me Merge pull request #327029 from r-ryantm/auto-update/media-downloader 2024-07-17 12:41:07 +08:00
mf treewide: remove unused finalAttrs arg 2024-07-12 21:59:02 -04:00
mg
mi misconfig-mapper: 1.6.0 -> 1.7.0 2024-07-12 21:26:50 +00:00
mk
ml/mlx42
mo treewide: sha256 -> hash attribute for fetchgit 2024-07-14 19:10:08 +08:00
mp
mq
ms
mu musikcube: 3.0.3 -> 3.0.4 2024-07-16 08:39:21 +02:00
my myks: 4.2.1 -> 4.2.2 2024-07-16 18:16:14 +00:00
n2/n2
n8/n8n
na namespace-cli: 0.0.381 -> 0.0.386 2024-07-14 06:13:50 +00:00
nb
nc Revert "nc4nix: 0-unstable-2024-03-01 -> 0-unstable-2024-05-24; nextcloudPackages: update" 2024-07-13 13:39:53 -07:00
nd/ndstrim
ne neovide: 0.13.1 -> 0.13.2 2024-07-13 14:27:32 +02:00
nf
ng
nh
ni Merge pull request #327689 from Aleksanaa/nixtract 2024-07-17 08:12:39 +02:00
nl
nm/nmap-parse
nn
no
np
nr
ns
nt
nu Merge pull request #324767 from Sigmanificient/remove-unused-stdenv-arguments 2024-07-14 19:42:52 +08:00
nv
nw
nx/nxengine-evo
oa
ob Merge pull request #327090 from SFrijters/obconf-cleanup 2024-07-15 15:38:43 +08:00
oc ocis-bin: support more architectures and add update script 2024-07-13 14:39:29 +02:00
od treewide: remove unused occurence of stdenv (and other) arguments 2024-07-14 04:32:56 +02:00
oe/oelint-adv
of
oh
oi oidc-agent: init at 5.1.0 2024-07-16 20:03:20 +08:00
ok/okolors
ol Merge pull request #327505 from redyf/update-ollama 2024-07-16 21:15:01 +02:00
om
on
oo
op Merge pull request #326745 from Tochiaha/openscap 2024-07-17 19:03:04 +02:00
or Merge pull request #325973 from kirillrdy/unpin-go 2024-07-11 22:48:10 -07:00
os ossia-score: 3.2.3-3 -> 3.2.4 2024-07-13 12:45:45 +02:00
ot
ou
ov
ow
pa Merge pull request #323958 from ByteSudoer/init-paperlib 2024-07-16 17:02:15 +02:00
pc
pd
pe Merge pull request #325138 from r-ryantm/auto-update/petsc 2024-07-15 16:47:31 +02:00
pf/pfft
pg
ph phpunit: 11.2.6 -> 11.2.7 2024-07-16 21:51:40 +00:00
pi picocrypt-cli: init at 2.04 (#326360) 2024-07-16 13:42:37 +02:00
pk
pl Merge pull request #323397 from detroyejr/plex-desktop 2024-07-17 18:47:28 +02:00
pm
pn
po Merge pull request #318015 from doronbehar/pkg/yarnConfigHook 2024-07-12 09:45:26 +03:00
pp/ppsspp
pq
pr Merge pull request #290452 from flandweber/borgmatic-exporter 2024-07-17 19:08:28 +02:00
ps pshs: 0.3.4 -> 0.4.3 2024-07-12 00:33:38 +01:00
pt ptyxis: 46.4 -> 46.5 2024-07-13 15:13:44 +08:00
pu
pv/pvsneslib
pw pwru: 1.0.6 -> 1.0.7, fix build 2024-07-12 18:38:38 +02:00
px/pxder
py pysqlrecon: 0.1.4 -> 0.2.0 2024-07-15 11:23:02 +00:00
pz/pzip
qa/qadwaitadecorations
qb/qbittorrent-enhanced
qc/qcm
qd
qg/qgrep
qn/qnial qnial: 6.3 -> 6.3_1 2024-07-15 14:49:03 -03:00
qo/qodem qodem: add patches 2024-07-12 00:33:38 +01:00
qp/qpoases
qr treewide: remove unused occurence of stdenv (and other) arguments 2024-07-14 04:32:56 +02:00
qs
qt/qtractor
qu
qw/qwerty-fr
r0/r0vm r0vm: 1.0.1 -> 1.0.2 2024-07-13 06:18:59 +00:00
r1/r10k
ra Merge pull request #314440 from ju1m/radicle 2024-07-17 13:04:06 +02:00
rc
rd/rdwatool
re regal: 0.23.1 -> 0.24.0 2024-07-17 06:05:54 +00:00
rh/rHttp
ri ringing-lib: init at 0-unstable-2024-05-31 (#210560) 2024-07-13 23:49:00 +05:30
rk
rl/rl_json
rm
rn/rnd-name
ro Merge pull request #327000 from r-ryantm/auto-update/roddhjav-apparmor-rules 2024-07-14 19:54:04 +05:30
rp/rpcs3
rq
rs treewide: remove unused occurence of stdenv (and other) arguments 2024-07-14 04:32:56 +02:00
rt
ru
rw/rwpspread
ry
s0/s0ix-selftest-tool
s3
sa saunafs: 4.2.0 -> 4.3.0 2024-07-16 16:36:19 +00:00
sb
sc scope-tui: add aleksana to maintainers 2024-07-16 17:00:40 +08:00
sd SDL2_image_2_6: migrate to by-name 2024-07-13 07:22:09 -03:00
se Merge pull request #326683 from eclairevoyant/pname-misuse-pt-1 2024-07-13 09:23:16 +02:00
sf/sfwbar
sg/sgfutils
sh shoutrrr: init at 0.8.0 2024-07-16 20:12:58 +01:00
si siyuan: 3.0.11 -> 3.1.0 2024-07-14 20:11:37 +02:00
sk Merge pull request #326128 from andresilva/spotify-skype-snap-yaml 2024-07-13 18:01:58 +02:00
sl
sm
sn Merge pull request #327379 from thiagokokada/snes9x-bump 2024-07-15 18:07:51 +01:00
so sonarr: 4.0.5.1710 -> 4.0.7.1863 2024-07-15 18:30:50 +00:00
sp Merge pull request #326670 from getchoo/pkgs/spotifyd/adopt 2024-07-16 09:58:26 +05:30
sq
sr
ss
st Merge pull request #327148 from DontEatOreo/update-stats 2024-07-15 22:05:05 +05:30
su surrealdb: 1.5.3 -> 1.5.4 2024-07-12 23:12:04 +02:00
sv
sw Merge pull request #326827 from Aleksanaa/trivial-sha256-fix 2024-07-14 22:40:25 +08:00
sx
sy syft: 1.8.0 -> 1.9.0 2024-07-13 07:09:37 +00:00
t-/t-rex
ta Merge pull request #327841 from r-ryantm/auto-update/tabiew 2024-07-17 14:53:57 +02:00
tb/tbump
tc/tcsh
td tdnf: 3.5.7 -> 3.5.8 2024-07-17 06:29:16 +00:00
te terragrunt: 0.59.6 -> 0.62.0 2024-07-13 20:15:46 +00:00
tg
th
ti tippecanoe: 2.55.0 -> 2.56.0 2024-07-17 06:25:47 +00:00
tk
tl
tm
to {tor,mullvad}-browser: migrate to pkgs/by-name 2024-07-12 10:20:37 +02:00
tp
tr Merge pull request #325334 from onemoresuza/hare-0.24.2 2024-07-16 22:48:20 +02:00
ts/tsm-client
tt
tu tuifimanager: 4.0.6 -> 4.1.7 (#326616) 2024-07-15 11:35:50 +05:30
tw fetchCrate: sha256 -> hash 2024-07-14 13:48:13 -04:00
tx/txr
ty typstyle: 0.11.29 -> 0.11.30 2024-07-17 07:48:47 +02:00
uc
ud
ue
ug
uh/uhttpmock_1_0
ui
um/umpire
un unhide: order attributes by phases order 2024-07-16 09:19:41 -03:00
up
us treewide: remove unused occurence of stdenv (and other) arguments 2024-07-14 04:32:56 +02:00
ut
uu/uuu
uv/uv
uw/uwhoisd
ux
va
vc
vd/vdhcoapp
ve vesktop: add updateScript 2024-07-15 13:38:18 -04:00
vg/vgm2x
vi Merge pull request #326996 from r-ryantm/auto-update/vinegar 2024-07-14 10:47:54 -04:00
vk/vkd3d
vl
vm
vn vnote: 3.18.0 -> 3.18.1 2024-07-14 23:57:59 +02:00
vo
vp
vs/vscode-js-debug
vu Merge pull request #325635 from r-ryantm/auto-update/vue-language-server 2024-07-11 20:00:32 +02:00
vv/vvvvvv treewide: sha256 -> hash attribute for fetchgit 2024-07-14 19:10:08 +08:00
vz/vzic
wa warp-terminal: 0.2024.06.25.08.02.stable_01 -> 0.2024.07.09.08.01.stable_00 2024-07-15 04:51:59 +00:00
wb Merge pull request #326827 from Aleksanaa/trivial-sha256-fix 2024-07-14 22:40:25 +08:00
wc/wcurl wcurl: init at 2024.07.10 2024-07-16 07:45:23 +00:00
we
wf/wf-touch
wg/wg-access-server
wh where-is-my-sddm-theme: 1.9.2 -> 1.10.0 2024-07-12 12:43:30 +00:00
wi wit-bindgen: 0.27.0 -> 0.28.0 2024-07-17 06:39:51 +00:00
wl
wo Merge pull request #327356 from r-ryantm/auto-update/worker 2024-07-16 22:33:22 +00:00
wp
wr/wrangler
ws
wt
wx/wxc
wy/wyoming-satellite
x1/x16
x5/x509-limbo
xa/xarcan
xc xcbeautify: 1.4.0 -> 2.4.1 2024-07-13 12:52:30 +05:30
xd
xe xemu: 0.7.127 -> 0.7.128 2024-07-15 14:38:21 +00:00
xf/xfs-undelete
xh/xhosts
xi
xl xlights: 2024.12 -> 2024.13 2024-07-14 16:37:27 +00:00
xm treewide: sha256 -> hash attribute for fetchgit 2024-07-14 19:10:08 +08:00
xn/xnlinkfinder
xo
xp
xr/xr-hardware
xs
xu/xunit-viewer
xw xwayland-run: 0.0.3 -> 0.0.4 2024-07-15 10:39:30 -03:00
ya Merge pull request #239378 from tie/yandexcloud-cli 2024-07-17 09:30:43 +00:00
yc/ycmd
yd/ydotool
ye
yg/yggdrasil
yj/yj
yo
ys/ysfx
yt treewide: remove unused occurence of stdenv (and other) arguments 2024-07-14 04:32:56 +02:00
yu
za zapret: init as 0-unstable-2024-07-16 (#327675) 2024-07-16 23:08:33 +00:00
zb/zbus-xmlgen
zc/zcfan
ze zenity: 4.0.1 → 4.0.2 2024-07-13 20:31:56 +08:00
zf/zfind
zi
zl/zluda
zm/zmkBATx
zo
zp
zs
zu/zug
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;
}