3
0
Fork 0
forked from mirrors/nixpkgs

treewide: remove global with lib; in pkgs/tools

This commit is contained in:
Shawn8901 2023-01-24 17:35:54 +01:00
parent c0aeb33054
commit 133fa5f867
46 changed files with 153 additions and 235 deletions

View file

@ -36,8 +36,6 @@
, xorgserver , xorgserver
}: }:
with lib;
let let
inherit (python3.pkgs) cython buildPythonApplication; inherit (python3.pkgs) cython buildPythonApplication;
@ -206,7 +204,7 @@ in buildPythonApplication rec {
updateScript = ./update.sh; updateScript = ./update.sh;
}; };
meta = { meta = with lib; {
homepage = "https://xpra.org/"; homepage = "https://xpra.org/";
downloadPage = "https://xpra.org/src/"; downloadPage = "https://xpra.org/src/";
description = "Persistent remote applications for X"; description = "Persistent remote applications for X";

View file

@ -1,7 +1,5 @@
{ lib, stdenv, fetchurl, autoPatchelfHook, makeWrapper, installShellFiles }: { lib, stdenv, fetchurl, autoPatchelfHook, makeWrapper, installShellFiles }:
with lib;
let let
data = import ./data.nix {}; data = import ./data.nix {};
in stdenv.mkDerivation { in stdenv.mkDerivation {
@ -16,7 +14,7 @@ in stdenv.mkDerivation {
installPhase = '' installPhase = ''
install -D -t $out/bin/ * install -D -t $out/bin/ *
'' + optionalString stdenv.isLinux '' '' + lib.optionalString stdenv.isLinux ''
wrapProgram $out/bin/pulumi --set LD_LIBRARY_PATH "${stdenv.cc.cc.lib}/lib" wrapProgram $out/bin/pulumi --set LD_LIBRARY_PATH "${stdenv.cc.cc.lib}/lib"
'' + '' '' + ''
installShellCompletion --cmd pulumi \ installShellCompletion --cmd pulumi \
@ -25,9 +23,9 @@ in stdenv.mkDerivation {
--zsh <($out/bin/pulumi completion zsh) --zsh <($out/bin/pulumi completion zsh)
''; '';
nativeBuildInputs = [ installShellFiles ] ++ optionals stdenv.isLinux [ autoPatchelfHook makeWrapper ]; nativeBuildInputs = [ installShellFiles ] ++ lib.optionals stdenv.isLinux [ autoPatchelfHook makeWrapper ];
meta = { meta = with lib; {
homepage = "https://pulumi.io/"; homepage = "https://pulumi.io/";
description = "Pulumi is a cloud development platform that makes creating cloud programs easy and productive"; description = "Pulumi is a cloud development platform that makes creating cloud programs easy and productive";
sourceProvenance = with sourceTypes; [ binaryNativeCode ]; sourceProvenance = with sourceTypes; [ binaryNativeCode ];

View file

@ -23,8 +23,6 @@
, nixosTests , nixosTests
}: }:
with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "1.12.0"; version = "1.12.0";
pname = "tigervnc"; pname = "tigervnc";

View file

@ -7,8 +7,6 @@ assert par2Support -> par2cmdline != null;
let version = "0.32"; in let version = "0.32"; in
with lib;
stdenv.mkDerivation { stdenv.mkDerivation {
pname = "bup"; pname = "bup";
inherit version; inherit version;
@ -31,7 +29,7 @@ stdenv.mkDerivation {
postPatch = '' postPatch = ''
patchShebangs . patchShebangs .
substituteInPlace Makefile --replace "-Werror" "" substituteInPlace Makefile --replace "-Werror" ""
'' + optionalString par2Support '' '' + lib.optionalString par2Support ''
substituteInPlace cmd/fsck-cmd.py --replace "'par2'" "'${par2cmdline}/bin/par2'" substituteInPlace cmd/fsck-cmd.py --replace "'par2'" "'${par2cmdline}/bin/par2'"
''; '';
@ -49,7 +47,7 @@ stdenv.mkDerivation {
--prefix PATH : ${git}/bin --prefix PATH : ${git}/bin
''; '';
meta = { meta = with lib; {
homepage = "https://github.com/bup/bup"; homepage = "https://github.com/bup/bup";
description = "Efficient file backup system based on the git packfile format"; description = "Efficient file backup system based on the git packfile format";
license = licenses.gpl2Plus; license = licenses.gpl2Plus;

View file

@ -3,7 +3,6 @@
, rsync, ssh , rsync, ssh
}: }:
with lib;
mkDerivation rec { mkDerivation rec {
pname = "luckybackup"; pname = "luckybackup";
version = "0.5.0"; version = "0.5.0";
@ -26,7 +25,7 @@ mkDerivation rec {
done done
''; '';
meta = { meta = with lib; {
description = "A powerful, fast and reliable backup & sync tool"; description = "A powerful, fast and reliable backup & sync tool";
longDescription = '' longDescription = ''
luckyBackup is an application for data back-up and synchronization luckyBackup is an application for data back-up and synchronization

View file

@ -9,8 +9,6 @@
# TODO: aptxSupport # TODO: aptxSupport
}: }:
with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "bluez-alsa"; pname = "bluez-alsa";
version = "4.0.0"; version = "4.0.0";
@ -28,7 +26,7 @@ stdenv.mkDerivation rec {
alsa-lib bluez glib sbc dbus alsa-lib bluez glib sbc dbus
readline libbsd ncurses readline libbsd ncurses
] ]
++ optional aacSupport fdk_aac; ++ lib.optional aacSupport fdk_aac;
configureFlags = [ configureFlags = [
"--with-alsaplugindir=${placeholder "out"}/lib/alsa-lib" "--with-alsaplugindir=${placeholder "out"}/lib/alsa-lib"
@ -36,9 +34,9 @@ stdenv.mkDerivation rec {
"--enable-rfcomm" "--enable-rfcomm"
"--enable-hcitop" "--enable-hcitop"
] ]
++ optional aacSupport "--enable-aac"; ++ lib.optional aacSupport "--enable-aac";
meta = { meta = with lib; {
description = "Bluez 5 Bluetooth Audio ALSA Backend"; description = "Bluez 5 Bluetooth Audio ALSA Backend";
longDescription = '' longDescription = ''
Bluez-ALSA (BlueALSA) is an ALSA backend for Bluez 5 audio interface. Bluez-ALSA (BlueALSA) is an ALSA backend for Bluez 5 audio interface.

View file

@ -1,8 +1,6 @@
{ lib, stdenv, fetchFromGitHub, autoreconfHook, libtool, fuse, { lib, stdenv, fetchFromGitHub, autoreconfHook, libtool, fuse,
pkg-config, lz4, xz, zlib, lzo, zstd }: pkg-config, lz4, xz, zlib, lzo, zstd }:
with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "squashfuse"; pname = "squashfuse";
@ -22,7 +20,7 @@ stdenv.mkDerivation rec {
description = "FUSE filesystem to mount squashfs archives"; description = "FUSE filesystem to mount squashfs archives";
homepage = "https://github.com/vasi/squashfuse"; homepage = "https://github.com/vasi/squashfuse";
maintainers = [ ]; maintainers = [ ];
platforms = platforms.unix; platforms = lib.platforms.unix;
license = "BSD-2-Clause"; license = "BSD-2-Clause";
}; };
} }

View file

@ -3,8 +3,6 @@
, static ? stdenv.hostPlatform.isStatic , static ? stdenv.hostPlatform.isStatic
}: }:
with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "gifsicle"; pname = "gifsicle";
version = "1.93"; version = "1.93";
@ -14,11 +12,11 @@ stdenv.mkDerivation rec {
sha256 = "sha256-kvZweXMr9MHaCH5q4JBSBYRuWsd3ulyqZtEqc6qUNEc="; sha256 = "sha256-kvZweXMr9MHaCH5q4JBSBYRuWsd3ulyqZtEqc6qUNEc=";
}; };
buildInputs = optionals gifview [ xorgproto libXt libX11 ]; buildInputs = lib.optionals gifview [ xorgproto libXt libX11 ];
configureFlags = optional (!gifview) "--disable-gifview"; configureFlags = lib.optional (!gifview) "--disable-gifview";
LDFLAGS = optionalString static "-static"; LDFLAGS = lib.optionalString static "-static";
doCheck = true; doCheck = true;
checkPhase = '' checkPhase = ''
@ -29,7 +27,7 @@ stdenv.mkDerivation rec {
description = "Command-line tool for creating, editing, and getting information about GIF images and animations"; description = "Command-line tool for creating, editing, and getting information about GIF images and animations";
homepage = "https://www.lcdf.org/gifsicle/"; homepage = "https://www.lcdf.org/gifsicle/";
license = lib.licenses.gpl2; license = lib.licenses.gpl2;
platforms = platforms.all; platforms = lib.platforms.all;
maintainers = with lib.maintainers; [ zimbatm ]; maintainers = with lib.maintainers; [ zimbatm ];
}; };
} }

View file

@ -1,7 +1,5 @@
{ lib, stdenv, fetchFromGitHub, pkgs, pandoc, CoreServices }: { lib, stdenv, fetchFromGitHub, pkgs, pandoc, CoreServices }:
with lib;
let let
# Note for maintainers: # Note for maintainers:
# * keep version in sync with the ldgallery compiler # * keep version in sync with the ldgallery compiler
@ -21,13 +19,13 @@ let
nodePkg = nodePackages.package.override { nodePkg = nodePackages.package.override {
src = "${sourcePkg}/viewer"; src = "${sourcePkg}/viewer";
postInstall = "npm run build"; postInstall = "npm run build";
buildInputs = optionals stdenv.isDarwin [ CoreServices ]; buildInputs = lib.optionals stdenv.isDarwin [ CoreServices ];
}; };
in in
# making sure that the source and the node package are in sync # making sure that the source and the node package are in sync
assert versions.majorMinor nodePkg.version == removePrefix "v" sourcePkg.rev; assert lib.versions.majorMinor nodePkg.version == lib.removePrefix "v" sourcePkg.rev;
stdenv.mkDerivation { stdenv.mkDerivation {
pname = nodePkg.packageName; pname = nodePkg.packageName;

View file

@ -4,8 +4,6 @@
# This package comes with its own copy of zlib, libpng and pngxtern # This package comes with its own copy of zlib, libpng and pngxtern
with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "optipng"; pname = "optipng";
version = "0.7.7"; version = "0.7.7";
@ -17,7 +15,7 @@ stdenv.mkDerivation rec {
buildInputs = [ libpng ]; buildInputs = [ libpng ];
LDFLAGS = optional static "-static"; LDFLAGS = lib.optional static "-static";
# Workaround for crash in cexcept.h. See # Workaround for crash in cexcept.h. See
# https://github.com/NixOS/nixpkgs/issues/28106 # https://github.com/NixOS/nixpkgs/issues/28106
preConfigure = '' preConfigure = ''

View file

@ -1,6 +1,5 @@
{ lib, stdenv, fetchurl, autoconf, automake, libtool, dos2unix, libpgf, freeimage, doxygen }: { lib, stdenv, fetchurl, autoconf, automake, libtool, dos2unix, libpgf, freeimage, doxygen }:
with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "pgf"; pname = "pgf";
version = "6.14.12"; version = "6.14.12";

View file

@ -34,8 +34,6 @@
, nixosTests , nixosTests
}: }:
with lib;
let let
python3Runtime = python3.withPackages (ps: with ps; [ pygobject3 ]); python3Runtime = python3.withPackages (ps: with ps; [ pygobject3 ]);
python3BuildEnv = python3.buildEnv.override { python3BuildEnv = python3.buildEnv.override {
@ -88,10 +86,10 @@ stdenv.mkDerivation rec {
configureFlags = [ configureFlags = [
"--disable-memconf" "--disable-memconf"
(enableFeature (dconf != null) "dconf") (lib.enableFeature (dconf != null) "dconf")
(enableFeature (libnotify != null) "libnotify") (lib.enableFeature (libnotify != null) "libnotify")
(enableFeature withWayland "wayland") (lib.enableFeature withWayland "wayland")
(enableFeature enableUI "ui") (lib.enableFeature enableUI "ui")
"--enable-gtk4" "--enable-gtk4"
"--enable-install-tests" "--enable-install-tests"
"--with-unicode-emoji-dir=${unicode-emoji}/share/unicode/emoji" "--with-unicode-emoji-dir=${unicode-emoji}/share/unicode/emoji"
@ -133,7 +131,7 @@ stdenv.mkDerivation rec {
isocodes isocodes
json-glib json-glib
libnotify libnotify
] ++ optionals withWayland [ ] ++ lib.optionals withWayland [
libxkbcommon libxkbcommon
wayland wayland
]; ];
@ -165,7 +163,7 @@ stdenv.mkDerivation rec {
}; };
}; };
meta = { meta = with lib; {
homepage = "https://github.com/ibus/ibus"; homepage = "https://github.com/ibus/ibus";
description = "Intelligent Input Bus, input method framework"; description = "Intelligent Input Bus, input method framework";
license = licenses.lgpl21Plus; license = licenses.lgpl21Plus;

View file

@ -18,8 +18,6 @@
, withMisc ? false, libeb ? null , withMisc ? false, libeb ? null
}: }:
with lib;
assert withGtk2 -> gtk2 != null; assert withGtk2 -> gtk2 != null;
assert withGtk3 -> gtk3 != null; assert withGtk3 -> gtk3 != null;
@ -59,18 +57,18 @@ stdenv.mkDerivation rec {
buildInputs = [ buildInputs = [
ncurses m17n_lib m17n_db expat ncurses m17n_lib m17n_db expat
] ]
++ optional withAnthy anthy ++ lib.optional withAnthy anthy
++ optional withGtk2 gtk2 ++ lib.optional withGtk2 gtk2
++ optional withGtk3 gtk3 ++ lib.optional withGtk3 gtk3
++ optional withQt4 qt4 ++ lib.optional withQt4 qt4
++ optionals withQt5 [ qt5.qtbase.bin qt5.qtbase.dev ] ++ lib.optionals withQt5 [ qt5.qtbase.bin qt5.qtbase.dev ]
++ optional withLibnotify libnotify ++ lib.optional withLibnotify libnotify
++ optional withSqlite sqlite ++ lib.optional withSqlite sqlite
++ optionals withNetworking [ ++ lib.optionals withNetworking [
curl openssl curl openssl
] ]
++ optional withFFI libffi ++ lib.optional withFFI libffi
++ optional withMisc libeb; ++ lib.optional withMisc libeb;
prePatch = '' prePatch = ''
patchShebangs *.sh */*.sh */*/*.sh patchShebangs *.sh */*.sh */*/*.sh
@ -113,25 +111,25 @@ stdenv.mkDerivation rec {
"--with-xft" "--with-xft"
"--with-expat=${expat.dev}" "--with-expat=${expat.dev}"
] ]
++ optional withAnthy "--with-anthy-utf8" ++ lib.optional withAnthy "--with-anthy-utf8"
++ optional withGtk2 "--with-gtk2" ++ lib.optional withGtk2 "--with-gtk2"
++ optional withGtk3 "--with-gtk3" ++ lib.optional withGtk3 "--with-gtk3"
++ optionals withQt4 [ ++ lib.optionals withQt4 [
"--with-qt4" "--with-qt4"
"--with-qt4-immodule" "--with-qt4-immodule"
] ]
++ optionals withQt5 [ ++ lib.optionals withQt5 [
"--with-qt5" "--with-qt5"
"--with-qt5-immodule" "--with-qt5-immodule"
] ]
++ optional withLibnotify "--enable-notify=libnotify" ++ lib.optional withLibnotify "--enable-notify=libnotify"
++ optional withSqlite "--with-sqlite3" ++ lib.optional withSqlite "--with-sqlite3"
++ optionals withNetworking [ ++ lib.optionals withNetworking [
"--with-curl" "--with-curl"
"--with-openssl-dir=${openssl.dev}" "--with-openssl-dir=${openssl.dev}"
] ]
++ optional withFFI "--with-ffi" ++ lib.optional withFFI "--with-ffi"
++ optional withMisc "--with-eb"; ++ lib.optional withMisc "--with-eb";
# TODO: things in `./configure --help`, but not in nixpkgs # TODO: things in `./configure --help`, but not in nixpkgs
#--with-canna Use Canna [default=no] #--with-canna Use Canna [default=no]

View file

@ -1,7 +1,5 @@
{ lib, stdenv, fetchFromGitHub, cmake } : { lib, stdenv, fetchFromGitHub, cmake } :
with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "catimg"; pname = "catimg";
version = "2.7.0"; version = "2.7.0";
@ -15,7 +13,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake ]; nativeBuildInputs = [ cmake ];
meta = { meta = with lib; {
license = licenses.mit; license = licenses.mit;
homepage = "https://github.com/posva/catimg"; homepage = "https://github.com/posva/catimg";
description = "Insanely fast image printing in your terminal"; description = "Insanely fast image printing in your terminal";

View file

@ -1,7 +1,5 @@
{ lib, stdenv, fetchurl, pkg-config, meson, ninja, glib, libintl }: { lib, stdenv, fetchurl, pkg-config, meson, ninja, glib, libintl }:
with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "desktop-file-utils"; pname = "desktop-file-utils";
version = "0.26"; version = "0.26";
@ -21,7 +19,7 @@ stdenv.mkDerivation rec {
setupHook = ./setup-hook.sh; setupHook = ./setup-hook.sh;
meta = { meta = with lib; {
homepage = "http://www.freedesktop.org/wiki/Software/desktop-file-utils"; homepage = "http://www.freedesktop.org/wiki/Software/desktop-file-utils";
description = "Command line utilities for working with .desktop files"; description = "Command line utilities for working with .desktop files";
platforms = platforms.linux ++ platforms.darwin; platforms = platforms.linux ++ platforms.darwin;

View file

@ -13,7 +13,6 @@
, kbdcompSupport ? false, ckbcomp , kbdcompSupport ? false, ckbcomp
}: }:
with lib;
let let
pcSystems = { pcSystems = {
i686-linux.target = "i386"; i686-linux.target = "i386";
@ -40,8 +39,8 @@ let
riscv64-linux.target = "riscv64"; riscv64-linux.target = "riscv64";
}; };
canEfi = any (system: stdenv.hostPlatform.system == system) (mapAttrsToList (name: _: name) efiSystemsBuild); canEfi = lib.any (system: stdenv.hostPlatform.system == system) (lib.mapAttrsToList (name: _: name) efiSystemsBuild);
inPCSystems = any (system: stdenv.hostPlatform.system == system) (mapAttrsToList (name: _: name) pcSystems); inPCSystems = lib.any (system: stdenv.hostPlatform.system == system) (lib.mapAttrsToList (name: _: name) pcSystems);
version = "2.06"; version = "2.06";
@ -330,8 +329,8 @@ stdenv.mkDerivation rec {
depsBuildBuild = [ buildPackages.stdenv.cc ]; depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ bison flex python3 pkg-config gettext freetype autoreconfHook ]; nativeBuildInputs = [ bison flex python3 pkg-config gettext freetype autoreconfHook ];
buildInputs = [ ncurses libusb-compat-0_1 freetype lvm2 fuse libtool bash ] buildInputs = [ ncurses libusb-compat-0_1 freetype lvm2 fuse libtool bash ]
++ optional doCheck qemu ++ lib.optional doCheck qemu
++ optional zfsSupport zfs; ++ lib.optional zfsSupport zfs;
strictDeps = true; strictDeps = true;
@ -369,7 +368,7 @@ stdenv.mkDerivation rec {
configureFlags = [ configureFlags = [
"--enable-grub-mount" # dep of os-prober "--enable-grub-mount" # dep of os-prober
] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
# grub doesn't do cross-compilation as usual and tries to use unprefixed # grub doesn't do cross-compilation as usual and tries to use unprefixed
# tools to target the host. Provide toolchain information explicitly for # tools to target the host. Provide toolchain information explicitly for
# cross builds. # cross builds.
@ -380,9 +379,9 @@ stdenv.mkDerivation rec {
"TARGET_OBJCOPY=${stdenv.cc.targetPrefix}objcopy" "TARGET_OBJCOPY=${stdenv.cc.targetPrefix}objcopy"
"TARGET_RANLIB=${stdenv.cc.targetPrefix}ranlib" "TARGET_RANLIB=${stdenv.cc.targetPrefix}ranlib"
"TARGET_STRIP=${stdenv.cc.targetPrefix}strip" "TARGET_STRIP=${stdenv.cc.targetPrefix}strip"
] ++ optional zfsSupport "--enable-libzfs" ] ++ lib.optional zfsSupport "--enable-libzfs"
++ optionals efiSupport [ "--with-platform=efi" "--target=${efiSystemsBuild.${stdenv.hostPlatform.system}.target}" "--program-prefix=" ] ++ lib.optionals efiSupport [ "--with-platform=efi" "--target=${efiSystemsBuild.${stdenv.hostPlatform.system}.target}" "--program-prefix=" ]
++ optionals xenSupport [ "--with-platform=xen" "--target=${efiSystemsBuild.${stdenv.hostPlatform.system}.target}"]; ++ lib.optionals xenSupport [ "--with-platform=xen" "--target=${efiSystemsBuild.${stdenv.hostPlatform.system}.target}"];
# save target that grub is compiled for # save target that grub is compiled for
grubTarget = if efiSupport grubTarget = if efiSupport

View file

@ -1,6 +1,5 @@
{ lib, stdenv, grub2_xen }: { lib, stdenv, grub2_xen }:
with lib;
let let
efiSystemsBuild = { efiSystemsBuild = {
i686-linux.target = "i386"; i686-linux.target = "i386";

View file

@ -18,14 +18,13 @@
, for_HP_laptop ? false , for_HP_laptop ? false
}: }:
with lib;
let let
pcSystems = { pcSystems = {
i686-linux.target = "i386"; i686-linux.target = "i386";
x86_64-linux.target = "i386"; x86_64-linux.target = "i386";
}; };
inPCSystems = any (system: stdenv.hostPlatform.system == system) (mapAttrsToList (name: _: name) pcSystems); inPCSystems = lib.any (system: stdenv.hostPlatform.system == system) (lib.mapAttrsToList (name: _: name) pcSystems);
version = if for_HP_laptop then "1.2.1" else "1.2.0"; version = if for_HP_laptop then "1.2.1" else "1.2.0";
@ -59,7 +58,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ autogen flex bison python2 autoconf automake ]; nativeBuildInputs = [ autogen flex bison python2 autoconf automake ];
buildInputs = [ ncurses libusb-compat-0_1 freetype gettext lvm2 ] buildInputs = [ ncurses libusb-compat-0_1 freetype gettext lvm2 ]
++ optional doCheck qemu; ++ lib.optional doCheck qemu;
hardeningDisable = [ "stackprotector" "pic" ]; hardeningDisable = [ "stackprotector" "pic" ];

View file

@ -1,7 +1,5 @@
{ lib, stdenv, fetchFromGitHub }: { lib, stdenv, fetchFromGitHub }:
with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "hexd"; pname = "hexd";
version = "1.1.0"; version = "1.1.0";
@ -15,7 +13,7 @@ stdenv.mkDerivation rec {
makeFlags = [ "PREFIX=$(out)" ]; makeFlags = [ "PREFIX=$(out)" ];
meta = { meta = with lib; {
description = "Colourful, human-friendly hexdump tool"; description = "Colourful, human-friendly hexdump tool";
homepage = "https://github.com/FireyFly/hexd"; homepage = "https://github.com/FireyFly/hexd";
maintainers = [ maintainers.FireyFly ]; maintainers = [ maintainers.FireyFly ];

View file

@ -7,11 +7,9 @@
, jre , jre
}: }:
with lib;
let this = stdenv.mkDerivation rec { let this = stdenv.mkDerivation rec {
version = elk6Version; version = elk6Version;
pname = "logstash${optionalString (!enableUnfree) "-oss"}"; pname = "logstash${lib.optionalString (!enableUnfree) "-oss"}";
src = fetchurl { src = fetchurl {
url = "https://artifacts.elastic.co/downloads/logstash/${pname}-${version}.tar.gz"; url = "https://artifacts.elastic.co/downloads/logstash/${pname}-${version}.tar.gz";
@ -63,7 +61,7 @@ let this = stdenv.mkDerivation rec {
maintainers = with maintainers; [ wjlroe offline basvandijk ]; maintainers = with maintainers; [ wjlroe offline basvandijk ];
}; };
passthru.tests = passthru.tests =
optionalAttrs (!enableUnfree) ( lib.optionalAttrs (!enableUnfree) (
assert this.drvPath == nixosTests.elk.ELK-6.elkPackages.logstash.drvPath; assert this.drvPath == nixosTests.elk.ELK-6.elkPackages.logstash.drvPath;
{ {
elk = nixosTests.elk.ELK-6; elk = nixosTests.elk.ELK-6;

View file

@ -9,12 +9,10 @@
, jre , jre
}: }:
with lib;
let let
info = splitString "-" stdenv.hostPlatform.system; info = lib.splitString "-" stdenv.hostPlatform.system;
arch = elemAt info 0; arch = lib.elemAt info 0;
plat = elemAt info 1; plat = lib.elemAt info 1;
shas = shas =
if enableUnfree if enableUnfree
then { then {
@ -29,7 +27,7 @@ let
}; };
this = stdenv.mkDerivation rec { this = stdenv.mkDerivation rec {
version = elk7Version; version = elk7Version;
pname = "logstash${optionalString (!enableUnfree) "-oss"}"; pname = "logstash${lib.optionalString (!enableUnfree) "-oss"}";
src = fetchurl { src = fetchurl {
@ -79,7 +77,7 @@ let
maintainers = with maintainers; [ wjlroe offline basvandijk ]; maintainers = with maintainers; [ wjlroe offline basvandijk ];
}; };
passthru.tests = passthru.tests =
optionalAttrs (config.allowUnfree && enableUnfree) ( lib.optionalAttrs (config.allowUnfree && enableUnfree) (
assert this.drvPath == nixosTests.elk.unfree.ELK-7.elkPackages.logstash.drvPath; assert this.drvPath == nixosTests.elk.unfree.ELK-7.elkPackages.logstash.drvPath;
{ {
elk = nixosTests.elk.unfree.ELK-7; elk = nixosTests.elk.unfree.ELK-7;

View file

@ -11,7 +11,6 @@
, darwin , darwin
}: }:
with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "moreutils"; pname = "moreutils";
version = "0.67"; version = "0.67";
@ -28,7 +27,7 @@ stdenv.mkDerivation rec {
strictDeps = true; strictDeps = true;
nativeBuildInputs = [ makeWrapper perl libxml2 libxslt docbook-xsl docbook_xml_dtd_44 ]; nativeBuildInputs = [ makeWrapper perl libxml2 libxslt docbook-xsl docbook_xml_dtd_44 ];
buildInputs = optional stdenv.isDarwin darwin.cctools; buildInputs = lib.optional stdenv.isDarwin darwin.cctools;
propagatedBuildInputs = with perlPackages; [ perl IPCRun TimeDate TimeDuration ]; propagatedBuildInputs = with perlPackages; [ perl IPCRun TimeDate TimeDuration ];
@ -40,7 +39,7 @@ stdenv.mkDerivation rec {
wrapProgram $out/bin/ts --prefix PERL5LIB : $PERL5LIB wrapProgram $out/bin/ts --prefix PERL5LIB : $PERL5LIB
''; '';
meta = { meta = with lib; {
description = "Growing collection of the unix tools that nobody thought to write long ago when unix was young"; description = "Growing collection of the unix tools that nobody thought to write long ago when unix was young";
homepage = "https://joeyh.name/code/moreutils/"; homepage = "https://joeyh.name/code/moreutils/";
maintainers = with maintainers; [ koral pSub ]; maintainers = with maintainers; [ koral pSub ];

View file

@ -1,7 +1,5 @@
{ lib, stdenv, fetchFromGitHub }: { lib, stdenv, fetchFromGitHub }:
with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "pixd"; pname = "pixd";
version = "1.0.0"; version = "1.0.0";
@ -15,7 +13,7 @@ stdenv.mkDerivation rec {
makeFlags = [ "PREFIX=$(out)" ]; makeFlags = [ "PREFIX=$(out)" ];
meta = { meta = with lib; {
description = "Colourful visualization tool for binary files"; description = "Colourful visualization tool for binary files";
homepage = "https://github.com/FireyFly/pixd"; homepage = "https://github.com/FireyFly/pixd";
maintainers = [ maintainers.FireyFly ]; maintainers = [ maintainers.FireyFly ];

View file

@ -20,7 +20,6 @@
assert withGui -> !stdenv.isDarwin; assert withGui -> !stdenv.isDarwin;
with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "rmlint"; pname = "rmlint";
version = "2.10.1"; version = "2.10.1";
@ -78,7 +77,7 @@ stdenv.mkDerivation rec {
gappsWrapperArgs+=(--prefix PYTHONPATH : "$(toPythonPath $out):$(toPythonPath ${python3.pkgs.pygobject3}):$(toPythonPath ${python3.pkgs.pycairo})") gappsWrapperArgs+=(--prefix PYTHONPATH : "$(toPythonPath $out):$(toPythonPath ${python3.pkgs.pygobject3}):$(toPythonPath ${python3.pkgs.pycairo})")
''; '';
meta = { meta = with lib; {
description = "Extremely fast tool to remove duplicates and other lint from your filesystem"; description = "Extremely fast tool to remove duplicates and other lint from your filesystem";
homepage = "https://rmlint.readthedocs.org"; homepage = "https://rmlint.readthedocs.org";
platforms = platforms.unix; platforms = platforms.unix;

View file

@ -5,14 +5,13 @@
, nixosTests , nixosTests
}: }:
with lib;
let let
copts = concatStringsSep " " ([ copts = lib.concatStringsSep " " ([
"-DHAVE_IDN" "-DHAVE_IDN"
"-DHAVE_DNSSEC" "-DHAVE_DNSSEC"
] ++ optionals dbusSupport [ ] ++ lib.optionals dbusSupport [
"-DHAVE_DBUS" "-DHAVE_DBUS"
] ++ optionals stdenv.isLinux [ ] ++ lib.optionals stdenv.isLinux [
"-DHAVE_CONNTRACK" "-DHAVE_CONNTRACK"
]); ]);
in in
@ -43,7 +42,7 @@ stdenv.mkDerivation rec {
hardeningEnable = [ "pie" ]; hardeningEnable = [ "pie" ];
postBuild = optionalString stdenv.isLinux '' postBuild = lib.optionalString stdenv.isLinux ''
make -C contrib/lease-tools make -C contrib/lease-tools
''; '';
@ -51,17 +50,17 @@ stdenv.mkDerivation rec {
# module can create it in Nix-land? # module can create it in Nix-land?
postInstall = '' postInstall = ''
install -Dm644 trust-anchors.conf $out/share/dnsmasq/trust-anchors.conf install -Dm644 trust-anchors.conf $out/share/dnsmasq/trust-anchors.conf
'' + optionalString stdenv.isDarwin '' '' + lib.optionalString stdenv.isDarwin ''
install -Dm644 contrib/MacOSX-launchd/uk.org.thekelleys.dnsmasq.plist \ install -Dm644 contrib/MacOSX-launchd/uk.org.thekelleys.dnsmasq.plist \
$out/Library/LaunchDaemons/uk.org.thekelleys.dnsmasq.plist $out/Library/LaunchDaemons/uk.org.thekelleys.dnsmasq.plist
substituteInPlace $out/Library/LaunchDaemons/uk.org.thekelleys.dnsmasq.plist \ substituteInPlace $out/Library/LaunchDaemons/uk.org.thekelleys.dnsmasq.plist \
--replace "/usr/local/sbin" "$out/bin" --replace "/usr/local/sbin" "$out/bin"
'' + optionalString stdenv.isLinux '' '' + lib.optionalString stdenv.isLinux ''
install -Dm755 contrib/lease-tools/dhcp_lease_time $out/bin/dhcp_lease_time install -Dm755 contrib/lease-tools/dhcp_lease_time $out/bin/dhcp_lease_time
install -Dm755 contrib/lease-tools/dhcp_release $out/bin/dhcp_release install -Dm755 contrib/lease-tools/dhcp_release $out/bin/dhcp_release
install -Dm755 contrib/lease-tools/dhcp_release6 $out/bin/dhcp_release6 install -Dm755 contrib/lease-tools/dhcp_release6 $out/bin/dhcp_release6
'' + optionalString dbusSupport '' '' + lib.optionalString dbusSupport ''
install -Dm644 dbus/dnsmasq.conf $out/share/dbus-1/system.d/dnsmasq.conf install -Dm644 dbus/dnsmasq.conf $out/share/dbus-1/system.d/dnsmasq.conf
mkdir -p $out/share/dbus-1/system-services mkdir -p $out/share/dbus-1/system-services
cat <<END > $out/share/dbus-1/system-services/uk.org.thekelleys.dnsmasq.service cat <<END > $out/share/dbus-1/system-services/uk.org.thekelleys.dnsmasq.service
@ -75,8 +74,8 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkg-config ]; nativeBuildInputs = [ pkg-config ];
buildInputs = [ nettle libidn ] buildInputs = [ nettle libidn ]
++ optionals dbusSupport [ dbus ] ++ lib.optionals dbusSupport [ dbus ]
++ optionals stdenv.isLinux [ libnetfilter_conntrack ]; ++ lib.optionals stdenv.isLinux [ libnetfilter_conntrack ];
passthru.tests = { passthru.tests = {
prometheus-exporter = nixosTests.prometheus-exporters.dnsmasq; prometheus-exporter = nixosTests.prometheus-exporters.dnsmasq;
@ -87,7 +86,7 @@ stdenv.mkDerivation rec {
kubernetes-dns-multi = nixosTests.kubernetes.dns-multi-node; kubernetes-dns-multi = nixosTests.kubernetes.dns-multi-node;
}; };
meta = { meta = with lib; {
description = "An integrated DNS, DHCP and TFTP server for small networks"; description = "An integrated DNS, DHCP and TFTP server for small networks";
homepage = "https://www.thekelleys.org.uk/dnsmasq/doc.html"; homepage = "https://www.thekelleys.org.uk/dnsmasq/doc.html";
license = licenses.gpl2; license = licenses.gpl2;

View file

@ -1,7 +1,5 @@
{ lib, buildGoModule, fetchFromGitHub, nixosTests }: { lib, buildGoModule, fetchFromGitHub, nixosTests }:
with lib;
buildGoModule rec { buildGoModule rec {
pname = "flannel"; pname = "flannel";
version = "0.20.2"; version = "0.20.2";
@ -23,7 +21,7 @@ buildGoModule rec {
passthru.tests = { inherit (nixosTests) flannel; }; passthru.tests = { inherit (nixosTests) flannel; };
meta = { meta = with lib; {
description = "Network fabric for containers, designed for Kubernetes"; description = "Network fabric for containers, designed for Kubernetes";
license = licenses.asl20; license = licenses.asl20;
homepage = "https://github.com/flannel-io/flannel"; homepage = "https://github.com/flannel-io/flannel";

View file

@ -1,7 +1,5 @@
{ lib, stdenv, fetchurl }: { lib, stdenv, fetchurl }:
with lib;
let let
arch = arch =
if stdenv.hostPlatform.system == "x86_64-linux" then "x64" if stdenv.hostPlatform.system == "x86_64-linux" then "x64"

View file

@ -1,7 +1,5 @@
{ lib, stdenv, fetchFromGitHub, autoreconfHook, systemd, pkg-config }: { lib, stdenv, fetchFromGitHub, autoreconfHook, systemd, pkg-config }:
with lib;
stdenv.mkDerivation { stdenv.mkDerivation {
version = "1.06"; version = "1.06";
pname = "ndjbdns"; pname = "ndjbdns";
@ -15,9 +13,9 @@ stdenv.mkDerivation {
nativeBuildInputs = [ autoreconfHook pkg-config ]; nativeBuildInputs = [ autoreconfHook pkg-config ];
buildInputs = [ ] buildInputs = [ ]
++ optional stdenv.isLinux systemd; ++ lib.optional stdenv.isLinux systemd;
meta = { meta = with lib; {
description = "A brand new release of the Djbdns"; description = "A brand new release of the Djbdns";
longDescription = '' longDescription = ''
Djbdns is a fullyfledged Domain Name System(DNS), originally written by the eminent author of qmail, Dr. D J Bernstein. Djbdns is a fullyfledged Domain Name System(DNS), originally written by the eminent author of qmail, Dr. D J Bernstein.

View file

@ -1,7 +1,5 @@
{ lib, stdenv, fetchurl }: { lib, stdenv, fetchurl }:
with lib;
let versions = lib.importJSON ./versions.json; let versions = lib.importJSON ./versions.json;
arch = if stdenv.isi686 then "386" arch = if stdenv.isi686 then "386"
else if stdenv.isx86_64 then "amd64" else if stdenv.isx86_64 then "amd64"
@ -37,10 +35,10 @@ stdenv.mkDerivation {
# Stripping causes SEGFAULT on x86_64-darwin # Stripping causes SEGFAULT on x86_64-darwin
dontStrip = true; dontStrip = true;
meta = { meta = with lib; {
description = "Allows you to expose a web server running on your local machine to the internet"; description = "Allows you to expose a web server running on your local machine to the internet";
homepage = "https://ngrok.com/"; homepage = "https://ngrok.com/";
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.unfree; license = licenses.unfree;
platforms = [ "i686-linux" "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; platforms = [ "i686-linux" "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
maintainers = with maintainers; [ bobvanderlinden brodes ]; maintainers = with maintainers; [ bobvanderlinden brodes ];

View file

@ -30,7 +30,6 @@
, linkOpenssl ? true , linkOpenssl ? true
}: }:
with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
inherit pname version src; inherit pname version src;
@ -57,12 +56,12 @@ stdenv.mkDerivation rec {
# This is not the same as the libkrb5 from the inputs! pkgs.libkrb5 is # This is not the same as the libkrb5 from the inputs! pkgs.libkrb5 is
# needed here to access krb5-config in order to cross compile. See: # needed here to access krb5-config in order to cross compile. See:
# https://github.com/NixOS/nixpkgs/pull/107606 # https://github.com/NixOS/nixpkgs/pull/107606
++ optional withKerberos pkgs.libkrb5 ++ lib.optional withKerberos pkgs.libkrb5
++ extraNativeBuildInputs; ++ extraNativeBuildInputs;
buildInputs = [ zlib openssl libedit ] buildInputs = [ zlib openssl libedit ]
++ optional withFIDO libfido2 ++ lib.optional withFIDO libfido2
++ optional withKerberos libkrb5 ++ lib.optional withKerberos libkrb5
++ optional stdenv.isLinux pam; ++ lib.optional stdenv.isLinux pam;
preConfigure = '' preConfigure = ''
# Setting LD causes `configure' and `make' to disagree about which linker # Setting LD causes `configure' and `make' to disagree about which linker
@ -80,11 +79,11 @@ stdenv.mkDerivation rec {
"--with-libedit=yes" "--with-libedit=yes"
"--disable-strip" "--disable-strip"
(if stdenv.isLinux then "--with-pam" else "--without-pam") (if stdenv.isLinux then "--with-pam" else "--without-pam")
] ++ optional (etcDir != null) "--sysconfdir=${etcDir}" ] ++ lib.optional (etcDir != null) "--sysconfdir=${etcDir}"
++ optional withFIDO "--with-security-key-builtin=yes" ++ lib.optional withFIDO "--with-security-key-builtin=yes"
++ optional withKerberos (assert libkrb5 != null; "--with-kerberos5=${libkrb5}") ++ lib.optional withKerberos (assert libkrb5 != null; "--with-kerberos5=${libkrb5}")
++ optional stdenv.isDarwin "--disable-libutil" ++ lib.optional stdenv.isDarwin "--disable-libutil"
++ optional (!linkOpenssl) "--without-openssl" ++ lib.optional (!linkOpenssl) "--without-openssl"
++ extraConfigureFlags; ++ extraConfigureFlags;
${if stdenv.hostPlatform.isStatic then "NIX_LDFLAGS" else null}= [ "-laudit" ] ++ lib.optionals withKerberos [ "-lkeyutils" ]; ${if stdenv.hostPlatform.isStatic then "NIX_LDFLAGS" else null}= [ "-laudit" ] ++ lib.optionals withKerberos [ "-lkeyutils" ];
@ -97,7 +96,7 @@ stdenv.mkDerivation rec {
doCheck = true; doCheck = true;
enableParallelChecking = false; enableParallelChecking = false;
nativeCheckInputs = optional (!stdenv.isDarwin) hostname; nativeCheckInputs = lib.optional (!stdenv.isDarwin) hostname;
preCheck = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' preCheck = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
# construct a dummy HOME # construct a dummy HOME
export HOME=$(realpath ../dummy-home) export HOME=$(realpath ../dummy-home)
@ -145,7 +144,7 @@ stdenv.mkDerivation rec {
# integration tests hard to get working on darwin with its shaky # integration tests hard to get working on darwin with its shaky
# sandbox # sandbox
# t-exec tests fail on musl # t-exec tests fail on musl
checkTarget = optional (!stdenv.isDarwin && !stdenv.hostPlatform.isMusl) "t-exec" checkTarget = lib.optional (!stdenv.isDarwin && !stdenv.hostPlatform.isMusl) "t-exec"
# other tests are less demanding of the environment # other tests are less demanding of the environment
++ [ "unit" "file-tests" "interop-tests" ]; ++ [ "unit" "file-tests" "interop-tests" ];
@ -165,7 +164,7 @@ stdenv.mkDerivation rec {
borgbackup-integration = nixosTests.borgbackup; borgbackup-integration = nixosTests.borgbackup;
}; };
meta = { meta = with lib; {
description = "An implementation of the SSH protocol${extraDesc}"; description = "An implementation of the SSH protocol${extraDesc}";
homepage = "https://www.openssh.com/"; homepage = "https://www.openssh.com/";
changelog = "https://www.openssh.com/releasenotes.html"; changelog = "https://www.openssh.com/releasenotes.html";

View file

@ -3,8 +3,6 @@
, fetchFromGitHub , fetchFromGitHub
}: }:
with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "snabb"; pname = "snabb";
version = "2022.10"; version = "2022.10";
@ -21,7 +19,7 @@ stdenv.mkDerivation rec {
cp src/snabb $out/bin cp src/snabb $out/bin
''; '';
meta = { meta = with lib; {
homepage = "https://github.com/SnabbCo/snabbswitch"; homepage = "https://github.com/SnabbCo/snabbswitch";
description = "Simple and fast packet networking toolkit"; description = "Simple and fast packet networking toolkit";
longDescription = '' longDescription = ''

View file

@ -14,8 +14,6 @@
# strongswan curl plugin may break. # strongswan curl plugin may break.
# See https://wiki.strongswan.org/projects/strongswan/wiki/Curl for more info. # See https://wiki.strongswan.org/projects/strongswan/wiki/Curl for more info.
with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "strongswan"; pname = "strongswan";
version = "5.9.8"; # Make sure to also update <nixpkgs/nixos/modules/services/networking/strongswan-swanctl/swanctl-params.nix> when upgrading! version = "5.9.8"; # Make sure to also update <nixpkgs/nixos/modules/services/networking/strongswan-swanctl/swanctl-params.nix> when upgrading!
@ -32,10 +30,10 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkg-config autoreconfHook perl gperf bison flex ]; nativeBuildInputs = [ pkg-config autoreconfHook perl gperf bison flex ];
buildInputs = buildInputs =
[ curl gmp python3 ldns unbound openssl pcsclite ] [ curl gmp python3 ldns unbound openssl pcsclite ]
++ optionals enableTNC [ trousers sqlite libxml2 ] ++ lib.optionals enableTNC [ trousers sqlite libxml2 ]
++ optionals stdenv.isLinux [ systemd.dev pam iptables ] ++ lib.optionals stdenv.isLinux [ systemd.dev pam iptables ]
++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ SystemConfiguration ]) ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ SystemConfiguration ])
++ optionals enableNetworkManager [ networkmanager glib ]; ++ lib.optionals enableNetworkManager [ networkmanager glib ];
patches = [ patches = [
./ext_auth-path.patch ./ext_auth-path.patch
@ -43,7 +41,7 @@ stdenv.mkDerivation rec {
./updown-path.patch ./updown-path.patch
]; ];
postPatch = optionalString stdenv.isLinux '' postPatch = lib.optionalString stdenv.isLinux ''
# glibc-2.26 reorganized internal includes # glibc-2.26 reorganized internal includes
sed '1i#include <stdint.h>' -i src/libstrongswan/utils/utils/memory.h sed '1i#include <stdint.h>' -i src/libstrongswan/utils/utils/memory.h
@ -62,16 +60,16 @@ stdenv.mkDerivation rec {
"--enable-pkcs11" "--enable-eap-sim-pcsc" "--enable-dnscert" "--enable-unbound" "--enable-pkcs11" "--enable-eap-sim-pcsc" "--enable-dnscert" "--enable-unbound"
"--enable-chapoly" "--enable-chapoly"
"--enable-curl" ] "--enable-curl" ]
++ optionals stdenv.isLinux [ ++ lib.optionals stdenv.isLinux [
"--enable-farp" "--enable-dhcp" "--enable-farp" "--enable-dhcp"
"--enable-systemd" "--with-systemdsystemunitdir=${placeholder "out"}/etc/systemd/system" "--enable-systemd" "--with-systemdsystemunitdir=${placeholder "out"}/etc/systemd/system"
"--enable-xauth-pam" "--enable-xauth-pam"
"--enable-forecast" "--enable-forecast"
"--enable-connmark" "--enable-connmark"
"--enable-af-alg" ] "--enable-af-alg" ]
++ optionals stdenv.isx86_64 [ "--enable-aesni" "--enable-rdrand" ] ++ lib.optionals stdenv.isx86_64 [ "--enable-aesni" "--enable-rdrand" ]
++ optional (stdenv.hostPlatform.system == "i686-linux") "--enable-padlock" ++ lib.optional (stdenv.hostPlatform.system == "i686-linux") "--enable-padlock"
++ optionals enableTNC [ ++ lib.optionals enableTNC [
"--disable-gmp" "--disable-aes" "--disable-md5" "--disable-sha1" "--disable-sha2" "--disable-fips-prf" "--disable-gmp" "--disable-aes" "--disable-md5" "--disable-sha1" "--disable-sha2" "--disable-fips-prf"
"--enable-eap-tnc" "--enable-eap-ttls" "--enable-eap-dynamic" "--enable-tnccs-20" "--enable-eap-tnc" "--enable-eap-ttls" "--enable-eap-dynamic" "--enable-tnccs-20"
"--enable-tnc-imc" "--enable-imc-os" "--enable-imc-attestation" "--enable-tnc-imc" "--enable-imc-os" "--enable-imc-attestation"
@ -80,11 +78,11 @@ stdenv.mkDerivation rec {
"--with-tss=trousers" "--with-tss=trousers"
"--enable-aikgen" "--enable-aikgen"
"--enable-sqlite" ] "--enable-sqlite" ]
++ optionals enableNetworkManager [ ++ lib.optionals enableNetworkManager [
"--enable-nm" "--enable-nm"
"--with-nm-ca-dir=/etc/ssl/certs" ] "--with-nm-ca-dir=/etc/ssl/certs" ]
# Taken from: https://wiki.strongswan.org/projects/strongswan/wiki/MacOSX # Taken from: https://wiki.strongswan.org/projects/strongswan/wiki/MacOSX
++ optionals stdenv.isDarwin [ ++ lib.optionals stdenv.isDarwin [
"--disable-systemd" "--disable-systemd"
"--disable-xauth-pam" "--disable-xauth-pam"
"--disable-kernel-netlink" "--disable-kernel-netlink"
@ -100,11 +98,11 @@ stdenv.mkDerivation rec {
echo "include /etc/ipsec.secrets" >> $out/etc/ipsec.secrets echo "include /etc/ipsec.secrets" >> $out/etc/ipsec.secrets
''; '';
NIX_LDFLAGS = optionalString stdenv.cc.isGNU "-lgcc_s" ; NIX_LDFLAGS = lib.optionalString stdenv.cc.isGNU "-lgcc_s" ;
passthru.tests = { inherit (nixosTests) strongswan-swanctl; }; passthru.tests = { inherit (nixosTests) strongswan-swanctl; };
meta = { meta = with lib; {
description = "OpenSource IPsec-based VPN Solution"; description = "OpenSource IPsec-based VPN Solution";
homepage = "https://www.strongswan.org"; homepage = "https://www.strongswan.org";
license = licenses.gpl2Plus; license = licenses.gpl2Plus;

View file

@ -8,8 +8,6 @@
, nixosTests , nixosTests
}: }:
with lib;
let let
rev = "e4675e38ab54942e351c7686e40fabec822120b9"; rev = "e4675e38ab54942e351c7686e40fabec822120b9";
sha256 = "1wm24p6pkxl1d7hrvf4ph6mwzawvqi22c60z9xzndn5xfyr4v0yr"; sha256 = "1wm24p6pkxl1d7hrvf4ph6mwzawvqi22c60z9xzndn5xfyr4v0yr";
@ -17,7 +15,7 @@ in
stdenv.mkDerivation { stdenv.mkDerivation {
pname = "nix-serve"; pname = "nix-serve";
version = "0.2-${substring 0 7 rev}"; version = "0.2-${lib.substring 0 7 rev}";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "edolstra"; owner = "edolstra";
@ -33,7 +31,7 @@ stdenv.mkDerivation {
install -Dm0755 nix-serve.psgi $out/libexec/nix-serve/nix-serve.psgi install -Dm0755 nix-serve.psgi $out/libexec/nix-serve/nix-serve.psgi
makeWrapper ${perl.withPackages(p: [ p.DBDSQLite p.Plack p.Starman nix.perl-bindings ])}/bin/starman $out/bin/nix-serve \ makeWrapper ${perl.withPackages(p: [ p.DBDSQLite p.Plack p.Starman nix.perl-bindings ])}/bin/starman $out/bin/nix-serve \
--prefix PATH : "${makeBinPath [ bzip2 nix ]}" \ --prefix PATH : "${lib.makeBinPath [ bzip2 nix ]}" \
--add-flags $out/libexec/nix-serve/nix-serve.psgi --add-flags $out/libexec/nix-serve/nix-serve.psgi
''; '';
@ -42,7 +40,7 @@ stdenv.mkDerivation {
nix-serve-ssh = nixosTests.nix-serve-ssh; nix-serve-ssh = nixosTests.nix-serve-ssh;
}; };
meta = { meta = with lib; {
homepage = "https://github.com/edolstra/nix-serve"; homepage = "https://github.com/edolstra/nix-serve";
description = "A utility for sharing a Nix store as a binary cache"; description = "A utility for sharing a Nix store as a binary cache";
maintainers = [ maintainers.eelco ]; maintainers = [ maintainers.eelco ];

View file

@ -2,8 +2,6 @@
, texinfo, libuuid, flex, bison, pixman, autoconf , texinfo, libuuid, flex, bison, pixman, autoconf
}: }:
with lib;
let let
cpuTarget = if stdenv.hostPlatform.system == "x86_64-linux" then "x86_64-linux-user" cpuTarget = if stdenv.hostPlatform.system == "x86_64-linux" then "x86_64-linux-user"
else if stdenv.hostPlatform.system == "i686-linux" then "i386-linux-user" else if stdenv.hostPlatform.system == "i686-linux" then "i386-linux-user"

View file

@ -2,8 +2,6 @@
, texinfo, libuuid, flex, bison, pixman, autoconf , texinfo, libuuid, flex, bison, pixman, autoconf
}: }:
with lib;
let let
qemuName = "qemu-3.1.0"; qemuName = "qemu-3.1.0";
cpuTarget = if stdenv.targetPlatform.system == "x86_64-linux" then "x86_64-linux-user" cpuTarget = if stdenv.targetPlatform.system == "x86_64-linux" then "x86_64-linux-user"

View file

@ -1,7 +1,5 @@
{ lib, stdenv, fetchFromGitHub, openmp ? null }: { lib, stdenv, fetchFromGitHub, openmp ? null }:
with lib;
stdenv.mkDerivation (finalAttrs: { stdenv.mkDerivation (finalAttrs: {
pname = "b2sum"; pname = "b2sum";
version = "20190724"; version = "20190724";
@ -24,10 +22,10 @@ stdenv.mkDerivation (finalAttrs: {
buildInputs = [ openmp ]; buildInputs = [ openmp ];
buildFlags = [ (optional (openmp == null) "NO_OPENMP=1") ]; buildFlags = [ (lib.optional (openmp == null) "NO_OPENMP=1") ];
installFlags = [ "PREFIX=$(out)" ]; installFlags = [ "PREFIX=$(out)" ];
meta = { meta = with lib; {
description = "The b2sum utility is similar to the md5sum or shasum utilities but for BLAKE2"; description = "The b2sum utility is similar to the md5sum or shasum utilities but for BLAKE2";
homepage = "https://blake2.net"; homepage = "https://blake2.net";
license = with licenses; [ asl20 cc0 openssl ]; license = with licenses; [ asl20 cc0 openssl ];

View file

@ -2,8 +2,6 @@
, gcc, python3Packages, perl, perlPackages, makeWrapper, fetchpatch , gcc, python3Packages, perl, perlPackages, makeWrapper, fetchpatch
}: }:
with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "john"; pname = "john";
version = "1.9.0-jumbo-1"; version = "1.9.0-jumbo-1";
@ -83,7 +81,7 @@ stdenv.mkDerivation rec {
done done
''; '';
meta = { meta = with lib; {
description = "John the Ripper password cracker"; description = "John the Ripper password cracker";
license = licenses.gpl2Plus; license = licenses.gpl2Plus;
homepage = "https://github.com/openwall/john/"; homepage = "https://github.com/openwall/john/";

View file

@ -3,8 +3,6 @@
, luaSupport ? false, lua5, perl , luaSupport ? false, lua5, perl
}: }:
with lib;
let luaValue = if luaSupport then lua5 else "no"; let luaValue = if luaSupport then lua5 else "no";
optional = lib.optional; optional = lib.optional;
in in
@ -49,7 +47,7 @@ stdenv.mkDerivation rec {
cp -R * $nginx cp -R * $nginx
''; '';
meta = { meta = with lib; {
description = "Open source, cross-platform web application firewall (WAF)"; description = "Open source, cross-platform web application firewall (WAF)";
license = licenses.asl20; license = licenses.asl20;
homepage = "https://www.modsecurity.org/"; homepage = "https://www.modsecurity.org/";

View file

@ -6,8 +6,6 @@
, withLua ? true , withLua ? true
}: }:
with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "nmap"; pname = "nmap";
version = "7.93"; version = "7.93";
@ -18,7 +16,7 @@ stdenv.mkDerivation rec {
}; };
patches = [ ./zenmap.patch ] patches = [ ./zenmap.patch ]
++ optionals stdenv.cc.isClang [( ++ lib.optionals stdenv.cc.isClang [(
# Fixes a compile error due an ambiguous reference to bind(2) in # Fixes a compile error due an ambiguous reference to bind(2) in
# nping/EchoServer.cc, which is otherwise resolved to std::bind. # nping/EchoServer.cc, which is otherwise resolved to std::bind.
# https://github.com/nmap/nmap/pull/1363 # https://github.com/nmap/nmap/pull/1363
@ -29,7 +27,7 @@ stdenv.mkDerivation rec {
} }
)]; )];
prePatch = optionalString stdenv.isDarwin '' prePatch = lib.optionalString stdenv.isDarwin ''
substituteInPlace libz/configure \ substituteInPlace libz/configure \
--replace /usr/bin/libtool ar \ --replace /usr/bin/libtool ar \
--replace 'AR="libtool"' 'AR="ar"' \ --replace 'AR="libtool"' 'AR="ar"' \
@ -43,7 +41,7 @@ stdenv.mkDerivation rec {
"--without-zenmap" "--without-zenmap"
]; ];
makeFlags = optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ makeFlags = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
"AR=${stdenv.cc.bintools.targetPrefix}ar" "AR=${stdenv.cc.bintools.targetPrefix}ar"
"RANLIB=${stdenv.cc.bintools.targetPrefix}ranlib" "RANLIB=${stdenv.cc.bintools.targetPrefix}ranlib"
"CC=${stdenv.cc.targetPrefix}gcc" "CC=${stdenv.cc.targetPrefix}gcc"
@ -56,7 +54,7 @@ stdenv.mkDerivation rec {
doCheck = false; # fails 3 tests, probably needs the net doCheck = false; # fails 3 tests, probably needs the net
meta = { meta = with lib; {
description = "A free and open source utility for network discovery and security auditing"; description = "A free and open source utility for network discovery and security auditing";
homepage = "http://www.nmap.org"; homepage = "http://www.nmap.org";
license = licenses.gpl2; license = licenses.gpl2;

View file

@ -11,8 +11,6 @@
, tombPluginSupport ? false , tombPluginSupport ? false
}: }:
with lib;
assert x11Support -> xclip != null; assert x11Support -> xclip != null;
assert waylandSupport -> wl-clipboard != null; assert waylandSupport -> wl-clipboard != null;
@ -35,7 +33,7 @@ let
name = "pass"; name = "pass";
paths = selected; paths = selected;
nativeBuildInputs = [ makeWrapper ]; nativeBuildInputs = [ makeWrapper ];
buildInputs = concatMap (x: x.buildInputs) selected; buildInputs = lib.concatMap (x: x.buildInputs) selected;
postBuild = '' postBuild = ''
files=$(find $out/bin/ -type f -exec readlink -f {} \;) files=$(find $out/bin/ -type f -exec readlink -f {} \;)
@ -79,7 +77,7 @@ stdenv.mkDerivation rec {
# dependencies (s.el) here. The user has to do this themselves. # dependencies (s.el) here. The user has to do this themselves.
mkdir -p "$out/share/emacs/site-lisp" mkdir -p "$out/share/emacs/site-lisp"
cp "contrib/emacs/password-store.el" "$out/share/emacs/site-lisp/" cp "contrib/emacs/password-store.el" "$out/share/emacs/site-lisp/"
'' + optionalString dmenuSupport '' '' + lib.optionalString dmenuSupport ''
cp "contrib/dmenu/passmenu" "$out/bin/" cp "contrib/dmenu/passmenu" "$out/bin/"
''; '';

View file

@ -3,8 +3,6 @@
, libcap, libpcap, libnfnetlink, libnetfilter_conntrack, libnetfilter_queue , libcap, libpcap, libnfnetlink, libnetfilter_conntrack, libnetfilter_queue
}: }:
with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "tcpcrypt"; pname = "tcpcrypt";
version = "0.5"; version = "0.5";
@ -21,11 +19,11 @@ stdenv.mkDerivation rec {
outputs = [ "bin" "dev" "out" ]; outputs = [ "bin" "dev" "out" ];
nativeBuildInputs = [ autoreconfHook ]; nativeBuildInputs = [ autoreconfHook ];
buildInputs = [ openssl libpcap ] buildInputs = [ openssl libpcap ]
++ optionals stdenv.isLinux [ libcap libnfnetlink libnetfilter_conntrack libnetfilter_queue ]; ++ lib.optionals stdenv.isLinux [ libcap libnfnetlink libnetfilter_conntrack libnetfilter_queue ];
enableParallelBuilding = true; enableParallelBuilding = true;
meta = { meta = with lib; {
broken = stdenv.isDarwin; broken = stdenv.isDarwin;
homepage = "http://tcpcrypt.org/"; homepage = "http://tcpcrypt.org/";
description = "Fast TCP encryption"; description = "Fast TCP encryption";

View file

@ -10,8 +10,6 @@
, nix , nix
}: }:
with lib;
let let
downloadPageUrl = "https://dist.torproject.org"; downloadPageUrl = "https://dist.torproject.org";
@ -28,7 +26,7 @@ writeScript "update-tor" ''
set -eu -o pipefail set -eu -o pipefail
export PATH=${makeBinPath [ export PATH=${lib.makeBinPath [
common-updater-scripts common-updater-scripts
coreutils coreutils
curl curl
@ -63,7 +61,7 @@ sigFile=''${sigUrl##*/}
export GNUPGHOME=$PWD/gnupg export GNUPGHOME=$PWD/gnupg
mkdir -m 700 -p "$GNUPGHOME" mkdir -m 700 -p "$GNUPGHOME"
gpg --batch --recv-keys ${concatStringsSep " " (map (x: "'${x}'") signingKeys)} gpg --batch --recv-keys ${lib.concatStringsSep " " (map (x: "'${x}'") signingKeys)}
gpg --batch --verify "$sigFile" "$checksumFile" gpg --batch --verify "$sigFile" "$checksumFile"
sha256sum -c "$checksumFile" sha256sum -c "$checksumFile"

View file

@ -14,8 +14,6 @@
, withDebug ? false , withDebug ? false
}: }:
with lib;
let let
go-d-plugin = callPackage ./go.d.plugin.nix {}; go-d-plugin = callPackage ./go.d.plugin.nix {};
in stdenv.mkDerivation rec { in stdenv.mkDerivation rec {
@ -34,17 +32,17 @@ in stdenv.mkDerivation rec {
nativeBuildInputs = [ autoreconfHook pkg-config makeWrapper protobuf ]; nativeBuildInputs = [ autoreconfHook pkg-config makeWrapper protobuf ];
buildInputs = [ curl jemalloc libuv zlib ] buildInputs = [ curl jemalloc libuv zlib ]
++ optionals stdenv.isDarwin [ CoreFoundation IOKit libossp_uuid ] ++ lib.optionals stdenv.isDarwin [ CoreFoundation IOKit libossp_uuid ]
++ optionals (!stdenv.isDarwin) [ libcap libuuid ] ++ lib.optionals (!stdenv.isDarwin) [ libcap libuuid ]
++ optionals withCups [ cups ] ++ lib.optionals withCups [ cups ]
++ optionals withDBengine [ lz4 ] ++ lib.optionals withDBengine [ lz4 ]
++ optionals withIpmi [ freeipmi ] ++ lib.optionals withIpmi [ freeipmi ]
++ optionals withNetfilter [ libmnl libnetfilter_acct ] ++ lib.optionals withNetfilter [ libmnl libnetfilter_acct ]
++ optionals withCloud [ json_c ] ++ lib.optionals withCloud [ json_c ]
++ optionals withConnPubSub [ google-cloud-cpp grpc ] ++ lib.optionals withConnPubSub [ google-cloud-cpp grpc ]
++ optionals withConnPrometheus [ snappy ] ++ lib.optionals withConnPrometheus [ snappy ]
++ optionals (withCloud || withConnPrometheus) [ protobuf ] ++ lib.optionals (withCloud || withConnPrometheus) [ protobuf ]
++ optionals withSsl [ openssl ]; ++ lib.optionals withSsl [ openssl ];
patches = [ patches = [
# required to prevent plugins from relying on /etc # required to prevent plugins from relying on /etc
@ -68,12 +66,12 @@ in stdenv.mkDerivation rec {
# We pick zlib.dev as a simple canary package with pkg-config input. # We pick zlib.dev as a simple canary package with pkg-config input.
disallowedReferences = [ zlib.dev ]; disallowedReferences = [ zlib.dev ];
NIX_CFLAGS_COMPILE = optionalString withDebug "-O1 -ggdb -DNETDATA_INTERNAL_CHECKS=1"; NIX_CFLAGS_COMPILE = lib.optionalString withDebug "-O1 -ggdb -DNETDATA_INTERNAL_CHECKS=1";
postInstall = '' postInstall = ''
ln -s ${go-d-plugin}/lib/netdata/conf.d/* $out/lib/netdata/conf.d ln -s ${go-d-plugin}/lib/netdata/conf.d/* $out/lib/netdata/conf.d
ln -s ${go-d-plugin}/bin/godplugin $out/libexec/netdata/plugins.d/go.d.plugin ln -s ${go-d-plugin}/bin/godplugin $out/libexec/netdata/plugins.d/go.d.plugin
'' + optionalString (!stdenv.isDarwin) '' '' + lib.optionalString (!stdenv.isDarwin) ''
# rename this plugin so netdata will look for setuid wrapper # rename this plugin so netdata will look for setuid wrapper
mv $out/libexec/netdata/plugins.d/apps.plugin \ mv $out/libexec/netdata/plugins.d/apps.plugin \
$out/libexec/netdata/plugins.d/apps.plugin.org $out/libexec/netdata/plugins.d/apps.plugin.org
@ -83,13 +81,13 @@ in stdenv.mkDerivation rec {
$out/libexec/netdata/plugins.d/perf.plugin.org $out/libexec/netdata/plugins.d/perf.plugin.org
mv $out/libexec/netdata/plugins.d/slabinfo.plugin \ mv $out/libexec/netdata/plugins.d/slabinfo.plugin \
$out/libexec/netdata/plugins.d/slabinfo.plugin.org $out/libexec/netdata/plugins.d/slabinfo.plugin.org
${optionalString withIpmi '' ${lib.optionalString withIpmi ''
mv $out/libexec/netdata/plugins.d/freeipmi.plugin \ mv $out/libexec/netdata/plugins.d/freeipmi.plugin \
$out/libexec/netdata/plugins.d/freeipmi.plugin.org $out/libexec/netdata/plugins.d/freeipmi.plugin.org
''} ''}
''; '';
preConfigure = optionalString (!stdenv.isDarwin) '' preConfigure = lib.optionalString (!stdenv.isDarwin) ''
substituteInPlace collectors/python.d.plugin/python_modules/third_party/lm_sensors.py \ substituteInPlace collectors/python.d.plugin/python_modules/third_party/lm_sensors.py \
--replace 'ctypes.util.find_library("sensors")' '"${lm_sensors.out}/lib/libsensors${stdenv.hostPlatform.extensions.sharedLibrary}"' --replace 'ctypes.util.find_library("sensors")' '"${lm_sensors.out}/lib/libsensors${stdenv.hostPlatform.extensions.sharedLibrary}"'
''; '';
@ -99,9 +97,9 @@ in stdenv.mkDerivation rec {
"--sysconfdir=/etc" "--sysconfdir=/etc"
"--disable-ebpf" "--disable-ebpf"
"--with-jemalloc=${jemalloc}" "--with-jemalloc=${jemalloc}"
] ++ optionals (!withDBengine) [ ] ++ lib.optionals (!withDBengine) [
"--disable-dbengine" "--disable-dbengine"
] ++ optionals (!withCloud) [ ] ++ lib.optionals (!withCloud) [
"--disable-cloud" "--disable-cloud"
]; ];
@ -116,7 +114,7 @@ in stdenv.mkDerivation rec {
tests.netdata = nixosTests.netdata; tests.netdata = nixosTests.netdata;
}; };
meta = { meta = with lib; {
broken = stdenv.isDarwin || stdenv.buildPlatform != stdenv.hostPlatform; broken = stdenv.isDarwin || stdenv.buildPlatform != stdenv.hostPlatform;
description = "Real-time performance monitoring tool"; description = "Real-time performance monitoring tool";
homepage = "https://www.netdata.cloud/"; homepage = "https://www.netdata.cloud/";

View file

@ -1,7 +1,5 @@
{ lib, stdenv, fetchurl }: { lib, stdenv, fetchurl }:
with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "socklog"; pname = "socklog";
version = "2.1.0"; version = "2.1.0";
@ -49,7 +47,7 @@ stdenv.mkDerivation rec {
doCheck = true; doCheck = true;
meta = { meta = with lib; {
broken = stdenv.isDarwin; broken = stdenv.isDarwin;
description = "System and kernel logging services"; description = "System and kernel logging services";
homepage = "http://smarden.org/socklog/"; homepage = "http://smarden.org/socklog/";

View file

@ -1,7 +1,5 @@
{ lib, stdenv, fetchFromGitHub, makeWrapper, perlPackages, beancount }: { lib, stdenv, fetchFromGitHub, makeWrapper, perlPackages, beancount }:
with lib;
let let
perlDeps = with perlPackages; [ perlDeps = with perlPackages; [
DateCalc DateCalc
@ -44,7 +42,7 @@ in stdenv.mkDerivation rec {
--set PERL5LIB "${perlPackages.makeFullPerlPath perlDeps}" --set PERL5LIB "${perlPackages.makeFullPerlPath perlDeps}"
''; '';
meta = { meta = with lib; {
description = "Ledger to Beancount text-based converter"; description = "Ledger to Beancount text-based converter";
longDescription = '' longDescription = ''
A script to automatically convert Ledger-based textual ledgers to Beancount ones. A script to automatically convert Ledger-based textual ledgers to Beancount ones.

View file

@ -12,7 +12,6 @@
assert (gnutlsSupport || opensslSupport); assert (gnutlsSupport || opensslSupport);
with lib;
stdenv.mkDerivation { stdenv.mkDerivation {
pname = "rtmpdump"; pname = "rtmpdump";
version = "unstable-2021-02-19"; version = "unstable-2021-02-19";
@ -36,20 +35,20 @@ stdenv.mkDerivation {
"prefix=$(out)" "prefix=$(out)"
"CROSS_COMPILE=${stdenv.cc.targetPrefix}" "CROSS_COMPILE=${stdenv.cc.targetPrefix}"
] ]
++ optional gnutlsSupport "CRYPTO=GNUTLS" ++ lib.optional gnutlsSupport "CRYPTO=GNUTLS"
++ optional opensslSupport "CRYPTO=OPENSSL" ++ lib.optional opensslSupport "CRYPTO=OPENSSL"
++ optional stdenv.isDarwin "SYS=darwin" ++ lib.optional stdenv.isDarwin "SYS=darwin"
++ optional stdenv.cc.isClang "CC=clang"; ++ lib.optional stdenv.cc.isClang "CC=clang";
propagatedBuildInputs = [ zlib ] propagatedBuildInputs = [ zlib ]
++ optionals gnutlsSupport [ gnutls nettle ] ++ lib.optionals gnutlsSupport [ gnutls nettle ]
++ optional opensslSupport openssl; ++ lib.optional opensslSupport openssl;
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
separateDebugInfo = true; separateDebugInfo = true;
meta = { meta = with lib; {
description = "Toolkit for RTMP streams"; description = "Toolkit for RTMP streams";
homepage = "https://rtmpdump.mplayerhq.hu/"; homepage = "https://rtmpdump.mplayerhq.hu/";
license = licenses.gpl2; license = licenses.gpl2;