1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs synced 2024-10-19 02:59:10 -04:00
nixpkgs/pkgs/by-name
2024-04-18 21:11:54 +02:00
..
4d/4d-minesweeper
_0/_0xpropo
_4/_4th
_6/_64gram
_9/_9base
a4/a4
a5/a52dec
aa
ab/aba
ac
ad
ae Merge pull request #289520 from vaci/vaci/aeron-143 2024-04-17 22:24:05 +02:00
af
ag/ags
ai
al
am
an Merge pull request #299465 from hatch01/antares 2024-04-17 21:50:06 +02:00
ao/aocl-utils
ap
ar Merge pull request #304337 from DontEatOreo/pkgs-arc-browser 2024-04-18 17:14:56 +02:00
as
at
au
av
aw treewide: replace prefetch-yarn-deps with fixup-yarn-lock where necessary 2024-04-17 13:34:05 -04:00
ax/axmldec
ay
ba
bc/bc-ur
be
bi
bk/bk
bl
bm/bmake
bn/bngblaster
bo
bp/bpftop
br
bs
bt/bt-migrate
bu
by
c-
c2
ca
cb
cc
cd
ce
cg
ch Merge pull request #303369 from jnsgruk/charmcraft 2024-04-17 17:22:10 +02:00
ci
cl
cm
cn/cntb
co Merge pull request #303770 from r-ryantm/auto-update/codeium 2024-04-18 21:11:54 +02:00
cp
cr
cs
ct/ctx
cu
cv/cvemap
cy
cz/czkawka
da
db/dbus-cpp
dc/dc3dd
dd
de treewide: replace prefetch-yarn-deps with fixup-yarn-lock where necessary 2024-04-17 13:34:05 -04:00
dg/dgoss
dh/dhcpig
di
dj/djent
dm
dn/dns2tcp
do
dp/dpp
dr/drone-scp
ds
dt
du
dv/dvb-apps
dx
dy
ea/easyeasm
eb
ec
ed
ei
ek/eksctl
el
em emacs-lsp-booster: 0.2.0 -> 0.2.1 2024-04-17 23:53:33 +00:00
en
ep/epub-thumbnailer
er
es
et
eu
ex
ez/eza
fa
fb/fbset
fc
fe treewide: replace prefetch-yarn-deps with fixup-yarn-lock where necessary 2024-04-17 13:34:05 -04:00
ff
fi
fl
fm
fn/fnott
fo
fr
fs
fu/fuchsia-cursor
fv
fw/fwupd
fy/fypp
fz/fzf-make fzf-make: 0.27.0 -> 0.28.0 2024-04-17 21:22:08 +02:00
g3/g3kb-switch
ga
gb/gbar
gc
ge
gf
gg/gg
gh
gi treewide: replace prefetch-yarn-deps with fixup-yarn-lock where necessary 2024-04-17 13:34:05 -04:00
gl
gm
gn
go
gp
gr
gt
gu
gv/gvisor
gx/gxml
h8/h8mail
ha
hd/hdrop
he
hi himalaya: 1.0.0-beta.3 -> 1.0.0-beta.4 2024-04-18 08:41:06 +02:00
hj/hjson-go
ho
ht
hu
hy
i2/i2p
i3
ia
ic
id
if/ifrextractor-rs
ig
ii
im
in treewide: replace prefetch-yarn-deps with fixup-yarn-lock where necessary 2024-04-17 13:34:05 -04:00
io/ioq3-scion
ip
ir
it
ja
jd/jdt-language-server
je
ji
jj/jj
jn
jo
jr/jrl-cmakemodules
js/jsoncons
ju
ka
kc
kd/kdsingleapplication
ke
kg/kgeotag
ki
kl/klog-time-tracker
km
kn/knossosnet
ko
kp/kplex
kr
ks
kt Merge pull request #278466 from arthsmn/ktls-utils-refactor 2024-04-17 18:11:52 +02:00
ku
kx/kxstitch
ky/kyverno-chainsaw
la
lb
lc/lcab
ld/ldproxy
le
li Merge pull request #303360 from r-ryantm/auto-update/livekit 2024-04-18 20:55:28 +02:00
ll
lm/lmstudio
ln/lngen
lo
lp
ls
lt/ltris
lu
lw/lwgrp
lx treewide: replace prefetch-yarn-deps with fixup-yarn-lock where necessary 2024-04-17 13:34:05 -04:00
lz
m2
ma Merge pull request #304980 from r-ryantm/auto-update/makima 2024-04-18 10:26:59 -04:00
mb
mc mcap-cli: 0.0.42 -> 0.0.43 2024-04-18 08:16:24 +00:00
md
me treewide: replace prefetch-yarn-deps with fixup-yarn-lock where necessary 2024-04-17 13:34:05 -04:00
mf
mg/mgitstatus
mi
mk
ml/mlx42
mo
mp
mq
ms
mu
my myxer: init at 1.3.0 2024-04-18 12:06:49 +02:00
n2/n2
na
nb/nbtscan
nc
nd/ndstrim
ne
nf/nfft
ng/ngrid
nh
ni
nl
nm/nmap-parse
nn/nncp
no nom: 2.1.4 -> 2.1.6 2024-04-18 12:25:47 +02:00
np
nr
ns
nt/ntfs2btrfs
nu
nv
nw
oa
ob
oc
oe/oelint-adv
of
oh/oh-my-fish
oi
ol/olvid
om/omniorbpy
on
op
or orchard: 0.16.1 -> 0.17.0 2024-04-18 02:50:58 +00:00
os
ot
ou
ov
ow
pa
pd
pe
pf/pfft
pg
ph
pi
pk
pl
pm
pn
po
pp/ppsspp
pq
pr proton-ge-bin: GE-Proton9-2 -> GE-Proton9-4 2024-04-18 08:06:53 +00:00
pt
pu
pv/pvsneslib
pw
px/pxder treewide: replace prefetch-yarn-deps with fixup-yarn-lock where necessary 2024-04-17 13:34:05 -04:00
py
pz/pzip
qa/qadwaitadecorations
qc/qcm
qd/qdirstat
qg/qgrep
qp/qpoases
qr
qs
qt/qtractor
qu
r1/r10k
ra
rc
rd/rdwatool
re Merge pull request #294743 from rexxDigital/reactphysics3d 2024-04-17 17:28:50 +02:00
ri
rk/rkbin
rl/rl_json
rm
rn/rnd-name
ro
rp/rpcs3
rq/rqbit
rs
rt/rtg-tools
ru
rw/rwpspread
ry
s3
sa
sc
sd
se sendme: 0.3.0 -> 0.5.0 2024-04-17 11:17:02 -06:00
sg/sgfutils
sh treewide: replace prefetch-yarn-deps with fixup-yarn-lock where necessary 2024-04-17 13:34:05 -04:00
si Merge pull request #296011 from skeuchel/riscv-simde 2024-04-17 17:09:35 +02:00
sl
sm
sn snapcraft: init at 8.2.0 2024-04-18 19:06:42 +01:00
so Merge pull request #303222 from nyadiia/solitare-tui 2024-04-18 21:06:41 +08:00
sp
sq
sr
ss
st Merge pull request #303694 from panicgh/storcli 2024-04-18 01:48:26 +08:00
su Merge pull request #303375 from MDM23/update-surrealist 2024-04-18 11:35:53 +02:00
sv
sw Merge pull request #304842 from hakan-demirli/swww 2024-04-18 22:48:23 +08:00
sx
sy
t-/t-rex
ta
tc/tcsh Merge pull request #302268 from suominen/tcsh-6.24.12 2024-04-17 17:04:33 +02:00
td/tdl
te tenki: 1.6.0 -> 1.7.0 2024-04-17 18:12:23 +00:00
tg/tgpt
th
ti
tk/tkdiff
tl
tm/tmuxifier
to
tp
tr
tt/ttop
tu
tw/twitch-dl
tx/txr
ty
uc
ud
ue
ug
ui
um/umpire
un
up
us/usql
ut
uu/uuu
uv/uv
uw/uwhoisd
ux/uxn
va
vc
ve treewide: replace prefetch-yarn-deps with fixup-yarn-lock where necessary 2024-04-17 13:34:05 -04:00
vg/vgm2x
vi
vl
vo/voidmap
vu
vv/vvvvvv
wa
wb/wb32-dfu-updater
we
wh where-is-my-sddm-theme: 1.9.0 -> 1.9.1 2024-04-18 08:38:10 +00:00
wi Merge pull request #294407 from zendo/upd/wike 2024-04-17 17:25:36 +02:00
wl
wo workout-tracker: 0.12.0 -> 0.13.4 2024-04-17 22:45:01 +00:00
wp/wp-cli
ws
wt/wtfis
wy/wyoming-satellite
x1/x16
x5/x509-limbo
xa/xarcan
xc
xd
xe
xf/xfs-undelete
xi
xm
xo
xp/xplr
xr/xr-hardware
xs
xw/xwayland-run
ya
yc/ycmd
ye
yg/yggdrasil
yj/yj
yo
ys/ysfx
yt
yu
za zapzap: 5.2.1 -> 5.3 2024-04-18 04:20:27 +00:00
zb/zbus-xmlgen
zc/zcfan
ze
zi
zl/zluda
zo/zola
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;
}