1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs synced 2024-10-19 03:47:13 -04:00
nixpkgs/pkgs/by-name
Mario Rodas 2caff0317f
Merge pull request #300004 from sikmir/mbusd
mbusd: 0.5.1 → 0.5.2
2024-04-05 18:50:50 -05: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
ae
af
ag/ags
ai
al alt-tab-macos: 6.66.0 -> 6.68.0 2024-04-05 22:47:16 +03:00
am
an Merge pull request #270197 from eclairevoyant/anyrun 2024-04-04 20:40:37 +08:00
ao/aocl-utils
ap
ar
as Merge pull request #300258 from noaccOS/init-astartectl 2024-04-05 20:00:22 +08:00
at
au Merge pull request #297276 from jvanbruegge/audible-cli-script 2024-04-05 12:00:08 +02:00
av
aw
ax/axmldec
ay
ba
bc/bc-ur
be
bi
bk/bk
bl
bm/bmake
bn/bngblaster
bo boxbuddy: 2.2.0 -> 2.2.2 2024-04-04 21:47:14 +00:00
bp/bpftop
br
bs bstone: init at 1.2.12 2024-04-05 12:53:51 -05:00
bt/bt-migrate
bu
by
c-
c2 c2fmzq: 0.4.18 -> 0.4.19 2024-04-04 15:21:24 +00:00
ca Merge pull request #300319 from sikmir/cadzinho 2024-04-05 18:46:04 -05:00
cb
cc/ccache
cd
ce Merge pull request #301329 from a-kenji/init/centerpiece 2024-04-05 10:56:00 +08:00
cg
ch
ci
cl
cm
cn/cntb
co
cp
cr crunchy-cli: 3.3.1 -> 3.3.4 2024-04-05 05:11:38 +00:00
cs
ct/ctx
cu
cv/cvemap
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
di dissent: 0.0.22 -> 0.0.23 2024-04-05 02:26:29 +00:00
dj/djent
dm
dn/dns2tcp
do docuum: 0.23.1 -> 0.24.0 2024-04-05 12:31:58 +00:00
dp/dpp
dr/drone-scp
ds
dt/dtcmp
du
dv/dvb-apps
dx
dy
ea/easyeasm
eb
ec
ed
ei
ek/eksctl
el
em
en
ep/epub-thumbnailer
er
es
et etlegacy-unwrapped: init at 2.82.0, etlegacy: refactor 2024-04-04 08:21:51 +02:00
eu
ex
ez/eza
fa
fb/fbset
fc
fe
ff
fi files-cli: 2.12.46 -> 2.12.54 2024-04-05 13:52:24 +00:00
fl
fm
fn/fnott
fo folio: 24.09 -> 24.10 2024-04-05 03:22:29 +00:00
fr
fs
fu/fuchsia-cursor
fv
fw/fwupd
fy/fypp
fz/fzf-make
g3/g3kb-switch
ga
gb/gbar
gc
ge
gf
gg/gg
gh
gi git-gr: 1.0.3 -> 1.2.1 2024-04-04 15:26:56 -07:00
gl glas: 0.2.2 -> 0.2.3 2024-04-04 13:05:53 +05:30
gm
gn
go Merge pull request #299712 from msanft/gossip/init 2024-04-05 23:02:48 +08:00
gp gpscorrelate: migrate to by-name 2024-04-05 00:03:49 +04:00
gr
gt
gu
gx/gxml
h8/h8mail
ha
hd/hdrop
he
hi
hj/hjson-go
ho
ht
hu/hugo
hy hydrapaper: init at 3.3.2 2024-04-05 17:39:31 +08:00
i3
ia
ic
id
if/ifrextractor-rs
ig
ii
im
in Merge pull request #301414 from wegank/insert-dylib-refactor-2 2024-04-05 19:43:37 +02:00
io/ioq3-scion
ip
ir/ironbar
it
ja
jd/jdt-language-server
je
ji
jj/jj
jn
jo
js/jsoncons
ju
ka
kc
kd/kdsingleapplication
ke
kg/kgeotag
ki
kl/klog-time-tracker
km
kn/knossosnet
ko Merge pull request #296350 from kachick/add-komac 2024-04-05 10:42:11 +08:00
kp/kplex
kr
ks
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
le
li Merge pull request #300275 from devhell/bump-libstrophe 2024-04-05 18:46:51 -05:00
ll
lm/lmstudio
ln/lngen
lo
lp
ls
lt/ltris
lu
lw/lwgrp
lx
lz
m2
ma Merge pull request #296718 from Rutherther/mautrix-meta-init 2024-04-04 18:07:19 -04:00
mb
mc
md
me
mf
mg/mgitstatus
mi clash-meta: 1.18.2 -> 1.18.3 2024-04-04 19:39:37 +00: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 mycelium: 0.4.5 -> 0.5.0 2024-04-04 12:44:23 +03:00
n2/n2
na namespace-cli: 0.0.352 -> 0.0.354 2024-04-05 00:40:31 +00:00
nb/nbtscan
nc
nd/ndstrim
ne newsraft: 0.23 -> 0.24 2024-04-05 04:50:52 +00:00
nf/nfft
nh
ni
nl
nm/nmap-parse
nn/nncp
no
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 tbb: 2021.8.0 -> 2021.11.0 (#301391) 2024-04-05 17:36:37 +02:00
or orchard: 0.15.2 -> 0.16.0 2024-04-04 13:29:43 +00:00
os
ot
ou
ov
ow
pa
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.0.4 -> 11.1.0 2024-04-05 12:39:36 +02:00
pi
pk/pkcrack
pl
pm
pn
po
pp/ppsspp
pq
pr Merge pull request #300403 from r-ryantm/auto-update/promptfoo 2024-04-05 19:02:16 +02:00
pt
pu
pv/pvsneslib
pw
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
qs
qt/qtractor
qu
ra
rc
rd/rdwatool
re Merge pull request #301502 from r-ryantm/auto-update/renode-unstable 2024-04-04 22:11:46 -04:00
ri
rk/rkbin
rl/rl_json
rm
rn/rnd-name
ro Merge pull request #279891 from jfchevrette/rosa 2024-04-05 22:32:13 +02:00
rp/rpcs3
rq/rqbit
rs rst2html5: use nixfmt 2024-04-04 10:49:10 +02:00
rt
ru
rw/rwpspread
ry/ryujinx
s3
sa Merge pull request #301199 from Luflosi/update/satellite 2024-04-05 18:43:19 -05:00
sc
sd
se Merge pull request #299618 from TomaSajt/dub-support 2024-04-04 11:52:57 +02:00
sg/sgfutils
sh
si Merge pull request #291346 from aorith/init-silverbullet 2024-04-05 06:31:50 +02:00
sl
sm
sn
so
sp Merge pull request #300441 from aaronjheng/spirit 2024-04-06 01:32:51 +02:00
sq
sr
ss
st stirling-pdf: 0.22.3 -> 0.22.7 2024-04-04 18:21:57 +02:00
su
sv
sw
sx
sy
t-/t-rex
ta
tc/tcsh
td/tdl
te Merge pull request #298742 from FabianRig/technitium-dns-server-module 2024-04-04 21:43:08 +02:00
tg/tgpt
th
ti tippecanoe: 2.52.0 -> 2.53.0 2024-04-04 06:23:21 +00:00
tk/tkdiff
tl
tm/tmuxifier
to
tp
tr
tt/ttop
tu tuifimanager: fix inconsistency in pname 2024-04-04 05:45:21 +02:00
tx/txr
ty typstyle: 0.11.8 -> 0.11.11 2024-04-06 01:04:54 +08: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.9.5 -> 0.10.0 2024-04-05 12:27:13 +02:00
um/umpire
un
up upsun: init at 5.0.12 2024-04-05 09:33:26 +02:00
us/usql
ut
uu/uuu
uv/uv
uw/uwhoisd
ux/uxn
va
vc
ve
vg/vgm2x
vi
vl
vu
wa
wb/wb32-dfu-updater
we
wh
wi wit-bindgen: 0.23.0 -> 0.24.0 2024-04-05 04:22:13 +00:00
wl
wo
wp/wp-cli
ws
wt/wtfis
wy/wyoming-satellite
x1/x16
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
yc/ycmd
ye
yg/yggdrasil
yj/yj
yo
ys/ysfx
yt
yu
za
zb/zbus-xmlgen
zc/zcfan
ze/zesarux
zi
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;
}