treewide: remove global with lib; in pkgs/{misc,networking}

This commit is contained in:
Shawn8901 2023-01-24 17:29:20 +01:00
parent c0aeb33054
commit 0a1dd3ced1
35 changed files with 157 additions and 219 deletions

View file

@ -16,7 +16,6 @@
, embree, gmp, libharu , embree, gmp, libharu
}: }:
with lib;
let let
python = python310Packages.python; python = python310Packages.python;
optix = fetchzip { optix = fetchzip {
@ -38,7 +37,7 @@ stdenv.mkDerivation rec {
patches = lib.optional stdenv.isDarwin ./darwin.patch; patches = lib.optional stdenv.isDarwin ./darwin.patch;
nativeBuildInputs = [ cmake makeWrapper python310Packages.wrapPython llvmPackages.llvm.dev ] nativeBuildInputs = [ cmake makeWrapper python310Packages.wrapPython llvmPackages.llvm.dev ]
++ optionals cudaSupport [ addOpenGLRunpath ]; ++ lib.optionals cudaSupport [ addOpenGLRunpath ];
buildInputs = buildInputs =
[ boost ffmpeg gettext glew ilmbase [ boost ffmpeg gettext glew ilmbase
freetype libjpeg libpng libsamplerate libsndfile libtiff libwebp freetype libjpeg libpng libsamplerate libsndfile libtiff libwebp
@ -63,10 +62,10 @@ stdenv.mkDerivation rec {
else [ else [
llvmPackages.openmp SDL Cocoa CoreGraphics ForceFeedback OpenAL OpenGL llvmPackages.openmp SDL Cocoa CoreGraphics ForceFeedback OpenAL OpenGL
]) ])
++ optional jackaudioSupport libjack2 ++ lib.optional jackaudioSupport libjack2
++ optional cudaSupport cudaPackages.cudatoolkit ++ lib.optional cudaSupport cudaPackages.cudatoolkit
++ optional colladaSupport opencollada ++ lib.optional colladaSupport opencollada
++ optional spaceNavSupport libspnav; ++ lib.optional spaceNavSupport libspnav;
pythonPath = with python310Packages; [ numpy requests ]; pythonPath = with python310Packages; [ numpy requests ];
postPatch = '' postPatch = ''
@ -118,16 +117,16 @@ stdenv.mkDerivation rec {
"-DWITH_IMAGE_OPENJPEG=ON" "-DWITH_IMAGE_OPENJPEG=ON"
"-DWITH_OPENCOLLADA=${if colladaSupport then "ON" else "OFF"}" "-DWITH_OPENCOLLADA=${if colladaSupport then "ON" else "OFF"}"
] ]
++ optionals stdenv.isDarwin [ ++ lib.optionals stdenv.isDarwin [
"-DWITH_CYCLES_OSL=OFF" # requires LLVM "-DWITH_CYCLES_OSL=OFF" # requires LLVM
"-DWITH_OPENVDB=OFF" # OpenVDB currently doesn't build on darwin "-DWITH_OPENVDB=OFF" # OpenVDB currently doesn't build on darwin
"-DLIBDIR=/does-not-exist" "-DLIBDIR=/does-not-exist"
] ]
# Clang doesn't support "-export-dynamic" # Clang doesn't support "-export-dynamic"
++ optional stdenv.cc.isClang "-DPYTHON_LINKFLAGS=" ++ lib.optional stdenv.cc.isClang "-DPYTHON_LINKFLAGS="
++ optional jackaudioSupport "-DWITH_JACK=ON" ++ lib.optional jackaudioSupport "-DWITH_JACK=ON"
++ optionals cudaSupport [ ++ lib.optionals cudaSupport [
"-DWITH_CYCLES_CUDA_BINARIES=ON" "-DWITH_CYCLES_CUDA_BINARIES=ON"
"-DWITH_CYCLES_DEVICE_OPTIX=ON" "-DWITH_CYCLES_DEVICE_OPTIX=ON"
"-DOPTIX_ROOT_DIR=${optix}" "-DOPTIX_ROOT_DIR=${optix}"
@ -137,7 +136,7 @@ stdenv.mkDerivation rec {
# Since some dependencies are built with gcc 6, we need gcc 6's # Since some dependencies are built with gcc 6, we need gcc 6's
# libstdc++ in our RPATH. Sigh. # libstdc++ in our RPATH. Sigh.
NIX_LDFLAGS = optionalString cudaSupport "-rpath ${stdenv.cc.cc.lib}/lib"; NIX_LDFLAGS = lib.optionalString cudaSupport "-rpath ${stdenv.cc.cc.lib}/lib";
blenderExecutable = blenderExecutable =
placeholder "out" + (if stdenv.isDarwin then "/Applications/Blender.app/Contents/MacOS/Blender" else "/bin/blender"); placeholder "out" + (if stdenv.isDarwin then "/Applications/Blender.app/Contents/MacOS/Blender" else "/bin/blender");
@ -154,7 +153,7 @@ stdenv.mkDerivation rec {
# Set RUNPATH so that libcuda and libnvrtc in /run/opengl-driver(-32)/lib can be # Set RUNPATH so that libcuda and libnvrtc in /run/opengl-driver(-32)/lib can be
# found. See the explanation in libglvnd. # found. See the explanation in libglvnd.
postFixup = optionalString cudaSupport '' postFixup = lib.optionalString cudaSupport ''
for program in $out/bin/blender $out/bin/.blender-wrapped; do for program in $out/bin/blender $out/bin/.blender-wrapped; do
isELF "$program" || continue isELF "$program" || continue
addOpenGLRunpath "$program" addOpenGLRunpath "$program"

View file

@ -10,8 +10,6 @@
, nix , nix
}: }:
with lib;
let let
downloadPageUrl = "https://download.electrum.org"; downloadPageUrl = "https://download.electrum.org";
@ -23,7 +21,7 @@ writeScript "update-electrum" ''
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
@ -50,7 +48,7 @@ sigFile=$srcFile.asc
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" "$srcFile" gpg --batch --verify "$sigFile" "$srcFile"
sha256=$(nix-prefetch-url --type sha256 "file://$PWD/$srcFile") sha256=$(nix-prefetch-url --type sha256 "file://$PWD/$srcFile")

View file

@ -25,8 +25,6 @@
, enableSystemd ? false , enableSystemd ? false
}: }:
with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "elogind"; pname = "elogind";
version = "246.10"; version = "246.10";
@ -72,7 +70,7 @@ stdenv.mkDerivation rec {
"-Dsysconfdir=${placeholder "out"}/etc" "-Dsysconfdir=${placeholder "out"}/etc"
]; ];
meta = { meta = with lib; {
homepage = "https://github.com/elogind/elogind"; homepage = "https://github.com/elogind/elogind";
description = ''The systemd project's "logind", extracted to a standalone package''; description = ''The systemd project's "logind", extracted to a standalone package'';
platforms = platforms.linux; # probably more platforms = platforms.linux; # probably more

View file

@ -4,8 +4,6 @@
, postgresSupport ? false, postgresql ? null , postgresSupport ? false, postgresql ? null
}: }:
with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "gammu"; pname = "gammu";
version = "1.42.0"; version = "1.42.0";
@ -31,10 +29,10 @@ stdenv.mkDerivation rec {
strictDeps = true; strictDeps = true;
buildInputs = [ bash bluez libusb1 curl gettext sqlite libiconv ] buildInputs = [ bash bluez libusb1 curl gettext sqlite libiconv ]
++ optionals dbiSupport [ libdbi libdbiDrivers ] ++ lib.optionals dbiSupport [ libdbi libdbiDrivers ]
++ optionals postgresSupport [ postgresql ]; ++ lib.optionals postgresSupport [ postgresql ];
meta = { meta = with lib; {
homepage = "https://wammu.eu/gammu/"; homepage = "https://wammu.eu/gammu/";
description = "Command line utility and library to control mobile phones"; description = "Command line utility and library to control mobile phones";
license = licenses.gpl2; license = licenses.gpl2;

View file

@ -1,7 +1,5 @@
{ lib, fetchFromGitHub, atomicparsley, flvstreamer, ffmpeg, makeWrapper, perl, perlPackages, rtmpdump}: { lib, fetchFromGitHub, atomicparsley, flvstreamer, ffmpeg, makeWrapper, perl, perlPackages, rtmpdump}:
with lib;
perlPackages.buildPerlPackage rec { perlPackages.buildPerlPackage rec {
pname = "get_iplayer"; pname = "get_iplayer";
version = "3.27"; version = "3.27";
@ -26,11 +24,11 @@ perlPackages.buildPerlPackage rec {
installPhase = '' installPhase = ''
mkdir -p $out/bin $out/share/man/man1 mkdir -p $out/bin $out/share/man/man1
cp get_iplayer $out/bin cp get_iplayer $out/bin
wrapProgram $out/bin/get_iplayer --suffix PATH : ${makeBinPath [ atomicparsley ffmpeg flvstreamer rtmpdump ]} --prefix PERL5LIB : $PERL5LIB wrapProgram $out/bin/get_iplayer --suffix PATH : ${lib.makeBinPath [ atomicparsley ffmpeg flvstreamer rtmpdump ]} --prefix PERL5LIB : $PERL5LIB
cp get_iplayer.1 $out/share/man/man1 cp get_iplayer.1 $out/share/man/man1
''; '';
meta = { meta = with lib; {
description = "Downloads TV and radio from BBC iPlayer"; description = "Downloads TV and radio from BBC iPlayer";
license = licenses.gpl3Plus; license = licenses.gpl3Plus;
homepage = "https://squarepenguin.co.uk/"; homepage = "https://squarepenguin.co.uk/";

View file

@ -8,8 +8,6 @@
, enableTesseract ? true, leptonica, tesseract4 , enableTesseract ? true, leptonica, tesseract4
}: }:
with lib;
# k2pdfopt is a pain to package. It requires modified versions of mupdf, # k2pdfopt is a pain to package. It requires modified versions of mupdf,
# leptonica, and tesseract. Instead of shipping patches for these upstream # leptonica, and tesseract. Instead of shipping patches for these upstream
# packages, k2pdfopt includes just the modified source files for these # packages, k2pdfopt includes just the modified source files for these
@ -140,12 +138,12 @@ in stdenv.mkDerivation rec {
}; };
in in
[ zlib libpng ] ++ [ zlib libpng ] ++
optional enableGSL gsl ++ lib.optional enableGSL gsl ++
optional enableGhostScript ghostscript ++ lib.optional enableGhostScript ghostscript ++
optional enableMuPDF mupdf_modded ++ lib.optional enableMuPDF mupdf_modded ++
optional enableDJVU djvulibre ++ lib.optional enableDJVU djvulibre ++
optional enableGOCR gocr ++ lib.optional enableGOCR gocr ++
optionals enableTesseract [ leptonica_modded tesseract_modded ]; lib.optionals enableTesseract [ leptonica_modded tesseract_modded ];
dontUseCmakeBuildDir = true; dontUseCmakeBuildDir = true;
@ -157,7 +155,7 @@ in stdenv.mkDerivation rec {
install -D -m 755 k2pdfopt $out/bin/k2pdfopt install -D -m 755 k2pdfopt $out/bin/k2pdfopt
''; '';
preFixup = optionalString enableTesseract '' preFixup = lib.optionalString enableTesseract ''
wrapProgram $out/bin/k2pdfopt --set-default TESSDATA_PREFIX ${tesseract4}/share/tessdata wrapProgram $out/bin/k2pdfopt --set-default TESSDATA_PREFIX ${tesseract4}/share/tessdata
''; '';

View file

@ -37,8 +37,6 @@
, nixosTests , nixosTests
}: }:
with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "keepassxc"; pname = "keepassxc";
version = "2.7.4"; version = "2.7.4";
@ -50,13 +48,13 @@ stdenv.mkDerivation rec {
sha256 = "sha256-amedKK9nplLVJTldeabN3/c+g/QesrdH+qx+rba2/4s="; sha256 = "sha256-amedKK9nplLVJTldeabN3/c+g/QesrdH+qx+rba2/4s=";
}; };
NIX_CFLAGS_COMPILE = optionalString stdenv.cc.isClang [ NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang [
"-Wno-old-style-cast" "-Wno-old-style-cast"
"-Wno-error" "-Wno-error"
"-D__BIG_ENDIAN__=${if stdenv.isBigEndian then "1" else "0"}" "-D__BIG_ENDIAN__=${if stdenv.isBigEndian then "1" else "0"}"
]; ];
NIX_LDFLAGS = optionalString stdenv.isDarwin "-rpath ${libargon2}/lib"; NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-rpath ${libargon2}/lib";
patches = [ patches = [
./darwin.patch ./darwin.patch
@ -67,13 +65,13 @@ stdenv.mkDerivation rec {
"-DWITH_GUI_TESTS=ON" "-DWITH_GUI_TESTS=ON"
"-DWITH_XC_UPDATECHECK=OFF" "-DWITH_XC_UPDATECHECK=OFF"
] ]
++ (optional (!withKeePassX11) "-DWITH_XC_X11=OFF") ++ (lib.optional (!withKeePassX11) "-DWITH_XC_X11=OFF")
++ (optional (withKeePassFDOSecrets && stdenv.isLinux) "-DWITH_XC_FDOSECRETS=ON") ++ (lib.optional (withKeePassFDOSecrets && stdenv.isLinux) "-DWITH_XC_FDOSECRETS=ON")
++ (optional (withKeePassYubiKey && stdenv.isLinux) "-DWITH_XC_YUBIKEY=ON") ++ (lib.optional (withKeePassYubiKey && stdenv.isLinux) "-DWITH_XC_YUBIKEY=ON")
++ (optional withKeePassBrowser "-DWITH_XC_BROWSER=ON") ++ (lib.optional withKeePassBrowser "-DWITH_XC_BROWSER=ON")
++ (optional withKeePassKeeShare "-DWITH_XC_KEESHARE=ON") ++ (lib.optional withKeePassKeeShare "-DWITH_XC_KEESHARE=ON")
++ (optional withKeePassNetworking "-DWITH_XC_NETWORKING=ON") ++ (lib.optional withKeePassNetworking "-DWITH_XC_NETWORKING=ON")
++ (optional withKeePassSSHAgent "-DWITH_XC_SSHAGENT=ON"); ++ (lib.optional withKeePassSSHAgent "-DWITH_XC_SSHAGENT=ON");
doCheck = true; doCheck = true;
checkPhase = '' checkPhase = ''
@ -112,14 +110,14 @@ stdenv.mkDerivation rec {
readline readline
zlib zlib
] ]
++ optional (stdenv.isDarwin && withKeePassTouchID) darwin.apple_sdk.frameworks.LocalAuthentication ++ lib.optional (stdenv.isDarwin && withKeePassTouchID) darwin.apple_sdk.frameworks.LocalAuthentication
++ optional stdenv.isDarwin qtmacextras ++ lib.optional stdenv.isDarwin qtmacextras
++ optional stdenv.isLinux libusb1 ++ lib.optional stdenv.isLinux libusb1
++ optional withKeePassX11 qtx11extras; ++ lib.optional withKeePassX11 qtx11extras;
passthru.tests = nixosTests.keepassxc; passthru.tests = nixosTests.keepassxc;
meta = { meta = with lib; {
description = "Offline password manager with many features."; description = "Offline password manager with many features.";
longDescription = '' longDescription = ''
A community fork of KeePassX, which is itself a port of KeePass Password Safe. A community fork of KeePassX, which is itself a port of KeePass Password Safe.

View file

@ -1,7 +1,5 @@
{ fetchFromGitHub, rustPlatform, lib }: { fetchFromGitHub, rustPlatform, lib }:
with lib;
rustPlatform.buildRustPackage rec { rustPlatform.buildRustPackage rec {
pname = "rm-improved"; pname = "rm-improved";
version = "0.13.0"; version = "0.13.0";
@ -15,7 +13,7 @@ rustPlatform.buildRustPackage rec {
sha256 = "0d065xia4mwdhxkiqfg7pic6scfzipzmsvvx7l6l97w62lzpiqx3"; sha256 = "0d065xia4mwdhxkiqfg7pic6scfzipzmsvvx7l6l97w62lzpiqx3";
}; };
meta = { meta = with lib; {
description = "Replacement for rm with focus on safety, ergonomics and performance"; description = "Replacement for rm with focus on safety, ergonomics and performance";
homepage = "https://github.com/nivekuil/rip"; homepage = "https://github.com/nivekuil/rip";
maintainers = with maintainers; [ nils-degroot ]; maintainers = with maintainers; [ nils-degroot ];

View file

@ -1,7 +1,5 @@
{ lib, stdenv, fetchgit, pkg-config, writeText, libX11, conf ? null, patches ? [] }: { lib, stdenv, fetchgit, pkg-config, writeText, libX11, conf ? null, patches ? [] }:
with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "slstatus"; pname = "slstatus";
version = "unstable-2019-02-16"; version = "unstable-2019-02-16";
@ -12,8 +10,8 @@ stdenv.mkDerivation rec {
sha256 = "0kayyhpmppybhwndxgabw48wsk9v8x9xdb05xrly9szkw3jbvgw4"; sha256 = "0kayyhpmppybhwndxgabw48wsk9v8x9xdb05xrly9szkw3jbvgw4";
}; };
configFile = optionalString (conf!=null) (writeText "config.def.h" conf); configFile = lib.optionalString (conf!=null) (writeText "config.def.h" conf);
preBuild = optionalString (conf!=null) "cp ${configFile} config.def.h"; preBuild = lib.optionalString (conf!=null) "cp ${configFile} config.def.h";
inherit patches; inherit patches;
@ -24,7 +22,7 @@ stdenv.mkDerivation rec {
installFlags = [ "PREFIX=$(out)" ]; installFlags = [ "PREFIX=$(out)" ];
meta = { meta = with lib; {
homepage = "https://tools.suckless.org/slstatus/"; homepage = "https://tools.suckless.org/slstatus/";
description = "status monitor for window managers that use WM_NAME like dwm"; description = "status monitor for window managers that use WM_NAME like dwm";
license = licenses.isc; license = licenses.isc;

View file

@ -14,14 +14,12 @@
, btrfs-progs , btrfs-progs
}: }:
with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "veracrypt"; pname = "veracrypt";
version = "1.25.9"; version = "1.25.9";
src = fetchurl { src = fetchurl {
url = "https://launchpad.net/${pname}/trunk/${toLower version}/+download/VeraCrypt_${version}_Source.tar.bz2"; url = "https://launchpad.net/${pname}/trunk/${lib.toLower version}/+download/VeraCrypt_${version}_Source.tar.bz2";
sha256 = "sha256-drbhgYS8IaQdKUn/Y9ch1JBUpxbO/zpL13tcNRC3lK8="; sha256 = "sha256-drbhgYS8IaQdKUn/Y9ch1JBUpxbO/zpL13tcNRC3lK8=";
}; };
@ -54,7 +52,7 @@ stdenv.mkDerivation rec {
--replace "Icon=veracrypt" "Icon=veracrypt.xpm" --replace "Icon=veracrypt" "Icon=veracrypt.xpm"
''; '';
meta = { meta = with lib; {
description = "Free Open-Source filesystem on-the-fly encryption"; description = "Free Open-Source filesystem on-the-fly encryption";
homepage = "https://www.veracrypt.fr/"; homepage = "https://www.veracrypt.fr/";
license = with licenses; [ asl20 /* and */ unfree /* TrueCrypt License version 3.0 */ ]; license = with licenses; [ asl20 /* and */ unfree /* TrueCrypt License version 3.0 */ ];

View file

@ -1,8 +1,6 @@
{ lib, stdenv, fetchFromGitHub, cmake, makeWrapper, pkg-config { lib, stdenv, fetchFromGitHub, cmake, makeWrapper, pkg-config
, glib, libwnck, procps }: , glib, libwnck, procps }:
with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "xsuspender"; pname = "xsuspender";
version = "1.3"; version = "1.3";
@ -21,10 +19,10 @@ stdenv.mkDerivation rec {
postInstall = '' postInstall = ''
wrapProgram $out/bin/xsuspender \ wrapProgram $out/bin/xsuspender \
--prefix PATH : "${makeBinPath [ procps ]}" --prefix PATH : "${lib.makeBinPath [ procps ]}"
''; '';
meta = { meta = with lib; {
description = "Auto-suspend inactive X11 applications"; description = "Auto-suspend inactive X11 applications";
homepage = "https://kernc.github.io/xsuspender/"; homepage = "https://kernc.github.io/xsuspender/";
license = licenses.wtfpl; license = licenses.wtfpl;

View file

@ -6,8 +6,6 @@
, gtk-mac-integration , gtk-mac-integration
}: }:
with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "zathura"; pname = "zathura";
version = "0.5.2"; version = "0.5.2";
@ -28,7 +26,7 @@ stdenv.mkDerivation rec {
"-Dsynctex=enabled" "-Dsynctex=enabled"
# Make sure tests are enabled for doCheck # Make sure tests are enabled for doCheck
"-Dtests=enabled" "-Dtests=enabled"
] ++ optional (!stdenv.isLinux) "-Dseccomp=disabled"; ] ++ lib.optional (!stdenv.isLinux) "-Dseccomp=disabled";
nativeBuildInputs = [ nativeBuildInputs = [
meson ninja pkg-config desktop-file-utils python3.pkgs.sphinx meson ninja pkg-config desktop-file-utils python3.pkgs.sphinx
@ -38,12 +36,12 @@ stdenv.mkDerivation rec {
buildInputs = [ buildInputs = [
gtk girara libintl sqlite glib file librsvg gtk girara libintl sqlite glib file librsvg
texlive.bin.core texlive.bin.core
] ++ optional stdenv.isLinux libseccomp ] ++ lib.optional stdenv.isLinux libseccomp
++ optional stdenv.isDarwin gtk-mac-integration; ++ lib.optional stdenv.isDarwin gtk-mac-integration;
doCheck = !stdenv.isDarwin; doCheck = !stdenv.isDarwin;
meta = { meta = with lib; {
homepage = "https://git.pwmt.org/pwmt/zathura"; homepage = "https://git.pwmt.org/pwmt/zathura";
description = "A core component for zathura PDF viewer"; description = "A core component for zathura PDF viewer";
license = licenses.zlib; license = licenses.zlib;

View file

@ -38,7 +38,7 @@
, xorg , xorg
, zlib , zlib
}: }:
with lib;
let let
deps = [ deps = [
alsa-lib alsa-lib
@ -89,7 +89,7 @@ stdenv.mkDerivation rec {
version = "6.0.3"; version = "6.0.3";
src = fetchurl { src = fetchurl {
url = "https://bin.appgate-sdp.com/${versions.majorMinor version}/client/appgate-sdp_${version}_amd64.deb"; url = "https://bin.appgate-sdp.com/${lib.versions.majorMinor version}/client/appgate-sdp_${version}_amd64.deb";
sha256 = "sha256-UDyVPoQM78CKVWXgr08An77QTiFVmRNHwQPGaj1jAIM="; sha256 = "sha256-UDyVPoQM78CKVWXgr08An77QTiFVmRNHwQPGaj1jAIM=";
}; };
@ -134,16 +134,16 @@ stdenv.mkDerivation rec {
--replace "/etc/appgate.conf" "$out/etc/appgate.conf" --replace "/etc/appgate.conf" "$out/etc/appgate.conf"
wrapProgram $out/opt/appgate/service/createdump \ wrapProgram $out/opt/appgate/service/createdump \
--set LD_LIBRARY_PATH "${makeLibraryPath [ stdenv.cc.cc ]}" --set LD_LIBRARY_PATH "${lib.makeLibraryPath [ stdenv.cc.cc ]}"
wrapProgram $out/opt/appgate/appgate-driver \ wrapProgram $out/opt/appgate/appgate-driver \
--prefix PATH : ${makeBinPath [ iproute2 networkmanager dnsmasq ]} \ --prefix PATH : ${lib.makeBinPath [ iproute2 networkmanager dnsmasq ]} \
--set LD_LIBRARY_PATH $out/opt/appgate/service --set LD_LIBRARY_PATH $out/opt/appgate/service
# make xdg-open overrideable at runtime # make xdg-open overrideable at runtime
makeWrapper $out/opt/appgate/Appgate $out/bin/appgate \ makeWrapper $out/opt/appgate/Appgate $out/bin/appgate \
--suffix PATH : ${makeBinPath [ xdg-utils ]} \ --suffix PATH : ${lib.makeBinPath [ xdg-utils ]} \
--set LD_LIBRARY_PATH $out/opt/appgate:${makeLibraryPath deps} --set LD_LIBRARY_PATH $out/opt/appgate:${lib.makeLibraryPath deps}
wrapProgram $out/opt/appgate/linux/set_dns --set PYTHONPATH $PYTHONPATH wrapProgram $out/opt/appgate/linux/set_dns --set PYTHONPATH $PYTHONPATH
''; '';

View file

@ -3,8 +3,6 @@
, enableWideVine, ungoogled , enableWideVine, ungoogled
}: }:
with lib;
mkChromiumDerivation (base: rec { mkChromiumDerivation (base: rec {
name = "chromium-browser"; name = "chromium-browser";
packageName = "chromium"; packageName = "chromium";
@ -76,7 +74,7 @@ mkChromiumDerivation (base: rec {
meta = { meta = {
description = "An open source web browser from Google" description = "An open source web browser from Google"
+ optionalString ungoogled ", with dependencies on Google web services removed"; + lib.optionalString ungoogled ", with dependencies on Google web services removed";
longDescription = '' longDescription = ''
Chromium is an open source web browser from Google that aims to build a Chromium is an open source web browser from Google that aims to build a
safer, faster, and more stable way for all Internet users to experience safer, faster, and more stable way for all Internet users to experience
@ -86,11 +84,11 @@ mkChromiumDerivation (base: rec {
homepage = if ungoogled homepage = if ungoogled
then "https://github.com/Eloston/ungoogled-chromium" then "https://github.com/Eloston/ungoogled-chromium"
else "https://www.chromium.org/"; else "https://www.chromium.org/";
maintainers = with maintainers; if ungoogled maintainers = with lib.maintainers; if ungoogled
then [ squalus primeos michaeladler ] then [ squalus primeos michaeladler ]
else [ primeos thefloweringash ]; else [ primeos thefloweringash ];
license = if enableWideVine then licenses.unfree else licenses.bsd3; license = if enableWideVine then lib.licenses.unfree else lib.licenses.bsd3;
platforms = platforms.linux; platforms = lib.platforms.linux;
mainProgram = "chromium"; mainProgram = "chromium";
hydraPlatforms = if (channel == "stable" || channel == "ungoogled-chromium") hydraPlatforms = if (channel == "stable" || channel == "ungoogled-chromium")
then ["aarch64-linux" "x86_64-linux"] then ["aarch64-linux" "x86_64-linux"]

View file

@ -51,8 +51,6 @@
buildFun: buildFun:
with lib;
let let
python3WithPackages = python3.withPackages(ps: with ps; [ python3WithPackages = python3.withPackages(ps: with ps; [
ply jinja2 setuptools ply jinja2 setuptools
@ -75,16 +73,16 @@ let
let let
# Serialize Nix types into GN types according to this document: # Serialize Nix types into GN types according to this document:
# https://source.chromium.org/gn/gn/+/master:docs/language.md # https://source.chromium.org/gn/gn/+/master:docs/language.md
mkGnString = value: "\"${escape ["\"" "$" "\\"] value}\""; mkGnString = value: "\"${lib.escape ["\"" "$" "\\"] value}\"";
sanitize = value: sanitize = value:
if value == true then "true" if value == true then "true"
else if value == false then "false" else if value == false then "false"
else if isList value then "[${concatMapStringsSep ", " sanitize value}]" else if lib.isList value then "[${lib.concatMapStringsSep ", " sanitize value}]"
else if isInt value then toString value else if lib.isInt value then toString value
else if isString value then mkGnString value else if lib.isString value then mkGnString value
else throw "Unsupported type for GN value `${value}'."; else throw "Unsupported type for GN value `${value}'.";
toFlag = key: value: "${key}=${sanitize value}"; toFlag = key: value: "${key}=${sanitize value}";
in attrs: concatStringsSep " " (attrValues (mapAttrs toFlag attrs)); in attrs: lib.concatStringsSep " " (lib.attrValues (lib.mapAttrs toFlag attrs));
# https://source.chromium.org/chromium/chromium/src/+/master:build/linux/unbundle/replace_gn_files.py # https://source.chromium.org/chromium/chromium/src/+/master:build/linux/unbundle/replace_gn_files.py
gnSystemLibraries = [ gnSystemLibraries = [
@ -151,9 +149,9 @@ let
libdrm wayland mesa.drivers libxkbcommon libdrm wayland mesa.drivers libxkbcommon
curl curl
libepoxy libepoxy
] ++ optional systemdSupport systemd ] ++ lib.optional systemdSupport systemd
++ optionals cupsSupport [ libgcrypt cups ] ++ lib.optionals cupsSupport [ libgcrypt cups ]
++ optional pulseSupport libpulseaudio; ++ lib.optional pulseSupport libpulseaudio;
patches = [ patches = [
# Optional patch to use SOURCE_DATE_EPOCH in compute_build_timestamp.py (should be upstreamed): # Optional patch to use SOURCE_DATE_EPOCH in compute_build_timestamp.py (should be upstreamed):
@ -237,10 +235,10 @@ let
# Allow building against system libraries in official builds # Allow building against system libraries in official builds
sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' tools/generate_shim_headers/generate_shim_headers.py sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' tools/generate_shim_headers/generate_shim_headers.py
'' + optionalString stdenv.isAarch64 '' '' + lib.optionalString stdenv.isAarch64 ''
substituteInPlace build/toolchain/linux/BUILD.gn \ substituteInPlace build/toolchain/linux/BUILD.gn \
--replace 'toolprefix = "aarch64-linux-gnu-"' 'toolprefix = ""' --replace 'toolprefix = "aarch64-linux-gnu-"' 'toolprefix = ""'
'' + optionalString ungoogled '' '' + lib.optionalString ungoogled ''
${ungoogler}/utils/prune_binaries.py . ${ungoogler}/pruning.list || echo "some errors" ${ungoogler}/utils/prune_binaries.py . ${ungoogler}/pruning.list || echo "some errors"
${ungoogler}/utils/patches.py . ${ungoogler}/patches ${ungoogler}/utils/patches.py . ${ungoogler}/patches
${ungoogler}/utils/domain_substitution.py apply -r ${ungoogler}/domain_regex.list -f ${ungoogler}/domain_substitution.list -c ./ungoogled-domsubcache.tar.gz . ${ungoogler}/utils/domain_substitution.py apply -r ${ungoogler}/domain_regex.list -f ${ungoogler}/domain_substitution.list -c ./ungoogled-domsubcache.tar.gz .
@ -300,15 +298,15 @@ let
# as well to avoid incompatibilities (if this continues to be a problem # as well to avoid incompatibilities (if this continues to be a problem
# from time to time): # from time to time):
use_system_libwayland = true; use_system_libwayland = true;
} // optionalAttrs proprietaryCodecs { } // lib.optionalAttrs proprietaryCodecs {
# enable support for the H.264 codec # enable support for the H.264 codec
proprietary_codecs = true; proprietary_codecs = true;
enable_hangout_services_extension = true; enable_hangout_services_extension = true;
ffmpeg_branding = "Chrome"; ffmpeg_branding = "Chrome";
} // optionalAttrs pulseSupport { } // lib.optionalAttrs pulseSupport {
use_pulseaudio = true; use_pulseaudio = true;
link_pulseaudio = true; link_pulseaudio = true;
} // optionalAttrs ungoogled (importTOML ./ungoogled-flags.toml) } // lib.optionalAttrs ungoogled (lib.importTOML ./ungoogled-flags.toml)
// (extraAttrs.gnFlags or {})); // (extraAttrs.gnFlags or {}));
configurePhase = '' configurePhase = ''
@ -317,7 +315,7 @@ let
# This is to ensure expansion of $out. # This is to ensure expansion of $out.
libExecPath="${libExecPath}" libExecPath="${libExecPath}"
${python3}/bin/python3 build/linux/unbundle/replace_gn_files.py --system-libraries ${toString gnSystemLibraries} ${python3}/bin/python3 build/linux/unbundle/replace_gn_files.py --system-libraries ${toString gnSystemLibraries}
${gnChromium}/bin/gn gen --args=${escapeShellArg gnFlags} out/Release | tee gn-gen-outputs.txt ${gnChromium}/bin/gn gen --args=${lib.escapeShellArg gnFlags} out/Release | tee gn-gen-outputs.txt
# Fail if `gn gen` contains a WARNING. # Fail if `gn gen` contains a WARNING.
grep -o WARNING gn-gen-outputs.txt && echo "Found gn WARNING, exiting nix build" && exit 1 grep -o WARNING gn-gen-outputs.txt && echo "Found gn WARNING, exiting nix build" && exit 1
@ -342,7 +340,7 @@ let
''; '';
targets = extraAttrs.buildTargets or []; targets = extraAttrs.buildTargets or [];
commands = map buildCommand targets; commands = map buildCommand targets;
in concatStringsSep "\n" commands; in lib.concatStringsSep "\n" commands;
postFixup = '' postFixup = ''
# Make sure that libGLESv2 is found by dlopen (if using EGL). # Make sure that libGLESv2 is found by dlopen (if using EGL).

View file

@ -47,8 +47,6 @@
, addOpenGLRunpath , addOpenGLRunpath
}: }:
with lib;
let let
opusWithCustomModes = libopus.override { opusWithCustomModes = libopus.override {
withCustomModes = true; withCustomModes = true;
@ -68,8 +66,8 @@ let
bzip2 libcap at-spi2-atk at-spi2-core bzip2 libcap at-spi2-atk at-spi2-core
libkrb5 libdrm libglvnd mesa coreutils libkrb5 libdrm libglvnd mesa coreutils
libxkbcommon pipewire wayland libxkbcommon pipewire wayland
] ++ optional pulseSupport libpulseaudio ] ++ lib.optional pulseSupport libpulseaudio
++ optional libvaSupport libva ++ lib.optional libvaSupport libva
++ [ gtk3 ]; ++ [ gtk3 ];
suffix = if channel != "stable" then "-" + channel else ""; suffix = if channel != "stable" then "-" + channel else "";
@ -99,8 +97,8 @@ in stdenv.mkDerivation {
tar xf data.tar.xz tar xf data.tar.xz
''; '';
rpath = makeLibraryPath deps + ":" + makeSearchPathOutput "lib" "lib64" deps; rpath = lib.makeLibraryPath deps + ":" + lib.makeSearchPathOutput "lib" "lib64" deps;
binpath = makeBinPath deps; binpath = lib.makeBinPath deps;
installPhase = '' installPhase = ''
runHook preInstall runHook preInstall
@ -149,7 +147,7 @@ in stdenv.mkDerivation {
--prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH:${addOpenGLRunpath.driverLink}/share" \ --prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH:${addOpenGLRunpath.driverLink}/share" \
--set CHROME_WRAPPER "google-chrome-$dist" \ --set CHROME_WRAPPER "google-chrome-$dist" \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \ --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \
--add-flags ${escapeShellArg commandLineArgs} --add-flags ${lib.escapeShellArg commandLineArgs}
for elf in $out/share/google/$appname/{chrome,chrome-sandbox,${crashpadHandlerBinary},nacl_helper}; do for elf in $out/share/google/$appname/{chrome,chrome-sandbox,${crashpadHandlerBinary},nacl_helper}; do
patchelf --set-rpath $rpath $elf patchelf --set-rpath $rpath $elf
@ -159,7 +157,7 @@ in stdenv.mkDerivation {
runHook postInstall runHook postInstall
''; '';
meta = { meta = with lib; {
description = "A freeware web browser developed by Google"; description = "A freeware web browser developed by Google";
homepage = "https://www.google.com/chrome/browser/"; homepage = "https://www.google.com/chrome/browser/";
license = licenses.unfree; license = licenses.unfree;

View file

@ -53,10 +53,8 @@
, extraPrefs ? "" , extraPrefs ? ""
}: }:
with lib;
let let
libPath = makeLibraryPath libPkgs; libPath = lib.makeLibraryPath libPkgs;
libPkgs = [ libPkgs = [
atk atk
@ -78,13 +76,13 @@ let
stdenv.cc.libc stdenv.cc.libc
zlib zlib
] ]
++ optionals pulseaudioSupport [ libpulseaudio ] ++ lib.optionals pulseaudioSupport [ libpulseaudio ]
++ optionals mediaSupport [ ++ lib.optionals mediaSupport [
ffmpeg ffmpeg
]; ];
# Library search path for the fte transport # Library search path for the fte transport
fteLibPath = makeLibraryPath [ stdenv.cc.cc gmp ]; fteLibPath = lib.makeLibraryPath [ stdenv.cc.cc gmp ];
# Upstream source # Upstream source
version = "11.5.8"; version = "11.5.8";
@ -156,7 +154,7 @@ stdenv.mkDerivation rec {
libPath=${libPath}:$TBB_IN_STORE:$TBB_IN_STORE/TorBrowser/Tor libPath=${libPath}:$TBB_IN_STORE:$TBB_IN_STORE/TorBrowser/Tor
# apulse uses a non-standard library path. For now special-case it. # apulse uses a non-standard library path. For now special-case it.
${optionalString (audioSupport && !pulseaudioSupport) '' ${lib.optionalString (audioSupport && !pulseaudioSupport) ''
libPath=${apulse}/lib/apulse:$libPath libPath=${apulse}/lib/apulse:$libPath
''} ''}
@ -224,7 +222,7 @@ stdenv.mkDerivation rec {
clearPref("security.sandbox.content.write_path_whitelist"); clearPref("security.sandbox.content.write_path_whitelist");
''} ''}
${optionalString (extraPrefs != "") '' ${lib.optionalString (extraPrefs != "") ''
${extraPrefs} ${extraPrefs}
''} ''}
EOF EOF
@ -251,14 +249,14 @@ stdenv.mkDerivation rec {
GeoIPv6File $TBB_IN_STORE/TorBrowser/Data/Tor/geoip6 GeoIPv6File $TBB_IN_STORE/TorBrowser/Data/Tor/geoip6
EOF EOF
WRAPPER_LD_PRELOAD=${optionalString useHardenedMalloc WRAPPER_LD_PRELOAD=${lib.optionalString useHardenedMalloc
"${graphene-hardened-malloc}/lib/libhardened_malloc.so"} "${graphene-hardened-malloc}/lib/libhardened_malloc.so"}
WRAPPER_XDG_DATA_DIRS=${concatMapStringsSep ":" (x: "${x}/share") [ WRAPPER_XDG_DATA_DIRS=${lib.concatMapStringsSep ":" (x: "${x}/share") [
gnome.adwaita-icon-theme gnome.adwaita-icon-theme
shared-mime-info shared-mime-info
]} ]}
WRAPPER_XDG_DATA_DIRS+=":"${concatMapStringsSep ":" (x: "${x}/share/gsettings-schemas/${x.name}") [ WRAPPER_XDG_DATA_DIRS+=":"${lib.concatMapStringsSep ":" (x: "${x}/share/gsettings-schemas/${x.name}") [
glib glib
gsettings-desktop-schemas gsettings-desktop-schemas
gtk3 gtk3
@ -270,7 +268,7 @@ stdenv.mkDerivation rec {
#! ${runtimeShell} #! ${runtimeShell}
set -o errexit -o nounset set -o errexit -o nounset
PATH=${makeBinPath [ coreutils ]} PATH=${lib.makeBinPath [ coreutils ]}
export LC_ALL=C export LC_ALL=C
export LOCALE_ARCHIVE=${glibcLocales}/lib/locale/locale-archive export LOCALE_ARCHIVE=${glibcLocales}/lib/locale/locale-archive
@ -317,7 +315,7 @@ stdenv.mkDerivation rec {
: "\''${XDG_RUNTIME_DIR:=/run/user/\$(id -u)}" : "\''${XDG_RUNTIME_DIR:=/run/user/\$(id -u)}"
: "\''${XDG_CONFIG_HOME:=\$REAL_HOME/.config}" : "\''${XDG_CONFIG_HOME:=\$REAL_HOME/.config}"
${optionalString pulseaudioSupport '' ${lib.optionalString pulseaudioSupport ''
# Figure out some envvars for pulseaudio # Figure out some envvars for pulseaudio
: "\''${PULSE_SERVER:=\$XDG_RUNTIME_DIR/pulse/native}" : "\''${PULSE_SERVER:=\$XDG_RUNTIME_DIR/pulse/native}"
: "\''${PULSE_COOKIE:=\$XDG_CONFIG_HOME/pulse/cookie}" : "\''${PULSE_COOKIE:=\$XDG_CONFIG_HOME/pulse/cookie}"

View file

@ -25,8 +25,6 @@
, pkgsBuildBuild , pkgsBuildBuild
}: }:
with lib;
# k3s is a kinda weird derivation. One of the main points of k3s is the # k3s is a kinda weird derivation. One of the main points of k3s is the
# simplicity of it being one binary that can perform several tasks. # simplicity of it being one binary that can perform several tasks.
# However, when you have a good package manager (like nix), that doesn't # However, when you have a good package manager (like nix), that doesn't
@ -73,7 +71,7 @@ let
# run `grep github.com/kubernetes-sigs/cri-tools go.mod | head -n1 | awk '{print $4}'` in the k3s repo at the tag # run `grep github.com/kubernetes-sigs/cri-tools go.mod | head -n1 | awk '{print $4}'` in the k3s repo at the tag
criCtlVersion = "1.26.0-rc.0-k3s1"; criCtlVersion = "1.26.0-rc.0-k3s1";
baseMeta = { baseMeta = with lib; {
description = "A lightweight Kubernetes distribution"; description = "A lightweight Kubernetes distribution";
license = licenses.asl20; license = licenses.asl20;
homepage = "https://k3s.io"; homepage = "https://k3s.io";

View file

@ -12,8 +12,6 @@
, R , R
}: }:
with lib;
let let
spark = { pname, version, sha256, extraMeta ? {} }: spark = { pname, version, sha256, extraMeta ? {} }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -26,7 +24,7 @@ let
nativeBuildInputs = [ makeWrapper ]; nativeBuildInputs = [ makeWrapper ];
buildInputs = [ jdk python3Packages.python ] buildInputs = [ jdk python3Packages.python ]
++ extraPythonPackages ++ extraPythonPackages
++ optional RSupport R; ++ lib.optional RSupport R;
untarDir = "${pname}-${version}"; untarDir = "${pname}-${version}";
installPhase = '' installPhase = ''
@ -38,12 +36,12 @@ let
cat > $out/lib/${untarDir}/conf/spark-env.sh <<- EOF cat > $out/lib/${untarDir}/conf/spark-env.sh <<- EOF
export JAVA_HOME="${jdk}" export JAVA_HOME="${jdk}"
export SPARK_HOME="$out/lib/${untarDir}" export SPARK_HOME="$out/lib/${untarDir}"
'' + optionalString hadoopSupport '' '' + lib.optionalString hadoopSupport ''
export SPARK_DIST_CLASSPATH=$(${hadoop}/bin/hadoop classpath) export SPARK_DIST_CLASSPATH=$(${hadoop}/bin/hadoop classpath)
'' + '' '' + ''
export PYSPARK_PYTHON="${python3Packages.python}/bin/${python3Packages.python.executable}" export PYSPARK_PYTHON="${python3Packages.python}/bin/${python3Packages.python.executable}"
export PYTHONPATH="\$PYTHONPATH:$PYTHONPATH" export PYTHONPATH="\$PYTHONPATH:$PYTHONPATH"
${optionalString RSupport '' ${lib.optionalString RSupport ''
export SPARKR_R_SHELL="${R}/bin/R" export SPARKR_R_SHELL="${R}/bin/R"
export PATH="\$PATH:${R}/bin"''} export PATH="\$PATH:${R}/bin"''}
EOF EOF
@ -64,10 +62,10 @@ let
meta = { meta = {
description = "Apache Spark is a fast and general engine for large-scale data processing"; description = "Apache Spark is a fast and general engine for large-scale data processing";
homepage = "https://spark.apache.org/"; homepage = "https://spark.apache.org/";
sourceProvenance = with sourceTypes; [ binaryBytecode ]; sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
license = lib.licenses.asl20; license = lib.licenses.asl20;
platforms = lib.platforms.all; platforms = lib.platforms.all;
maintainers = with maintainers; [ thoughtpolice offline kamilchm illustris ]; maintainers = with lib.maintainers; [ thoughtpolice offline kamilchm illustris ];
} // extraMeta; } // extraMeta;
}; };
in in

View file

@ -1,7 +1,5 @@
{ stdenv, lib, fetchFromGitHub, wrapPython, fetchpatch }: { stdenv, lib, fetchFromGitHub, wrapPython, fetchpatch }:
with lib;
stdenv.mkDerivation { stdenv.mkDerivation {
pname = "droopy"; pname = "droopy";
version = "20160830"; version = "20160830";
@ -32,7 +30,7 @@ stdenv.mkDerivation {
wrapPythonPrograms wrapPythonPrograms
''; '';
meta = { meta = with lib; {
description = "Mini Web server that let others upload files to your computer"; description = "Mini Web server that let others upload files to your computer";
homepage = "http://stackp.online.fr/droopy"; homepage = "http://stackp.online.fr/droopy";
license = licenses.bsd3; license = licenses.bsd3;

View file

@ -1,6 +1,5 @@
{ lib, fetchFromGitHub, stdenv, bitlbee, autoreconfHook, pkg-config, glib }: { lib, fetchFromGitHub, stdenv, bitlbee, autoreconfHook, pkg-config, glib }:
with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "bitlbee-discord"; pname = "bitlbee-discord";
version = "0.4.3"; version = "0.4.3";
@ -21,7 +20,7 @@ stdenv.mkDerivation rec {
./autogen.sh ./autogen.sh
''; '';
meta = { meta = with lib; {
description = "Bitlbee plugin for Discord"; description = "Bitlbee plugin for Discord";
homepage = "https://github.com/sm00th/bitlbee-discord"; homepage = "https://github.com/sm00th/bitlbee-discord";

View file

@ -1,6 +1,5 @@
{ lib, fetchgit, stdenv, bitlbee, autoreconfHook, pkg-config, glib }: { lib, fetchgit, stdenv, bitlbee, autoreconfHook, pkg-config, glib }:
with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "bitlbee-mastodon"; pname = "bitlbee-mastodon";
version = "1.4.5"; version = "1.4.5";
@ -19,7 +18,7 @@ stdenv.mkDerivation rec {
export BITLBEE_DATADIR=$out/share/bitlbee export BITLBEE_DATADIR=$out/share/bitlbee
''; '';
meta = { meta = with lib; {
description = "Bitlbee plugin for Mastodon"; description = "Bitlbee plugin for Mastodon";
homepage = "https://alexschroeder.ch/cgit/bitlbee-mastodon/about"; homepage = "https://alexschroeder.ch/cgit/bitlbee-mastodon/about";
license = licenses.gpl2Plus; license = licenses.gpl2Plus;

View file

@ -1,6 +1,5 @@
{ lib, fetchFromGitHub, stdenv, bitlbee, autoconf, automake, libtool, pkg-config, libgcrypt }: { lib, fetchFromGitHub, stdenv, bitlbee, autoconf, automake, libtool, pkg-config, libgcrypt }:
with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "1.4.2"; version = "1.4.2";
pname = "bitlbee-steam"; pname = "bitlbee-steam";
@ -20,7 +19,7 @@ stdenv.mkDerivation rec {
./autogen.sh ./autogen.sh
''; '';
meta = { meta = with lib; {
description = "Steam protocol plugin for BitlBee"; description = "Steam protocol plugin for BitlBee";
homepage = "https://github.com/jgeboski/bitlbee-steam"; homepage = "https://github.com/jgeboski/bitlbee-steam";

View file

@ -3,7 +3,6 @@
, enablePam ? false, pam ? null , enablePam ? false, pam ? null
}: }:
with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "bitlbee"; pname = "bitlbee";
version = "3.6"; version = "3.6";
@ -13,11 +12,11 @@ stdenv.mkDerivation rec {
sha256 = "0zhhcbcr59sx9h4maf8zamzv2waya7sbsl7w74gbyilvy93dw5cz"; sha256 = "0zhhcbcr59sx9h4maf8zamzv2waya7sbsl7w74gbyilvy93dw5cz";
}; };
nativeBuildInputs = [ pkg-config ] ++ optional doCheck check; nativeBuildInputs = [ pkg-config ] ++ lib.optional doCheck check;
buildInputs = [ gnutls libotr python3 ] buildInputs = [ gnutls libotr python3 ]
++ optional enableLibPurple pidgin ++ lib.optional enableLibPurple pidgin
++ optional enablePam pam; ++ lib.optional enablePam pam;
propagatedBuildInputs = [ glib ]; propagatedBuildInputs = [ glib ];
@ -25,8 +24,8 @@ stdenv.mkDerivation rec {
"--otr=1" "--otr=1"
"--ssl=gnutls" "--ssl=gnutls"
"--pidfile=/var/lib/bitlbee/bitlbee.pid" "--pidfile=/var/lib/bitlbee/bitlbee.pid"
] ++ optional enableLibPurple "--purple=1" ] ++ lib.optional enableLibPurple "--purple=1"
++ optional enablePam "--pam=1"; ++ lib.optional enablePam "--pam=1";
patches = [ patches = [
# This should be dropped once the issue is fixed upstream. # This should be dropped once the issue is fixed upstream.
@ -46,7 +45,7 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true; enableParallelBuilding = true;
meta = { meta = with lib; {
description = "IRC instant messaging gateway"; description = "IRC instant messaging gateway";
longDescription = '' longDescription = ''

View file

@ -1,7 +1,5 @@
{ lib, runCommandLocal, bitlbee }: { lib, runCommandLocal, bitlbee }:
with lib;
plugins: runCommandLocal "bitlbee-plugins" { plugins: runCommandLocal "bitlbee-plugins" {
inherit plugins; inherit plugins;
buildInputs = [ bitlbee plugins ]; buildInputs = [ bitlbee plugins ];

View file

@ -1,10 +1,8 @@
{ lib, stdenv, fetchgit, libtoxcore { lib, stdenv, fetchgit, libtoxcore
, conf ? null }: , conf ? null }:
with lib;
let let
configFile = optionalString (conf!=null) (builtins.toFile "config.h" conf); configFile = lib.optionalString (conf!=null) (builtins.toFile "config.h" conf);
in stdenv.mkDerivation { in stdenv.mkDerivation {
pname = "ratox"; pname = "ratox";
@ -22,12 +20,12 @@ in stdenv.mkDerivation {
substituteInPlace config.mk \ substituteInPlace config.mk \
--replace '-lsodium -lopus -lvpx ' "" --replace '-lsodium -lopus -lvpx ' ""
${optionalString (conf!=null) "cp ${configFile} config.def.h"} ${lib.optionalString (conf!=null) "cp ${configFile} config.def.h"}
''; '';
makeFlags = [ "PREFIX=$(out)" ]; makeFlags = [ "PREFIX=$(out)" ];
meta = { meta = with lib; {
description = "FIFO based tox client"; description = "FIFO based tox client";
homepage = "http://ratox.2f30.org/"; homepage = "http://ratox.2f30.org/";
license = licenses.isc; license = licenses.isc;

View file

@ -65,8 +65,6 @@
, MetalKit , MetalKit
}: }:
with lib;
let let
tg_owt = callPackage ./tg_owt.nix { tg_owt = callPackage ./tg_owt.nix {
abseil-cpp = abseil-cpp.override { abseil-cpp = abseil-cpp.override {
@ -99,14 +97,14 @@ stdenv.mkDerivation rec {
./shortcuts-binary-path.patch ./shortcuts-binary-path.patch
]; ];
postPatch = optionalString stdenv.isLinux '' postPatch = lib.optionalString stdenv.isLinux ''
substituteInPlace Telegram/ThirdParty/libtgvoip/os/linux/AudioInputALSA.cpp \ substituteInPlace Telegram/ThirdParty/libtgvoip/os/linux/AudioInputALSA.cpp \
--replace '"libasound.so.2"' '"${alsa-lib}/lib/libasound.so.2"' --replace '"libasound.so.2"' '"${alsa-lib}/lib/libasound.so.2"'
substituteInPlace Telegram/ThirdParty/libtgvoip/os/linux/AudioOutputALSA.cpp \ substituteInPlace Telegram/ThirdParty/libtgvoip/os/linux/AudioOutputALSA.cpp \
--replace '"libasound.so.2"' '"${alsa-lib}/lib/libasound.so.2"' --replace '"libasound.so.2"' '"${alsa-lib}/lib/libasound.so.2"'
substituteInPlace Telegram/ThirdParty/libtgvoip/os/linux/AudioPulse.cpp \ substituteInPlace Telegram/ThirdParty/libtgvoip/os/linux/AudioPulse.cpp \
--replace '"libpulse.so.0"' '"${libpulseaudio}/lib/libpulse.so.0"' --replace '"libpulse.so.0"' '"${libpulseaudio}/lib/libpulse.so.0"'
'' + optionalString stdenv.isDarwin '' '' + lib.optionalString stdenv.isDarwin ''
sed -i "13i#import <CoreAudio/CoreAudio.h>" Telegram/lib_webrtc/webrtc/mac/webrtc_media_devices_mac.mm sed -i "13i#import <CoreAudio/CoreAudio.h>" Telegram/lib_webrtc/webrtc/mac/webrtc_media_devices_mac.mm
substituteInPlace Telegram/CMakeLists.txt \ substituteInPlace Telegram/CMakeLists.txt \
--replace 'COMMAND iconutil' 'COMMAND png2icns' \ --replace 'COMMAND iconutil' 'COMMAND png2icns' \
@ -122,7 +120,7 @@ stdenv.mkDerivation rec {
python3 python3
wrapQtAppsHook wrapQtAppsHook
removeReferencesTo removeReferencesTo
] ++ optionals stdenv.isLinux [ ] ++ lib.optionals stdenv.isLinux [
# to build bundled libdispatch # to build bundled libdispatch
clang clang
extra-cmake-modules extra-cmake-modules
@ -143,7 +141,7 @@ stdenv.mkDerivation rec {
rnnoise rnnoise
tg_owt tg_owt
microsoft_gsl microsoft_gsl
] ++ optionals stdenv.isLinux [ ] ++ lib.optionals stdenv.isLinux [
kwayland kwayland
alsa-lib alsa-lib
libpulseaudio libpulseaudio
@ -151,7 +149,7 @@ stdenv.mkDerivation rec {
glibmm glibmm
jemalloc jemalloc
wayland wayland
] ++ optionals stdenv.isDarwin [ ] ++ lib.optionals stdenv.isDarwin [
Cocoa Cocoa
CoreFoundation CoreFoundation
CoreServices CoreServices
@ -192,7 +190,7 @@ stdenv.mkDerivation rec {
"-DDESKTOP_APP_QT6=OFF" "-DDESKTOP_APP_QT6=OFF"
]; ];
installPhase = optionalString stdenv.isDarwin '' installPhase = lib.optionalString stdenv.isDarwin ''
mkdir -p $out/Applications mkdir -p $out/Applications
cp -r Kotatogram.app $out/Applications cp -r Kotatogram.app $out/Applications
ln -s $out/Applications/Kotatogram.app/Contents/MacOS $out/bin ln -s $out/Applications/Kotatogram.app/Contents/MacOS $out/bin
@ -209,7 +207,7 @@ stdenv.mkDerivation rec {
inherit tg_owt; inherit tg_owt;
}; };
meta = { meta = with lib; {
description = "Kotatogram experimental Telegram Desktop fork"; description = "Kotatogram experimental Telegram Desktop fork";
longDescription = '' longDescription = ''
Unofficial desktop client for the Telegram messenger, based on Telegram Desktop. Unofficial desktop client for the Telegram messenger, based on Telegram Desktop.

View file

@ -1,7 +1,5 @@
{ stdenv, lib, kotatogram-desktop, glib-networking, webkitgtk, makeWrapper }: { stdenv, lib, kotatogram-desktop, glib-networking, webkitgtk, makeWrapper }:
with lib;
stdenv.mkDerivation { stdenv.mkDerivation {
pname = "${kotatogram-desktop.pname}-with-webkit"; pname = "${kotatogram-desktop.pname}-with-webkit";
version = kotatogram-desktop.version; version = kotatogram-desktop.version;
@ -15,9 +13,9 @@ stdenv.mkDerivation {
mkdir -p $out/bin mkdir -p $out/bin
makeWrapper ${kotatogram-desktop}/bin/kotatogram-desktop $out/bin/kotatogram-desktop \ makeWrapper ${kotatogram-desktop}/bin/kotatogram-desktop $out/bin/kotatogram-desktop \
--prefix GIO_EXTRA_MODULES : ${glib-networking}/lib/gio/modules \ --prefix GIO_EXTRA_MODULES : ${glib-networking}/lib/gio/modules \
--prefix LD_LIBRARY_PATH : ${makeLibraryPath [ webkitgtk ]} --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ webkitgtk ]}
''; '';
meta = kotatogram-desktop.meta // { meta = kotatogram-desktop.meta // {
platforms = platforms.linux; platforms = lib.platforms.linux;
}; };
} }

View file

@ -3,8 +3,6 @@
, xorg , xorg
}: }:
with lib;
let let
bits = "x86_64"; bits = "x86_64";
@ -19,7 +17,7 @@ let
categories = [ "Network" ]; categories = [ "Network" ];
}; };
tarball = "Wavebox_${replaceStrings ["."] ["_"] (toString version)}_linux_${bits}.tar.gz"; tarball = "Wavebox_${lib.replaceStrings ["."] ["_"] (toString version)}_linux_${bits}.tar.gz";
in stdenv.mkDerivation { in stdenv.mkDerivation {
pname = "wavebox"; pname = "wavebox";
@ -40,7 +38,7 @@ in stdenv.mkDerivation {
alsa-lib gtk3 nss alsa-lib gtk3 nss
]; ];
runtimeDependencies = [ (getLib udev) libnotify ]; runtimeDependencies = [ (lib.getLib udev) libnotify ];
installPhase = '' installPhase = ''
mkdir -p $out/bin $out/opt/wavebox mkdir -p $out/bin $out/opt/wavebox

View file

@ -2,8 +2,6 @@
, nixosTests , nixosTests
}: }:
with lib;
perlPackages.buildPerlPackage rec { perlPackages.buildPerlPackage rec {
pname = "convos"; pname = "convos";
version = "7.02"; version = "7.02";
@ -16,7 +14,7 @@ perlPackages.buildPerlPackage rec {
}; };
nativeBuildInputs = [ makeWrapper ] nativeBuildInputs = [ makeWrapper ]
++ optionals stdenv.isDarwin [ shortenPerlShebang ]; ++ lib.optionals stdenv.isDarwin [ shortenPerlShebang ];
buildInputs = with perlPackages; [ buildInputs = with perlPackages; [
CryptPassphrase CryptPassphraseArgon2 CryptPassphraseBcrypt CryptPassphrase CryptPassphraseArgon2 CryptPassphraseBcrypt
@ -79,7 +77,7 @@ perlPackages.buildPerlPackage rec {
ln -s $AUTO_SHARE_PATH/public/asset $out/asset ln -s $AUTO_SHARE_PATH/public/asset $out/asset
cp -vR templates $out/templates cp -vR templates $out/templates
cp cpanfile $out/cpanfile cp cpanfile $out/cpanfile
'' + optionalString stdenv.isDarwin '' '' + lib.optionalString stdenv.isDarwin ''
shortenPerlShebang $out/bin/convos shortenPerlShebang $out/bin/convos
'' + '' '' + ''
wrapProgram $out/bin/convos --set MOJO_HOME $out wrapProgram $out/bin/convos --set MOJO_HOME $out
@ -91,6 +89,6 @@ perlPackages.buildPerlPackage rec {
homepage = "https://convos.chat"; homepage = "https://convos.chat";
description = "Convos is the simplest way to use IRC in your browser"; description = "Convos is the simplest way to use IRC in your browser";
license = lib.licenses.artistic2; license = lib.licenses.artistic2;
maintainers = with maintainers; [ sgo ]; maintainers = with lib.maintainers; [ sgo ];
}; };
} }

View file

@ -52,8 +52,6 @@
, enablePluginVcalendar ? true, libical , enablePluginVcalendar ? true, libical
}: }:
with lib;
let let
pythonPkgs = with python3.pkgs; [ python3 wrapPython pygobject3 ]; pythonPkgs = with python3.pkgs; [ python3 wrapPython pygobject3 ];
@ -130,7 +128,7 @@ in stdenv.mkDerivation rec {
buildInputs = buildInputs =
[ curl gsettings-desktop-schemas glib-networking gtk3 ] [ curl gsettings-desktop-schemas glib-networking gtk3 ]
++ concatMap (f: optionals f.enabled f.deps) (filter (f: f ? deps) features) ++ lib.concatMap (f: lib.optionals f.enabled f.deps) (lib.filter (f: f ? deps) features)
; ;
configureFlags = configureFlags =
@ -141,7 +139,7 @@ in stdenv.mkDerivation rec {
"--disable-gdata-plugin" # Complains about missing libgdata, even when provided "--disable-gdata-plugin" # Complains about missing libgdata, even when provided
] ++ ] ++
(map (feature: map (flag: strings.enableFeature feature.enabled flag) feature.flags) features); (map (feature: map (flag: lib.strings.enableFeature feature.enabled flag) feature.flags) features);
enableParallelBuilding = true; enableParallelBuilding = true;
@ -155,7 +153,7 @@ in stdenv.mkDerivation rec {
cp claws-mail.desktop $out/share/applications cp claws-mail.desktop $out/share/applications
''; '';
meta = { meta = with lib; {
description = "The user-friendly, lightweight, and fast email client"; description = "The user-friendly, lightweight, and fast email client";
homepage = "https://www.claws-mail.org/"; homepage = "https://www.claws-mail.org/";
license = licenses.gpl3Plus; license = licenses.gpl3Plus;

View file

@ -4,8 +4,6 @@
assert gpgSupport -> gpgme != null; assert gpgSupport -> gpgme != null;
assert sslSupport -> openssl != null; assert sslSupport -> openssl != null;
with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "sylpheed"; pname = "sylpheed";
version = "3.7.0"; version = "3.7.0";
@ -33,17 +31,17 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkg-config ]; nativeBuildInputs = [ pkg-config ];
buildInputs = [ gtk2 ] buildInputs = [ gtk2 ]
++ optionals gpgSupport [ gpgme ] ++ lib.optionals gpgSupport [ gpgme ]
++ optionals sslSupport [ openssl ] ++ lib.optionals sslSupport [ openssl ]
++ optionals stdenv.isDarwin [ Foundation ]; ++ lib.optionals stdenv.isDarwin [ Foundation ];
configureFlags = optional gpgSupport "--enable-gpgme" configureFlags = lib.optional gpgSupport "--enable-gpgme"
++ optional sslSupport "--enable-ssl"; ++ lib.optional sslSupport "--enable-ssl";
# Undefined symbols for architecture arm64: "_OBJC_CLASS_$_NSAutoreleasePool" # Undefined symbols for architecture arm64: "_OBJC_CLASS_$_NSAutoreleasePool"
NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-framework Foundation"; NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-framework Foundation";
meta = { meta = with lib; {
homepage = "https://sylpheed.sraoss.jp/en/"; homepage = "https://sylpheed.sraoss.jp/en/";
description = "Lightweight and user-friendly e-mail client"; description = "Lightweight and user-friendly e-mail client";
maintainers = with maintainers; [ eelco ]; maintainers = with maintainers; [ eelco ];

View file

@ -9,7 +9,6 @@
assert guiSupport -> (dbus != null); assert guiSupport -> (dbus != null);
assert trackerSearch -> (python3 != null); assert trackerSearch -> (python3 != null);
with lib;
mkDerivation rec { mkDerivation rec {
pname = "qbittorrent"; pname = "qbittorrent";
version = "4.4.5"; version = "4.4.5";
@ -27,8 +26,8 @@ mkDerivation rec {
nativeBuildInputs = [ pkg-config ]; nativeBuildInputs = [ pkg-config ];
buildInputs = [ boost libtorrent-rasterbar qtbase qttools qtsvg ] buildInputs = [ boost libtorrent-rasterbar qtbase qttools qtsvg ]
++ optional guiSupport dbus # D(esktop)-Bus depends on GUI support ++ lib.optional guiSupport dbus # D(esktop)-Bus depends on GUI support
++ optional trackerSearch python3; ++ lib.optional trackerSearch python3;
# Otherwise qm_gen.pri assumes lrelease-qt5, which does not exist. # Otherwise qm_gen.pri assumes lrelease-qt5, which does not exist.
QMAKE_LRELEASE = "lrelease"; QMAKE_LRELEASE = "lrelease";
@ -36,11 +35,11 @@ mkDerivation rec {
configureFlags = [ configureFlags = [
"--with-boost-libdir=${boost.out}/lib" "--with-boost-libdir=${boost.out}/lib"
"--with-boost=${boost.dev}" ] "--with-boost=${boost.dev}" ]
++ optionals (!guiSupport) [ "--disable-gui" "--enable-systemd" ] # Also place qbittorrent-nox systemd service files ++ lib.optionals (!guiSupport) [ "--disable-gui" "--enable-systemd" ] # Also place qbittorrent-nox systemd service files
++ optional (!webuiSupport) "--disable-webui" ++ lib.optional (!webuiSupport) "--disable-webui"
++ optional debugSupport "--enable-debug"; ++ lib.optional debugSupport "--enable-debug";
qtWrapperArgs = optional trackerSearch "--prefix PATH : ${makeBinPath [ python3 ]}"; qtWrapperArgs = lib.optional trackerSearch "--prefix PATH : ${lib.makeBinPath [ python3 ]}";
postInstall = lib.optionalString stdenv.isDarwin '' postInstall = lib.optionalString stdenv.isDarwin ''
mkdir -p $out/{Applications,bin} mkdir -p $out/{Applications,bin}
@ -48,7 +47,7 @@ mkDerivation rec {
makeWrapper $out/{Applications/qbittorrent.app/Contents/MacOS,bin}/qbittorrent makeWrapper $out/{Applications/qbittorrent.app/Contents/MacOS,bin}/qbittorrent
''; '';
meta = { meta = with lib; {
description = "Featureful free software BitTorrent client"; description = "Featureful free software BitTorrent client";
homepage = "https://www.qbittorrent.org/"; homepage = "https://www.qbittorrent.org/";
changelog = "https://github.com/qbittorrent/qBittorrent/blob/release-${version}/Changelog"; changelog = "https://github.com/qbittorrent/qBittorrent/blob/release-${version}/Changelog";

View file

@ -8,8 +8,6 @@
assert withQt -> qt5 != null; assert withQt -> qt5 != null;
with lib;
let let
version = "4.0.2"; version = "4.0.2";
variant = if withQt then "qt" else "cli"; variant = if withQt then "qt" else "cli";
@ -39,17 +37,17 @@ in stdenv.mkDerivation {
NIX_CFLAGS_COMPILE = [ "-DQT_NO_DEBUG" ]; NIX_CFLAGS_COMPILE = [ "-DQT_NO_DEBUG" ];
nativeBuildInputs = [ asciidoctor bison cmake flex makeWrapper pkg-config python3 perl ] nativeBuildInputs = [ asciidoctor bison cmake flex makeWrapper pkg-config python3 perl ]
++ optionals withQt [ qt5.wrapQtAppsHook wrapGAppsHook ]; ++ lib.optionals withQt [ qt5.wrapQtAppsHook wrapGAppsHook ];
depsBuildBuild = [ buildPackages.stdenv.cc ]; depsBuildBuild = [ buildPackages.stdenv.cc ];
buildInputs = [ buildInputs = [
gettext pcre2 libpcap lua5 libssh nghttp2 openssl libgcrypt gettext pcre2 libpcap lua5 libssh nghttp2 openssl libgcrypt
libgpg-error gnutls geoip c-ares glib zlib libgpg-error gnutls geoip c-ares glib zlib
] ++ optionals withQt (with qt5; [ qtbase qtmultimedia qtsvg qttools ]) ] ++ lib.optionals withQt (with qt5; [ qtbase qtmultimedia qtsvg qttools ])
++ optionals stdenv.isLinux [ libcap libnl ] ++ lib.optionals stdenv.isLinux [ libcap libnl ]
++ optionals stdenv.isDarwin [ SystemConfiguration ApplicationServices gmp ] ++ lib.optionals stdenv.isDarwin [ SystemConfiguration ApplicationServices gmp ]
++ optionals (withQt && stdenv.isDarwin) (with qt5; [ qtmacextras ]); ++ lib.optionals (withQt && stdenv.isDarwin) (with qt5; [ qtmacextras ]);
strictDeps = true; strictDeps = true;
@ -72,7 +70,7 @@ in stdenv.mkDerivation {
install_name_tool -change "$dylib" "$out/lib/$dylib" "$f" install_name_tool -change "$dylib" "$out/lib/$dylib" "$f"
done done
done done
'' else optionalString withQt '' '' else lib.optionalString withQt ''
pwd pwd
install -Dm644 -t $out/share/applications ../resources/freedesktop/org.wireshark.Wireshark.desktop install -Dm644 -t $out/share/applications ../resources/freedesktop/org.wireshark.Wireshark.desktop

View file

@ -9,8 +9,6 @@
, withDebug ? false , withDebug ? false
}: }:
with lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "znc"; pname = "znc";
version = "1.8.2"; version = "1.8.2";
@ -23,12 +21,12 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkg-config ]; nativeBuildInputs = [ pkg-config ];
buildInputs = [ openssl ] buildInputs = [ openssl ]
++ optional withPerl perl ++ lib.optional withPerl perl
++ optional withPython python3 ++ lib.optional withPython python3
++ optional withTcl tcl ++ lib.optional withTcl tcl
++ optional withCyrus cyrus_sasl ++ lib.optional withCyrus cyrus_sasl
++ optional withUnicode icu ++ lib.optional withUnicode icu
++ optional withZlib zlib; ++ lib.optional withZlib zlib;
configureFlags = [ configureFlags = [
(lib.enableFeature withPerl "perl") (lib.enableFeature withPerl "perl")
@ -36,8 +34,8 @@ stdenv.mkDerivation rec {
(lib.enableFeature withTcl "tcl") (lib.enableFeature withTcl "tcl")
(lib.withFeatureAs withTcl "tcl" "${tcl}/lib") (lib.withFeatureAs withTcl "tcl" "${tcl}/lib")
(lib.enableFeature withCyrus "cyrus") (lib.enableFeature withCyrus "cyrus")
] ++ optionals (!withIPv6) [ "--disable-ipv6" ] ] ++ lib.optionals (!withIPv6) [ "--disable-ipv6" ]
++ optionals withDebug [ "--enable-debug" ]; ++ lib.optionals withDebug [ "--enable-debug" ];
enableParallelBuilding = true; enableParallelBuilding = true;