1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-17 19:21:04 +00:00
nixpkgs/pkgs/by-name
2024-07-17 20:22:32 +02:00
..
_0/_0xpropo
_2/_2ship2harkinian
_4
_6/_64gram
_9/_9base
a4/a4
a5/a52dec
aa
ab
ac
ad
ae
af
ag
ai
al
am
an
ao/aocl-utils
ap
ar
as
at
au
av
aw
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
bd
be
bi
bk/bk
bl
bm/bmake
bn/bngblaster
bo
bp
bq/bqn
br
bs
bt
bu
by
c-
c2
ca
cb
cc
cd
ce
cg
ch
ci
cl clipper2: use lib.platforms.all 2024-07-17 03:53:34 +02:00
cm
cn/cntb
co
cp
cq/cq
cr
cs
ct/ctx
cu
cv/cvemap
cy
cz/czkawka
da
db
dc
dd
de
dg/dgoss
dh/dhcpig
di
dj/djent
dm
dn
do
dp
dr
ds
dt
du
dv/dvb-apps
dx
dy
e1/e1s
ea
eb
ec
ed
ee/eepers
ef/efibootmgr
ei
ej/ejsonkms
ek/eksctl
el
em
en
eo/eog
ep
er
es
et
eu
ev evil-helix: 20240618 -> 20240716 2024-07-17 00:25:24 +00:00
ew/eww
ex
ey/eyewitness
ez/eza
f2/f2fs-tools
fa
fb/fbset
fc
fe
ff
fg/fgqcanvas
fi
fj/fjo
fl
fm
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
gb
gc
gd
ge
gf
gg/gg
gh
gi
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
gt
gu
gv/gvisor
gx/gxml
h5/h5utils
h8/h8mail
ha
hb/hb-honeypot
hd
he
hi
hj/hjson-go
hn/hn-text
ho
hp/hpp2plantuml
ht
hu
hv/hvm
hy
i2/i2p
i3
ia
ic
id
if/ifrextractor-rs
ig
ii
ij/ijhttp
im
in
io
ip
ir
is
it
iw/iw
iz/izrss
ja
jd/jdt-language-server
je
ji
jj/jj
jn
jo
jq/jq-zsh-plugin
jr/jrl-cmakemodules
js
jt/jtdx
ju
jw/jwasm
ka
kc
kd
ke
kg/kgeotag
ki
kl/klog-time-tracker klog-time-tracker: 6.3 -> 6.4 2024-07-17 00:58:35 +00:00
km
kn
ko
kp/kplex
kr
ks
kt
ku
kv/kvmarwaita
kx
ky
la
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
lk/lk-jwt-service
ll
lm
ln/lngen
lo
lp
ls
lt/ltris
lu
lv/lv_font_conv
lw/lwgrp
lx
lz
m1/m1ddc
m2
ma Merge pull request #325642 from emilioziniades/init-maelstrom 2024-07-17 19:19:42 +02:00
mb
mc
md
me Merge pull request #327029 from r-ryantm/auto-update/media-downloader 2024-07-17 12:41:07 +08:00
mf
mg
mi
mk
ml/mlx42
mo
mp
mq
ms
mu
my
n2/n2
n8/n8n
na
nb
nc
nd/ndstrim
ne
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
nv
nw
nx/nxengine-evo
oa
ob
oc
od
oe/oelint-adv
of
oh
oi
ok/okolors
ol
om
on
oo
op Merge pull request #326745 from Tochiaha/openscap 2024-07-17 19:03:04 +02:00
or
os
ot
ou
ov
ow
pa
pc
pd
pe
pf/pfft
pg
ph
pi
pk
pl Merge pull request #323397 from detroyejr/plex-desktop 2024-07-17 18:47:28 +02:00
pm
pn
po poptracker: Add XDG Desktop entry 2024-07-17 12:39:09 -04:00
pp/ppsspp
pq
pr Merge pull request #290452 from flandweber/borgmatic-exporter 2024-07-17 19:08:28 +02:00
ps
pt
pu
pv/pvsneslib
pw
px/pxder
py
pz/pzip
qa/qadwaitadecorations
qb/qbittorrent-enhanced
qc/qcm
qd
qg/qgrep
qn/qnial
qo/qodem
qp/qpoases
qr
qs
qt/qtractor
qu
qw/qwerty-fr
r0/r0vm
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
rk
rl/rl_json
rm
rn/rnd-name
ro
rp/rpcs3
rq
rs
rt
ru
rw/rwpspread
ry
s0/s0ix-selftest-tool
s3
sa
sb
sc
sd
se
sf/sfwbar
sg/sgfutils
sh shopware-cli: 0.4.48 -> 0.4.50 2024-07-17 13:33:30 +00:00
si
sk Merge pull request #324602 from seanrmurphy/add-skypilot 2024-07-17 20:08:34 +02:00
sl
sm
sn
so
sp
sq
sr
ss
st
su
sv
sw
sx
sy
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
tg
th
ti tika: add enableOcr top level parameter, set to true by default 2024-07-17 13:07:49 +02:00
tk
tl
tm
to
tp
tr
ts/tsm-client
tt
tu
tw
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
up
us
ut
uu/uuu
uv/uv
uw/uwhoisd
ux
va
vc
vd/vdhcoapp
ve
vg/vgm2x
vi
vk/vkd3d
vl
vm
vn
vo
vp
vs/vscode-js-debug
vu
vv/vvvvvv
vz/vzic
wa
wb
wc/wcurl
we
wf/wf-touch
wg/wg-access-server
wh
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
xd
xe
xf/xfs-undelete
xh/xhosts
xi
xl
xm
xn/xnlinkfinder
xo
xp
xr/xr-hardware
xs
xu/xunit-viewer
xw
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
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
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;
}