various: refactor and move to pkgs/by-name (#491903)

This commit is contained in:
Gergő Gutyina
2026-02-27 22:56:38 +00:00
committed by GitHub
43 changed files with 121 additions and 156 deletions
@@ -2,7 +2,7 @@
lib,
stdenv,
fetchurl,
java,
jre,
coreutils,
which,
makeWrapper,
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
# It is necessary to set the default $FUSEKI_BASE directory to a writable location
# By default it points to $FUSEKI_HOME/run which is in the nix store
wrapProgram "$i" \
--prefix "PATH" : "${java}/bin/:${coreutils}/bin:${which}/bin" \
--prefix "PATH" : "${jre}/bin/:${coreutils}/bin:${which}/bin" \
--set-default "FUSEKI_HOME" "$out" \
--run "if [ -z \"\$FUSEKI_BASE\" ]; then export FUSEKI_BASE=\"\$HOME/.local/fuseki\" ; mkdir -p \"\$HOME/.local/fuseki\" ; fi" \
;
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
'';
passthru = {
tests = {
basic-test = pkgs.callPackage ./fuseki-test.nix { };
basic-test = pkgs.callPackage ./basic-test.nix { };
};
};
meta = {
@@ -2,7 +2,7 @@
lib,
stdenv,
fetchurl,
java,
jre,
makeWrapper,
}:
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
installPhase = ''
cp -r . "$out"
for i in "$out"/bin/*; do
wrapProgram "$i" --prefix "PATH" : "${java}/bin/"
wrapProgram "$i" --prefix "PATH" : "${jre}/bin/"
done
'';
meta = {
@@ -0,0 +1,8 @@
{ icinga2 }:
icinga2.override {
nameSuffix = "-agent";
withMysql = false;
withNotification = false;
withIcingadb = false;
withPerfdata = false;
}
@@ -28,14 +28,14 @@
nameSuffix ? "",
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "icinga2${nameSuffix}";
version = "2.15.1";
src = fetchFromGitHub {
owner = "icinga";
repo = "icinga2";
rev = "v${version}";
rev = "v${finalAttrs.version}";
hash = "sha256-w/eD07yzBm3x4G74OuGwkmpBzj63UoklmcKxVi5lx8E=";
};
@@ -118,9 +118,9 @@ stdenv.mkDerivation rec {
''}
'';
vim = runCommand "vim-icinga2-${version}" { pname = "vim-icinga2"; } ''
vim = runCommand "vim-icinga2-${finalAttrs.version}" { pname = "vim-icinga2"; } ''
mkdir -p $out/share/vim-plugins
cp -r "${src}/tools/syntax/vim" $out/share/vim-plugins/icinga2
cp -r "${finalAttrs.src}/tools/syntax/vim" $out/share/vim-plugins/icinga2
'';
meta = {
@@ -133,4 +133,4 @@ stdenv.mkDerivation rec {
helsinki-Jo
];
};
}
})
@@ -24,7 +24,7 @@ let
};
patches = [
# https://github.com/influxdata/flux/pull/5542
../influxdb2/fix-unsigned-char.patch
./fix-unsigned-char.patch
];
# Don't fail on missing code documentation and allow dead_code/lifetime/unused_assignments warnings
@@ -0,0 +1,13 @@
diff --git a/flux/src/cffi.rs b/flux/src/cffi.rs
index ba18e3d5..0c1badf8 100644
--- a/flux/src/cffi.rs
+++ b/flux/src/cffi.rs
@@ -1149,7 +1149,7 @@ from(bucket: v.bucket)
fn parse_with_invalid_utf8() {
let cfname = CString::new("foo.flux").unwrap();
let cfname_ptr: *const c_char = cfname.as_ptr();
- let v: Vec<c_char> = vec![-61, 0];
+ let v: Vec<c_char> = vec![-61i8 as c_char, 0];
let csrc: *const c_char = &v[0];
// Safety: both pointers are valid
let pkg = unsafe { flux_parse(cfname_ptr, csrc) };
+16
View File
@@ -0,0 +1,16 @@
# For backwards compatibility with older versions of influxdb2,
# which bundled the server and CLI into the same derivation. Will be
# removed in a few releases.
# - David Anderson 2021-12-16 in 84bc3a02807fd
{
buildEnv,
influxdb2-server,
influxdb2-cli,
}:
buildEnv {
name = "influxdb2";
paths = [
influxdb2-server
influxdb2-cli
];
}
@@ -1,15 +1,15 @@
{
lib,
stdenv,
nodejs-slim,
nodejs-slim_22,
bundlerEnv,
nixosTests,
yarn-berry,
yarn-berry_4,
callPackage,
ruby,
ruby_3_3,
writeShellScript,
brotli,
python3,
python311,
# Allow building a fork or custom version of Mastodon:
pname ? "mastodon",
@@ -21,6 +21,12 @@
yarnHash ? srcOverride.yarnHash,
yarnMissingHashes ? srcOverride.yarnMissingHashes,
}:
let
nodejs-slim = nodejs-slim_22;
python3 = python311;
ruby = ruby_3_3;
yarn-berry = yarn-berry_4.override { nodejs = nodejs-slim; };
in
stdenv.mkDerivation rec {
inherit pname version;
@@ -23,14 +23,14 @@ let
};
};
in
python.pkgs.buildPythonPackage rec {
python.pkgs.buildPythonPackage (finalAttrs: {
pname = "mautrix-telegram";
version = "0.15.3";
src = fetchFromGitHub {
owner = "mautrix";
repo = "telegram";
tag = "v${version}";
tag = "v${finalAttrs.version}";
hash = "sha256-w3BqWyAJV/lZPoOFDzxhootpw451lYruwM9efwS6cEc=";
};
@@ -90,4 +90,4 @@ python.pkgs.buildPythonPackage rec {
];
mainProgram = "mautrix-telegram";
};
}
})
@@ -2,21 +2,22 @@
lib,
callPackage,
writeShellScriptBin,
beamPackages,
beam,
mix2nix,
fetchFromGitHub,
git,
cmake,
nixosTests,
nixfmt,
mobilizon-frontend,
mobilizon-frontend ? callPackage ./frontend.nix { },
}:
let
inherit (beamPackages) mixRelease buildMix;
beamPackages = beam.packages.erlang_27.extend (self: super: { elixir = self.elixir_1_18; });
common = callPackage ./common.nix { };
in
mixRelease rec {
beamPackages.mixRelease rec {
inherit (common) pname version src;
# A typo that is a build failure on elixir 1.18
@@ -59,7 +60,7 @@ mixRelease rec {
});
# The remainder are Git dependencies (and their deps) that are not supported by mix2nix currently.
web_push_encryption = buildMix {
web_push_encryption = beamPackages.buildMix {
name = "web_push_encryption";
version = "0.3.1";
src = fetchFromGitHub {
@@ -73,7 +74,7 @@ mixRelease rec {
jose
];
};
icalendar = buildMix rec {
icalendar = beamPackages.buildMix rec {
name = "icalendar";
version = "1.1.2";
src = fetchFromGitHub {
@@ -88,7 +89,7 @@ mixRelease rec {
timex
];
};
rajska = buildMix rec {
rajska = beamPackages.buildMix rec {
name = "rajska";
version = "1.3.3";
src = fetchFromGitHub {
@@ -106,7 +107,7 @@ mixRelease rec {
mock
];
};
exkismet = buildMix rec {
exkismet = beamPackages.buildMix rec {
name = "exkismet";
version = "0.0.3";
src = fetchFromGitHub {
@@ -7,34 +7,34 @@
pkg-config,
systemdMinimal,
nixosTests,
bind8Stats ? false,
checking ? false,
ipv6 ? true,
mmap ? false,
minimalResponses ? true,
nsec3 ? true,
ratelimit ? false,
recvmmsg ? false,
rootServer ? false,
rrtypes ? false,
zoneStats ? false,
withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemdMinimal,
configFile ? "/etc/nsd/nsd.conf",
config,
# set default options for config values
# maybe TODO: move these into a proper module
# (after https://github.com/NixOS/nixpkgs/pull/489889?)
bind8Stats ? config.nsd.bind8Stats or false,
checking ? config.nsd.checking or false,
ipv6 ? config.nsd.ipv6 or true,
mmap ? config.nsd.mmap or false,
minimalResponses ? config.nsd.minimalResponses or true,
nsec3 ? config.nsd.nsec3 or true,
ratelimit ? config.nsd.ratelimit or false,
recvmmsg ? config.nsd.recvmmsg or false,
rootServer ? config.nsd.rootServer or false,
rrtypes ? config.nsd.rrtypes or false,
zoneStats ? config.nsd.zoneStats or false,
withSystemd ? config.nsd.withSystemd or (lib.meta.availableOn stdenv.hostPlatform systemdMinimal),
configFile ? config.nsd.configFile or "/etc/nsd/nsd.conf",
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "nsd";
version = "4.12.0";
src = fetchurl {
url = "https://www.nlnetlabs.nl/downloads/${pname}/${pname}-${version}.tar.gz";
sha256 = "sha256-+ezCz3m6UFgPLfYpGO/EQAhMW/EQV9tEwZqpZDzUteg=";
url = "https://www.nlnetlabs.nl/downloads/nsd/nsd-${finalAttrs.version}.tar.gz";
hash = "sha256-+ezCz3m6UFgPLfYpGO/EQAhMW/EQV9tEwZqpZDzUteg=";
};
prePatch = ''
substituteInPlace nsd-control-setup.sh.in --replace openssl ${openssl}/bin/openssl
'';
nativeBuildInputs = lib.optionals withSystemd [
pkg-config
];
@@ -49,6 +49,15 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
# TODO: prePatch doesn't actually get executed because patchPhase is overridden
prePatch = ''
substituteInPlace nsd-control-setup.sh.in --replace openssl ${openssl}/bin/openssl
'';
patchPhase = ''
sed 's@$(INSTALL_DATA) nsd.conf.sample $(DESTDIR)$(nsdconfigfile).sample@@g' -i Makefile.in
'';
configureFlags =
let
edf = c: o: if c then [ "--enable-${o}" ] else [ "--disable-${o}" ];
@@ -72,10 +81,6 @@ stdenv.mkDerivation rec {
"--with-configdir=etc/nsd"
];
patchPhase = ''
sed 's@$(INSTALL_DATA) nsd.conf.sample $(DESTDIR)$(nsdconfigfile).sample@@g' -i Makefile.in
'';
passthru.tests = {
inherit (nixosTests) nsd;
};
@@ -86,4 +91,4 @@ stdenv.mkDerivation rec {
license = lib.licenses.bsd3;
platforms = lib.platforms.unix;
};
}
})
@@ -1,20 +1,17 @@
{
stdenv,
gccStdenv,
fetchurl,
lib,
tls ? true,
gnutls ? null,
gnutls,
}:
assert tls -> gnutls != null;
stdenv.mkDerivation rec {
gccStdenv.mkDerivation (finalAttrs: {
version = "2.2";
pname = "nullmailer";
src = fetchurl {
url = "https://untroubled.org/nullmailer/nullmailer-${version}.tar.gz";
url = "https://untroubled.org/nullmailer/nullmailer-${finalAttrs.version}.tar.gz";
sha256 = "0md8cf90fl2yf3zh9njjy42a673v4j4ygyq95xg7fzkygdigm1lq";
};
@@ -55,4 +52,4 @@ stdenv.mkDerivation rec {
platforms = lib.platforms.all;
maintainers = [ ];
};
}
})
@@ -1,10 +1,10 @@
{
stdenv,
wrapQtAppsHook,
makeDesktopItem,
python3,
lib,
stdenv,
pulseaudio,
makeDesktopItem,
qt5,
python3,
}:
let
@@ -26,17 +26,15 @@ stdenv.mkDerivation {
pname = "qpaeq";
inherit (pulseaudio) version src;
nativeBuildInputs = [ wrapQtAppsHook ];
nativeBuildInputs = [ qt5.wrapQtAppsHook ];
buildInputs = [
(python3.withPackages (
ps: with ps; [
pyqt5
dbus-python
]
))
];
dontBuild = true;
@@ -1,27 +1,29 @@
{
lib,
stdenv,
clangStdenv,
fetchurl,
which,
m4,
protobuf,
protobuf_21,
boost,
zlib,
curl,
openssl,
icu,
jemalloc,
libtool,
cctools,
python3Packages,
makeWrapper,
}:
stdenv.mkDerivation rec {
let
stdenv = clangStdenv;
in
stdenv.mkDerivation (finalAttrs: {
pname = "rethinkdb";
version = "2.4.4";
src = fetchurl {
url = "https://download.rethinkdb.com/repository/raw/dist/${pname}-${version}.tgz";
url = "https://download.rethinkdb.com/repository/raw/dist/rethinkdb-${finalAttrs.version}.tgz";
hash = "sha256-UJEjdgK2KDDbLLParKarNGMjI3QeZxDC8N5NhPRCcR8=";
};
@@ -44,7 +46,7 @@ stdenv.mkDerivation rec {
makeFlags = [ "rethinkdb" ];
buildInputs = [
protobuf
protobuf_21
boost
zlib
curl
@@ -52,7 +54,7 @@ stdenv.mkDerivation rec {
icu
]
++ lib.optional (!stdenv.hostPlatform.isDarwin) jemalloc
++ lib.optional stdenv.hostPlatform.isDarwin libtool;
++ lib.optional stdenv.hostPlatform.isDarwin cctools;
nativeBuildInputs = [
which
@@ -84,4 +86,4 @@ stdenv.mkDerivation rec {
thoughtpolice
];
};
}
})
-12
View File
@@ -1,12 +0,0 @@
{
buildEnv,
influxdb2-server,
influxdb2-cli,
}:
buildEnv {
name = "influxdb2";
paths = [
influxdb2-server
influxdb2-cli
];
}
-69
View File
@@ -1847,11 +1847,6 @@ with pkgs;
mkspiffs-presets = recurseIntoAttrs (callPackages ../by-name/mk/mkspiffs/presets.nix { });
mobilizon = callPackage ../servers/mobilizon {
beamPackages = beam.packages.erlang_27.extend (self: super: { elixir = self.elixir_1_18; });
mobilizon-frontend = callPackage ../servers/mobilizon/frontend.nix { };
};
nltk-data = recurseIntoAttrs (callPackage ../tools/text/nltk-data { });
seabios-coreboot = seabios.override { ___build-type = "coreboot"; };
@@ -2770,8 +2765,6 @@ with pkgs;
maubot = with python3Packages; toPythonApplication maubot;
mautrix-telegram = recurseIntoAttrs (callPackage ../servers/mautrix-telegram { });
m2r = with python3Packages; toPythonApplication m2r;
md2gemini = with python3.pkgs; toPythonApplication md2gemini;
@@ -3266,10 +3259,6 @@ with pkgs;
playwright-driver = (callPackage ../development/web/playwright/driver.nix { }).playwright-core;
playwright-test = (callPackage ../development/web/playwright/driver.nix { }).playwright-test;
plex = callPackage ../servers/plex { };
plexRaw = callPackage ../servers/plex/raw.nix { };
tabview = with python3Packages; toPythonApplication tabview;
inherit (callPackage ../development/tools/pnpm { })
@@ -8115,14 +8104,6 @@ with pkgs;
};
cassandra = cassandra_4;
apache-jena = callPackage ../servers/nosql/apache-jena/binary.nix {
java = jre;
};
apache-jena-fuseki = callPackage ../servers/nosql/apache-jena/fuseki-binary.nix {
java = jre;
};
inherit (callPackages ../servers/asterisk { })
asterisk
asterisk-stable
@@ -8163,7 +8144,6 @@ with pkgs;
freshrss = callPackage ../servers/web-apps/freshrss { };
freshrss-extensions = recurseIntoAttrs (callPackage ../servers/web-apps/freshrss/extensions { });
grafana = callPackage ../servers/monitoring/grafana { };
grafanaPlugins = recurseIntoAttrs (callPackages ../servers/monitoring/grafana/plugins { });
inherit (callPackage ../servers/hbase { })
@@ -8244,10 +8224,6 @@ with pkgs;
kanidmWithSecretProvisioning_1_9
;
leafnode = callPackage ../servers/news/leafnode { };
leafnode1 = callPackage ../servers/news/leafnode/1.nix { };
lemmy-server = callPackage ../servers/web-apps/lemmy/server.nix { };
lemmy-ui = callPackage ../servers/web-apps/lemmy/ui.nix {
@@ -8258,13 +8234,6 @@ with pkgs;
inherit (mailmanPackages) mailman mailman-hyperkitty;
mailman-web = mailmanPackages.web;
mastodon = callPackage ../servers/mastodon {
nodejs-slim = nodejs-slim_22;
python3 = python311;
ruby = ruby_3_3;
yarn-berry = yarn-berry_4.override { nodejs = nodejs-slim_22; };
};
micro-full = micro.wrapper.override {
extraPackages = [
wl-clipboard
@@ -8343,8 +8312,6 @@ with pkgs;
];
};
nsd = callPackage ../servers/dns/nsd (config.nsd or { });
nsdiff = perlPackages.nsdiff;
openafs = callPackage ../servers/openafs/1.8 { };
@@ -8359,12 +8326,6 @@ with pkgs;
# PulseAudio daemons
hsphfpd = callPackage ../servers/pulseaudio/hsphfpd.nix { };
pulseaudio = callPackage ../servers/pulseaudio { };
qpaeq = libsForQt5.callPackage ../servers/pulseaudio/qpaeq.nix { };
pulseaudioFull = pulseaudio.override {
x11Support = true;
jackaudioSupport = true;
@@ -8406,16 +8367,6 @@ with pkgs;
boost = boost179.override { enableShared = false; };
};
influxdb = callPackage ../servers/nosql/influxdb { };
influxdb2-server = callPackage ../servers/nosql/influxdb2 { };
influxdb2-cli = callPackage ../servers/nosql/influxdb2/cli.nix { };
influxdb2-token-manipulator = callPackage ../servers/nosql/influxdb2/token-manipulator.nix { };
influxdb2-provision = callPackage ../servers/nosql/influxdb2/provision.nix { };
# For backwards compatibility with older versions of influxdb2,
# which bundled the server and CLI into the same derivation. Will be
# removed in a few releases.
influxdb2 = callPackage ../servers/nosql/influxdb2/combined.nix { };
mysql80 = callPackage ../servers/sql/mysql/8.0.x.nix {
inherit (darwin) developer_cmds DarwinTools;
boost = boost177; # Configure checks for specific version.
@@ -8431,16 +8382,6 @@ with pkgs;
mir_2_15
;
icinga2 = callPackage ../servers/monitoring/icinga2 { };
icinga2-agent = callPackage ../servers/monitoring/icinga2 {
nameSuffix = "-agent";
withMysql = false;
withNotification = false;
withIcingadb = false;
withPerfdata = false;
};
nagiosPlugins = recurseIntoAttrs (callPackages ../servers/monitoring/nagios-plugins { });
qboot = pkgsi686Linux.callPackage ../applications/virtualization/qboot { };
@@ -8494,12 +8435,6 @@ with pkgs;
pypiserver = with python3Packages; toPythonApplication pypiserver;
rethinkdb = callPackage ../servers/nosql/rethinkdb {
stdenv = clangStdenv;
libtool = cctools;
protobuf = protobuf_21;
};
samba4 = callPackage ../servers/samba/4.x.nix { };
samba = samba4;
@@ -9238,10 +9173,6 @@ with pkgs;
'';
};
nullmailer = callPackage ../servers/mail/nullmailer {
stdenv = gccStdenv;
};
openmoji-color = callPackage ../data/fonts/openmoji { fontFormats = [ "glyf_colr_0" ]; };
openmoji-black = callPackage ../data/fonts/openmoji { fontFormats = [ "glyf" ]; };