From 9f46beb6a7ea29625a029d5a96cc1df51aa74edf Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Tue, 23 May 2023 12:15:11 +0300 Subject: [PATCH 01/34] cudaPackages.setupCudaHook: init --- .../compilers/cudatoolkit/common.nix | 18 ++--- .../compilers/cudatoolkit/extension.nix | 32 ++++++++- .../hooks/mark-for-cudatoolkit-root-hook.sh | 8 +++ .../cudatoolkit/hooks/setup-cuda-hook.sh | 68 +++++++++++++++++++ .../redist/build-cuda-redist-package.nix | 2 + .../cudatoolkit/redist/overrides.nix | 41 ++++------- 6 files changed, 129 insertions(+), 40 deletions(-) create mode 100644 pkgs/development/compilers/cudatoolkit/hooks/mark-for-cudatoolkit-root-hook.sh create mode 100644 pkgs/development/compilers/cudatoolkit/hooks/setup-cuda-hook.sh diff --git a/pkgs/development/compilers/cudatoolkit/common.nix b/pkgs/development/compilers/cudatoolkit/common.nix index 2e15012452a8..617c2fd99580 100644 --- a/pkgs/development/compilers/cudatoolkit/common.nix +++ b/pkgs/development/compilers/cudatoolkit/common.nix @@ -24,6 +24,7 @@ args@ , libkrb5 , krb5 , makeWrapper +, markForCudatoolkitRootHook , ncurses5 , numactl , nss @@ -31,6 +32,7 @@ args@ , python3 # FIXME: CUDAToolkit 10 may still need python27 , pulseaudio , requireFile +, setupCudaHook , stdenv , backendStdenv # E.g. gcc11Stdenv, set in extension.nix , unixODBC @@ -80,11 +82,15 @@ backendStdenv.mkDerivation rec { addOpenGLRunpath autoPatchelfHook autoAddOpenGLRunpathHook + markForCudatoolkitRootHook ] ++ lib.optionals (lib.versionOlder version "11") [ libsForQt5.wrapQtAppsHook ] ++ lib.optionals (lib.versionAtLeast version "11.8") [ qt6Packages.wrapQtAppsHook ]; + depsTargetTargetPropagated = [ + setupCudaHook + ]; buildInputs = lib.optionals (lib.versionOlder version "11") [ libsForQt5.qt5.qtwebengine freeglut @@ -280,24 +286,12 @@ backendStdenv.mkDerivation rec { sed -i "1 i#define _BITS_FLOATN_H" "$out/include/host_defines.h" '' + # Point NVCC at a compatible compiler - # FIXME: redist cuda_nvcc copy-pastes this code - # Refer to comments in the overrides for cuda_nvcc for explanation # CUDA_TOOLKIT_ROOT_DIR is legacy, # Cf. https://cmake.org/cmake/help/latest/module/FindCUDA.html#input-variables - # NOTE: We unconditionally set -Xfatbin=-compress-all, which reduces the size of the compiled - # binaries. If binaries grow over 2GB, they will fail to link. This is a problem for us, as - # the default set of CUDA capabilities we build can regularly cause this to occur (for - # example, with Magma). '' mkdir -p $out/nix-support cat <> $out/nix-support/setup-hook cmakeFlags+=' -DCUDA_TOOLKIT_ROOT_DIR=$out' - cmakeFlags+=' -DCUDA_HOST_COMPILER=${backendStdenv.cc}/bin' - cmakeFlags+=' -DCMAKE_CUDA_HOST_COMPILER=${backendStdenv.cc}/bin' - if [ -z "\''${CUDAHOSTCXX-}" ]; then - export CUDAHOSTCXX=${backendStdenv.cc}/bin; - fi - export NVCC_PREPEND_FLAGS+=' --compiler-bindir=${backendStdenv.cc}/bin -Xfatbin=-compress-all' EOF # Move some libraries to the lib output so that programs that diff --git a/pkgs/development/compilers/cudatoolkit/extension.nix b/pkgs/development/compilers/cudatoolkit/extension.nix index f14a55aa6cf7..a4a2b025ef96 100644 --- a/pkgs/development/compilers/cudatoolkit/extension.nix +++ b/pkgs/development/compilers/cudatoolkit/extension.nix @@ -38,10 +38,40 @@ final: prev: let cudaFlags = final.callPackage ./flags.nix {}; + # Internal hook, used by cudatoolkit and cuda redist packages + # to accommodate automatic CUDAToolkit_ROOT construction + markForCudatoolkitRootHook = (final.callPackage + ({ makeSetupHook }: + makeSetupHook + { name = "mark-for-cudatoolkit-root-hook"; } + ./hooks/mark-for-cudatoolkit-root-hook.sh) + { }); + + # Normally propagated by cuda_nvcc or cudatoolkit through their depsHostHostPropagated + setupCudaHook = (final.callPackage + ({ makeSetupHook, backendStdenv }: + makeSetupHook + { + name = "setup-cuda-hook"; + + substitutions.ccRoot = "${backendStdenv.cc}"; + + # Required in addition to ccRoot as otherwise bin/gcc is looked up + # when building CMakeCUDACompilerId.cu + substitutions.ccFullPath = "${backendStdenv.cc}/bin/${backendStdenv.cc.targetPrefix}c++"; + + # Required by cmake's enable_language(CUDA) to build a test program + substitutions.cudartRoot = prev.lib.getDev (final.cuda_cudart or final.cudatoolkit); + } + ./hooks/setup-cuda-hook.sh) + { }); + in { inherit backendStdenv cudatoolkit - cudaFlags; + cudaFlags + markForCudatoolkitRootHook + setupCudaHook; } diff --git a/pkgs/development/compilers/cudatoolkit/hooks/mark-for-cudatoolkit-root-hook.sh b/pkgs/development/compilers/cudatoolkit/hooks/mark-for-cudatoolkit-root-hook.sh new file mode 100644 index 000000000000..5c18760a3a2b --- /dev/null +++ b/pkgs/development/compilers/cudatoolkit/hooks/mark-for-cudatoolkit-root-hook.sh @@ -0,0 +1,8 @@ +# shellcheck shell=bash + +markForCUDAToolkit_ROOT() { + mkdir -p "${prefix}/nix-support" + touch "${prefix}/nix-support/include-in-cudatoolkit-root" +} + +fixupOutputHooks+=(markForCUDAToolkit_ROOT) diff --git a/pkgs/development/compilers/cudatoolkit/hooks/setup-cuda-hook.sh b/pkgs/development/compilers/cudatoolkit/hooks/setup-cuda-hook.sh new file mode 100644 index 000000000000..89256e86f789 --- /dev/null +++ b/pkgs/development/compilers/cudatoolkit/hooks/setup-cuda-hook.sh @@ -0,0 +1,68 @@ +# shellcheck shell=bash + +echo Sourcing setup-cuda-hook >&2 + +extendCUDAToolkit_ROOT() { + if [[ -f "$1/nix-support/include-in-cudatoolkit-root" ]] ; then + addToSearchPathWithCustomDelimiter ";" CUDAToolkit_ROOT "$1" + + if [[ -d "$1/include" ]] ; then + addToSearchPathWithCustomDelimiter ";" CUDAToolkit_INCLUDE_DIR "$1/include" + fi + fi +} + +addEnvHooks "$targetOffset" extendCUDAToolkit_ROOT + +setupCUDAToolkitCompilers() { + echo Executing setupCUDAToolkitCompilers >&2 + + if [[ -n "${dontSetupCUDAToolkitCompilers-}" ]] ; then + return + fi + + # Point NVCC at a compatible compiler + + # For CMake-based projects: + # https://cmake.org/cmake/help/latest/module/FindCUDA.html#input-variables + # https://cmake.org/cmake/help/latest/envvar/CUDAHOSTCXX.html + # https://cmake.org/cmake/help/latest/variable/CMAKE_CUDA_HOST_COMPILER.html + + export cmakeFlags+=" -DCUDA_HOST_COMPILER=@ccFullPath@" + export cmakeFlags+=" -DCMAKE_CUDA_HOST_COMPILER=@ccFullPath@" + + # For non-CMake projects: + # We prepend --compiler-bindir to nvcc flags. + # Downstream packages can override these, because NVCC + # uses the last --compiler-bindir it gets on the command line. + # FIXME: this results in "incompatible redefinition" warnings. + # https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#compiler-bindir-directory-ccbin + if [ -z "${CUDAHOSTCXX-}" ]; then + export CUDAHOSTCXX="@ccFullPath@"; + fi + + export NVCC_PREPEND_FLAGS+=" --compiler-bindir=@ccRoot@/bin" + + # NOTE: We set -Xfatbin=-compress-all, which reduces the size of the compiled + # binaries. If binaries grow over 2GB, they will fail to link. This is a problem for us, as + # the default set of CUDA capabilities we build can regularly cause this to occur (for + # example, with Magma). + # + # @SomeoneSerge: original comment was made by @ConnorBaker in .../cudatoolkit/common.nix + if [[ -z "${dontCompressFatbin-}" ]]; then + export NVCC_PREPEND_FLAGS+=" -Xfatbin=-compress-all" + fi + + # CMake's enable_language(CUDA) runs a compiler test and it doesn't account for + # CUDAToolkit_ROOT. We have to help it locate libcudart + if [[ -z "${nvccDontPrependCudartFlags-}" ]] ; then + export NVCC_APPEND_FLAGS+=" -L@cudartRoot@/lib -I@cudartRoot@/include" + fi +} + +setupCMakeCUDAToolkit_ROOT() { + export cmakeFlags+=" -DCUDAToolkit_INCLUDE_DIR=$CUDAToolkit_INCLUDE_DIR -DCUDAToolkit_ROOT=$CUDAToolkit_ROOT" +} + +postHooks+=(setupCUDAToolkitCompilers) +preConfigureHooks+=(setupCMakeCUDAToolkit_ROOT) diff --git a/pkgs/development/compilers/cudatoolkit/redist/build-cuda-redist-package.nix b/pkgs/development/compilers/cudatoolkit/redist/build-cuda-redist-package.nix index 3a6a16b1d769..ec2c9cf72a9e 100644 --- a/pkgs/development/compilers/cudatoolkit/redist/build-cuda-redist-package.nix +++ b/pkgs/development/compilers/cudatoolkit/redist/build-cuda-redist-package.nix @@ -4,6 +4,7 @@ , fetchurl , autoPatchelfHook , autoAddOpenGLRunpathHook +, markForCudatoolkitRootHook }: pname: @@ -28,6 +29,7 @@ backendStdenv.mkDerivation { # directory to the rpath of all ELF binaries. # Check e.g. with `patchelf --print-rpath path/to/my/binary autoAddOpenGLRunpathHook + markForCudatoolkitRootHook ]; buildInputs = [ diff --git a/pkgs/development/compilers/cudatoolkit/redist/overrides.nix b/pkgs/development/compilers/cudatoolkit/redist/overrides.nix index 7b8e02de2474..c0008ce797c6 100644 --- a/pkgs/development/compilers/cudatoolkit/redist/overrides.nix +++ b/pkgs/development/compilers/cudatoolkit/redist/overrides.nix @@ -28,34 +28,21 @@ in in { # Point NVCC at a compatible compiler - # FIXME: non-redist cudatoolkit copy-pastes this code - # For CMake-based projects: - # https://cmake.org/cmake/help/latest/module/FindCUDA.html#input-variables - # https://cmake.org/cmake/help/latest/envvar/CUDAHOSTCXX.html - # https://cmake.org/cmake/help/latest/variable/CMAKE_CUDA_HOST_COMPILER.html - - # For non-CMake projects: - # We prepend --compiler-bindir to nvcc flags. - # Downstream packages can override these, because NVCC - # uses the last --compiler-bindir it gets on the command line. - # FIXME: this results in "incompatible redefinition" warnings. - # https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#compiler-bindir-directory-ccbin - # NOTE: We unconditionally set -Xfatbin=-compress-all, which reduces the size of the - # compiled binaries. If binaries grow over 2GB, they will fail to link. This is a problem - # for us, as the default set of CUDA capabilities we build can regularly cause this to - # occur (for example, with Magma). - postInstall = (oldAttrs.postInstall or "") + '' - mkdir -p $out/nix-support - cat <> $out/nix-support/setup-hook - cmakeFlags+=' -DCUDA_HOST_COMPILER=${cc}/bin' - cmakeFlags+=' -DCMAKE_CUDA_HOST_COMPILER=${cc}/bin' - if [ -z "\''${CUDAHOSTCXX-}" ]; then - export CUDAHOSTCXX=${cc}/bin; - fi - export NVCC_PREPEND_FLAGS+=' --compiler-bindir=${cc}/bin -Xfatbin=-compress-all' - EOF - ''; + # Desiredata: whenever a package (e.g. magma) adds cuda_nvcc to + # nativeBuildInputs (offsets `(-1, 0)`), magma should also source the + # setupCudaHook, i.e. we want it the hook to be propagated into the + # same nativeBuildInputs. + # + # Logically, cuda_nvcc should include the hook in depsHostHostPropagated, + # so that the final offsets for the propagated hook would be `(-1, 0) + + # (0, 0) = (-1, 0)`. + # + # In practice, TargetTarget appears to work: + # https://gist.github.com/fd80ff142cd25e64603618a3700e7f82 + depsTargetTargetPropagated = [ + final.setupCudaHook + ]; }); cuda_nvprof = prev.cuda_nvprof.overrideAttrs (oldAttrs: { From bfb24acbd0804c9fd7964eadebde8f6d53eff7f9 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Thu, 20 Jul 2023 02:17:27 +0300 Subject: [PATCH 02/34] cudaPackages_10.cudatoolkit: fix infinite recursion in setupCudaHook --- pkgs/development/compilers/cudatoolkit/extension.nix | 3 --- .../compilers/cudatoolkit/hooks/nvcc-setup-hook.sh | 5 +++++ pkgs/development/compilers/cudatoolkit/redist/overrides.nix | 5 +++++ 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 pkgs/development/compilers/cudatoolkit/hooks/nvcc-setup-hook.sh diff --git a/pkgs/development/compilers/cudatoolkit/extension.nix b/pkgs/development/compilers/cudatoolkit/extension.nix index a4a2b025ef96..d1afa200e9ef 100644 --- a/pkgs/development/compilers/cudatoolkit/extension.nix +++ b/pkgs/development/compilers/cudatoolkit/extension.nix @@ -59,9 +59,6 @@ final: prev: let # Required in addition to ccRoot as otherwise bin/gcc is looked up # when building CMakeCUDACompilerId.cu substitutions.ccFullPath = "${backendStdenv.cc}/bin/${backendStdenv.cc.targetPrefix}c++"; - - # Required by cmake's enable_language(CUDA) to build a test program - substitutions.cudartRoot = prev.lib.getDev (final.cuda_cudart or final.cudatoolkit); } ./hooks/setup-cuda-hook.sh) { }); diff --git a/pkgs/development/compilers/cudatoolkit/hooks/nvcc-setup-hook.sh b/pkgs/development/compilers/cudatoolkit/hooks/nvcc-setup-hook.sh new file mode 100644 index 000000000000..89801eb7c21a --- /dev/null +++ b/pkgs/development/compilers/cudatoolkit/hooks/nvcc-setup-hook.sh @@ -0,0 +1,5 @@ +# shellcheck shell=bash + +# CMake's enable_language(CUDA) runs a compiler test and it doesn't account for +# CUDAToolkit_ROOT. We have to help it locate libcudart +export NVCC_APPEND_FLAGS+=" -L@cudartRoot@/lib -I@cudartRoot@/include" diff --git a/pkgs/development/compilers/cudatoolkit/redist/overrides.nix b/pkgs/development/compilers/cudatoolkit/redist/overrides.nix index c0008ce797c6..b962b6caa1b2 100644 --- a/pkgs/development/compilers/cudatoolkit/redist/overrides.nix +++ b/pkgs/development/compilers/cudatoolkit/redist/overrides.nix @@ -27,6 +27,11 @@ in inherit (prev.backendStdenv) cc; in { + # Required by cmake's enable_language(CUDA) to build a test program + # When implementing cross-compilation support: this is + # final.pkgs.targetPackages.cudaPackages.cuda_cudart + env.cudartRoot = "${prev.lib.getDev final.cuda_cudart}"; + # Point NVCC at a compatible compiler # Desiredata: whenever a package (e.g. magma) adds cuda_nvcc to From 4df8614c048509ee21bc66405394107498bb03a0 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Tue, 23 May 2023 18:32:26 +0300 Subject: [PATCH 03/34] magma: symlinkJoin -> CUDAToolkit_ROOT --- .../libraries/science/math/magma/generic.nix | 37 +++++-------------- 1 file changed, 10 insertions(+), 27 deletions(-) diff --git a/pkgs/development/libraries/science/math/magma/generic.nix b/pkgs/development/libraries/science/math/magma/generic.nix index d10da6843c36..04f263568ce6 100644 --- a/pkgs/development/libraries/science/math/magma/generic.nix +++ b/pkgs/development/libraries/science/math/magma/generic.nix @@ -86,29 +86,6 @@ let # "75" -> "750" Cf. https://bitbucket.org/icl/magma/src/f4ec79e2c13a2347eff8a77a3be6f83bc2daec20/CMakeLists.txt#lines-273 "${minArch'}0"; - cuda-common-redist = with cudaPackages; [ - libcublas # cublas_v2.h - libcusparse # cusparse.h - ]; - - # Build-time dependencies - cuda-native-redist = symlinkJoin { - name = "cuda-native-redist-${cudaVersion}"; - paths = with cudaPackages; [ - cuda_cudart # cuda_runtime.h - cuda_nvcc - ] ++ lists.optionals (strings.versionOlder cudaVersion "11.8") [ - cuda_nvprof # - ] ++ lists.optionals (strings.versionAtLeast cudaVersion "11.8") [ - cuda_profiler_api # - ] ++ cuda-common-redist; - }; - - # Run-time dependencies - cuda-redist = symlinkJoin { - name = "cuda-redist-${cudaVersion}"; - paths = cuda-common-redist; - }; in assert (builtins.match "[^[:space:]]*" gpuTargetString) != null; @@ -128,16 +105,22 @@ stdenv.mkDerivation { ninja gfortran ] ++ lists.optionals cudaSupport [ - cuda-native-redist + cudaPackages.cuda_nvcc ]; buildInputs = [ libpthreadstubs lapack blas - ] ++ lists.optionals cudaSupport [ - cuda-redist - ] ++ lists.optionals rocmSupport [ + ] ++ lists.optionals cudaSupport (with cudaPackages; [ + cuda_cudart + libcublas # cublas_v2.h + libcusparse # cusparse.h + ] ++ lists.optionals (strings.versionOlder cudaVersion "11.8") [ + cuda_nvprof # + ] ++ lists.optionals (strings.versionAtLeast cudaVersion "11.8") [ + cuda_profiler_api # + ]) ++ lists.optionals rocmSupport [ hip hipblas hipsparse From 251d3166c5b706eb33b985da6332fa6dfd5e43a3 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Tue, 11 Jul 2023 19:34:02 +0300 Subject: [PATCH 04/34] cudaPackages.saxpy: init at unstable-2023-07-11 --- .../compilers/cudatoolkit/extension.nix | 2 + .../cudatoolkit/saxpy/CMakeLists.txt | 12 ++++ .../compilers/cudatoolkit/saxpy/default.nix | 50 ++++++++++++++ .../compilers/cudatoolkit/saxpy/saxpy.cu | 68 +++++++++++++++++++ 4 files changed, 132 insertions(+) create mode 100644 pkgs/development/compilers/cudatoolkit/saxpy/CMakeLists.txt create mode 100644 pkgs/development/compilers/cudatoolkit/saxpy/default.nix create mode 100644 pkgs/development/compilers/cudatoolkit/saxpy/saxpy.cu diff --git a/pkgs/development/compilers/cudatoolkit/extension.nix b/pkgs/development/compilers/cudatoolkit/extension.nix index d1afa200e9ef..93800a0dbc6b 100644 --- a/pkgs/development/compilers/cudatoolkit/extension.nix +++ b/pkgs/development/compilers/cudatoolkit/extension.nix @@ -71,4 +71,6 @@ in cudaFlags markForCudatoolkitRootHook setupCudaHook; + + saxpy = final.callPackage ./saxpy { }; } diff --git a/pkgs/development/compilers/cudatoolkit/saxpy/CMakeLists.txt b/pkgs/development/compilers/cudatoolkit/saxpy/CMakeLists.txt new file mode 100644 index 000000000000..a6954e6e8bee --- /dev/null +++ b/pkgs/development/compilers/cudatoolkit/saxpy/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.25) +project(saxpy LANGUAGES CXX CUDA) + +find_package(CUDAToolkit REQUIRED COMPONENTS cudart cublas) + +add_executable(saxpy saxpy.cu) +target_link_libraries(saxpy PUBLIC CUDA::cublas CUDA::cudart m) +target_compile_features(saxpy PRIVATE cxx_std_14) +target_compile_options(saxpy PRIVATE $<$: + --expt-relaxed-constexpr>) + +install(TARGETS saxpy) diff --git a/pkgs/development/compilers/cudatoolkit/saxpy/default.nix b/pkgs/development/compilers/cudatoolkit/saxpy/default.nix new file mode 100644 index 000000000000..f347b43d1d11 --- /dev/null +++ b/pkgs/development/compilers/cudatoolkit/saxpy/default.nix @@ -0,0 +1,50 @@ +{ autoAddOpenGLRunpathHook +, backendStdenv +, cmake +, cuda_cccl +, cuda_cudart +, cudaFlags +, cuda_nvcc +, lib +, libcublas +, setupCudaHook +, stdenv +}: + +backendStdenv.mkDerivation { + pname = "saxpy"; + version = "unstable-2023-07-11"; + + src = ./.; + + buildInputs = [ + libcublas + cuda_cudart + cuda_cccl + ]; + nativeBuildInputs = [ + cmake + + # NOTE: this needs to be pkgs.buildPackages.cudaPackages_XX_Y.cuda_nvcc for + # cross-compilation to work. This should work automatically once we move to + # spliced scopes. Delete this comment once that happens + cuda_nvcc + + # Alternatively, we could remove the propagated hook from cuda_nvcc and add + # directly: + # setupCudaHook + autoAddOpenGLRunpathHook + ]; + + cmakeFlags = [ + "-DCMAKE_VERBOSE_MAKEFILE=ON" + "-DCMAKE_CUDA_ARCHITECTURES=${with cudaFlags; builtins.concatStringsSep ";" (map dropDot cudaCapabilities)}" + ]; + + meta = { + description = "A simple (Single-precision AX Plus Y) FindCUDAToolkit.cmake example for testing cross-compilation"; + license = lib.licenses.mit; + maintainers = lib.teams.cuda.members; + platforms = lib.platforms.unix; + }; +} diff --git a/pkgs/development/compilers/cudatoolkit/saxpy/saxpy.cu b/pkgs/development/compilers/cudatoolkit/saxpy/saxpy.cu new file mode 100644 index 000000000000..912a6d1647b1 --- /dev/null +++ b/pkgs/development/compilers/cudatoolkit/saxpy/saxpy.cu @@ -0,0 +1,68 @@ +#include +#include +#include + +#include + +static inline void check(cudaError_t err, const char *context) { + if (err != cudaSuccess) { + fprintf(stderr, "CUDA error at %s: %s\n", context, cudaGetErrorString(err)); + std::exit(EXIT_FAILURE); + } +} + +#define CHECK(x) check(x, #x) + +__global__ void saxpy(int n, float a, float *x, float *y) { + int i = blockIdx.x * blockDim.x + threadIdx.x; + if (i < n) + y[i] = a * x[i] + y[i]; +} + +int main(void) { + setbuf(stderr, NULL); + fprintf(stderr, "Start\n"); + + int rtVersion, driverVersion; + CHECK(cudaRuntimeGetVersion(&rtVersion)); + CHECK(cudaDriverGetVersion(&driverVersion)); + + fprintf(stderr, "Runtime version: %d\n", rtVersion); + fprintf(stderr, "Driver version: %d\n", driverVersion); + + constexpr int N = 1 << 10; + + std::vector xHost(N), yHost(N); + for (int i = 0; i < N; i++) { + xHost[i] = 1.0f; + yHost[i] = 2.0f; + } + + fprintf(stderr, "Host memory initialized, copying to the device\n"); + fflush(stderr); + + float *xDevice, *yDevice; + CHECK(cudaMalloc(&xDevice, N * sizeof(float))); + CHECK(cudaMalloc(&yDevice, N * sizeof(float))); + + CHECK(cudaMemcpy(xDevice, xHost.data(), N * sizeof(float), + cudaMemcpyHostToDevice)); + CHECK(cudaMemcpy(yDevice, yHost.data(), N * sizeof(float), + cudaMemcpyHostToDevice)); + fprintf(stderr, "Scheduled a cudaMemcpy, calling the kernel\n"); + + saxpy<<<(N + 255) / 256, 256>>>(N, 2.0f, xDevice, yDevice); + fprintf(stderr, "Scheduled a kernel call\n"); + CHECK(cudaGetLastError()); + + CHECK(cudaMemcpy(yHost.data(), yDevice, N * sizeof(float), + cudaMemcpyDeviceToHost)); + + float maxError = 0.0f; + for (int i = 0; i < N; i++) + maxError = max(maxError, abs(yHost[i] - 4.0f)); + fprintf(stderr, "Max error: %f\n", maxError); + + CHECK(cudaFree(xDevice)); + CHECK(cudaFree(yDevice)); +} From 4fafb3b90b877263bf7674a77ed7be6cd235f5e1 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Fri, 31 Mar 2023 15:51:32 +0300 Subject: [PATCH 05/34] tree-wide: incorporate common out-of-tree cudaSupport overlays --- pkgs/development/compilers/cudatoolkit/common.nix | 2 +- pkgs/development/libraries/openmpi/default.nix | 4 ++-- pkgs/development/libraries/science/math/suitesparse/4.4.nix | 3 ++- .../libraries/science/math/suitesparse/default.nix | 3 ++- pkgs/development/libraries/ucx/default.nix | 3 ++- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/pkgs/development/compilers/cudatoolkit/common.nix b/pkgs/development/compilers/cudatoolkit/common.nix index 2e15012452a8..a6769ee84b6f 100644 --- a/pkgs/development/compilers/cudatoolkit/common.nix +++ b/pkgs/development/compilers/cudatoolkit/common.nix @@ -129,7 +129,7 @@ backendStdenv.mkDerivation rec { (lib.getLib libtiff) qt6Packages.qtwayland rdma-core - ucx + (ucx.override { enableCuda = false; }) # Avoid infinite recursion xorg.libxshmfence xorg.libxkbfile ] ++ (lib.optionals (lib.versionAtLeast version "12.1") (map lib.getLib ([ diff --git a/pkgs/development/libraries/openmpi/default.nix b/pkgs/development/libraries/openmpi/default.nix index e9a0fece56fc..1d2b0e759aa7 100644 --- a/pkgs/development/libraries/openmpi/default.nix +++ b/pkgs/development/libraries/openmpi/default.nix @@ -1,9 +1,9 @@ { lib, stdenv, fetchurl, gfortran, perl, libnl , rdma-core, zlib, numactl, libevent, hwloc, targetPackages, symlinkJoin , libpsm2, libfabric, pmix, ucx - +, config # Enable CUDA support -, cudaSupport ? false, cudatoolkit +, cudaSupport ? config.cudaSupport or false, cudatoolkit # Enable the Sun Grid Engine bindings , enableSGE ? false diff --git a/pkgs/development/libraries/science/math/suitesparse/4.4.nix b/pkgs/development/libraries/science/math/suitesparse/4.4.nix index 95eeaeb8abf3..0466027e03f3 100644 --- a/pkgs/development/libraries/science/math/suitesparse/4.4.nix +++ b/pkgs/development/libraries/science/math/suitesparse/4.4.nix @@ -1,5 +1,6 @@ { lib, stdenv, fetchurl, gfortran, blas, lapack -, enableCuda ? false, cudatoolkit +, config +, enableCuda ? config.cudaSupport or false, cudatoolkit }: let diff --git a/pkgs/development/libraries/science/math/suitesparse/default.nix b/pkgs/development/libraries/science/math/suitesparse/default.nix index 51b55592d42e..42413e66c714 100644 --- a/pkgs/development/libraries/science/math/suitesparse/default.nix +++ b/pkgs/development/libraries/science/math/suitesparse/default.nix @@ -6,7 +6,8 @@ , fixDarwinDylibNames , gmp , mpfr -, enableCuda ? false +, config +, enableCuda ? config.cudaSupport or false , cudatoolkit }: diff --git a/pkgs/development/libraries/ucx/default.nix b/pkgs/development/libraries/ucx/default.nix index 1af9a7ce7cb6..cc9cea442d31 100644 --- a/pkgs/development/libraries/ucx/default.nix +++ b/pkgs/development/libraries/ucx/default.nix @@ -1,6 +1,7 @@ { lib, stdenv, fetchFromGitHub, autoreconfHook, doxygen, numactl , rdma-core, libbfd, libiberty, perl, zlib, symlinkJoin, pkg-config -, enableCuda ? false +, config +, enableCuda ? config.cudaSupport or false , cudatoolkit , enableRocm ? false , rocm-core, rocm-runtime, rocm-device-libs, hip From 74549ec63bb6b125590bbb0fa2db24106c257a11 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Fri, 31 Mar 2023 15:56:07 +0300 Subject: [PATCH 06/34] tree-wide: 'enableCuda ? false' -> 'config.cudaSupport or false' to respect global defaults --- .../science/molecular-dynamics/gromacs/default.nix | 3 ++- pkgs/development/libraries/elpa/default.nix | 3 ++- pkgs/development/libraries/hwloc/default.nix | 3 ++- .../development/libraries/science/chemistry/openmm/default.nix | 3 ++- pkgs/development/libraries/ucc/default.nix | 3 ++- pkgs/games/katago/default.nix | 3 ++- pkgs/tools/compression/zfp/default.nix | 3 ++- 7 files changed, 14 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/science/molecular-dynamics/gromacs/default.nix b/pkgs/applications/science/molecular-dynamics/gromacs/default.nix index d08c15dd8a6a..fe7a0030175b 100644 --- a/pkgs/applications/science/molecular-dynamics/gromacs/default.nix +++ b/pkgs/applications/science/molecular-dynamics/gromacs/default.nix @@ -1,7 +1,8 @@ { lib, stdenv, fetchurl, cmake, hwloc, fftw, perl, blas, lapack, mpi, cudatoolkit , singlePrec ? true +, config , enableMpi ? false -, enableCuda ? false +, enableCuda ? config.cudaSupport or false , cpuAcceleration ? null }: diff --git a/pkgs/development/libraries/elpa/default.nix b/pkgs/development/libraries/elpa/default.nix index 65e83437f6ba..73ebf218ee38 100644 --- a/pkgs/development/libraries/elpa/default.nix +++ b/pkgs/development/libraries/elpa/default.nix @@ -4,10 +4,11 @@ , avxSupport ? stdenv.hostPlatform.avxSupport , avx2Support ? stdenv.hostPlatform.avx2Support , avx512Support ? stdenv.hostPlatform.avx512Support +, config # Enable NIVIA GPU support # Note, that this needs to be built on a system with a GPU # present for the tests to succeed. -, enableCuda ? false +, enableCuda ? config.cudaSupport or false # type of GPU architecture , nvidiaArch ? "sm_60" , cudatoolkit diff --git a/pkgs/development/libraries/hwloc/default.nix b/pkgs/development/libraries/hwloc/default.nix index fbef44bf67ea..8159f31bbbb5 100644 --- a/pkgs/development/libraries/hwloc/default.nix +++ b/pkgs/development/libraries/hwloc/default.nix @@ -2,7 +2,8 @@ , x11Support ? false , libX11 , cairo -, enableCuda ? false +, config +, enableCuda ? config.cudaSupport or false , cudaPackages }: diff --git a/pkgs/development/libraries/science/chemistry/openmm/default.nix b/pkgs/development/libraries/science/chemistry/openmm/default.nix index 2ad84249758a..8b25554c4ab1 100644 --- a/pkgs/development/libraries/science/chemistry/openmm/default.nix +++ b/pkgs/development/libraries/science/chemistry/openmm/default.nix @@ -11,7 +11,8 @@ , enableOpencl ? true , opencl-headers , ocl-icd -, enableCuda ? false +, config +, enableCuda ? config.cudaSupport or false , cudaPackages , addOpenGLRunpath }: diff --git a/pkgs/development/libraries/ucc/default.nix b/pkgs/development/libraries/ucc/default.nix index 56cebc08dccc..1c1804e9004c 100644 --- a/pkgs/development/libraries/ucc/default.nix +++ b/pkgs/development/libraries/ucc/default.nix @@ -1,5 +1,6 @@ { stdenv, lib, fetchFromGitHub, libtool, automake, autoconf, ucx -, enableCuda ? false +, config +, enableCuda ? config.cudaSupport or false , cudatoolkit , enableAvx ? stdenv.hostPlatform.avxSupport , enableSse41 ? stdenv.hostPlatform.sse4_1Support diff --git a/pkgs/games/katago/default.nix b/pkgs/games/katago/default.nix index cc49d6338a66..3d0b5a141c3c 100644 --- a/pkgs/games/katago/default.nix +++ b/pkgs/games/katago/default.nix @@ -1,6 +1,7 @@ { stdenv , boost , cmake +, config , cudaPackages , eigen , fetchFromGitHub @@ -14,7 +15,7 @@ , openssl , writeShellScriptBin , enableAVX2 ? stdenv.hostPlatform.avx2Support -, backend ? "opencl" +, backend ? if (config.cudaSupport or false) then "cuda" else "opencl" , enableBigBoards ? false , enableContrib ? false , enableTcmalloc ? true diff --git a/pkgs/tools/compression/zfp/default.nix b/pkgs/tools/compression/zfp/default.nix index 2d3890484e79..487cd02eb59c 100644 --- a/pkgs/tools/compression/zfp/default.nix +++ b/pkgs/tools/compression/zfp/default.nix @@ -1,6 +1,7 @@ { cmake, cudatoolkit, fetchFromGitHub, gfortran, lib, llvmPackages, python3Packages, stdenv +, config , enableCfp ? true -, enableCuda ? false +, enableCuda ? config.cudaSupport or false , enableFortran ? builtins.elem stdenv.targetPlatform.system gfortran.meta.platforms , enableOpenMP ? true , enablePython ? true From bf9e6fe9b852ea9185b9d495dc974491d4fbf355 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Fri, 31 Mar 2023 16:08:14 +0300 Subject: [PATCH 07/34] tree-wide: rm `cudaSupport ? false` formal parameters 'cudaSupport ? false' -> 'cudaSupport ? config.cudaSupport or false' to respect global defaults Packages expressions that take `cudaSupport ? false` are likely to ignore `config.cudaSupport`. Instead, we want them to make `cudaSupport` a required argument, or to explicitly refer to `config` --- pkgs/applications/science/math/cntk/default.nix | 3 ++- pkgs/applications/science/misc/colmap/default.nix | 3 ++- pkgs/development/libraries/arrayfire/default.nix | 3 ++- pkgs/development/python-modules/jaxlib/default.nix | 3 ++- pkgs/development/python-modules/libgpuarray/default.nix | 4 +++- pkgs/development/python-modules/numba/default.nix | 4 +++- pkgs/development/python-modules/tensorflow/bin.nix | 3 ++- pkgs/development/python-modules/tensorflow/default.nix | 3 ++- pkgs/development/python-modules/theano/default.nix | 5 +++-- pkgs/development/python-modules/torch/default.nix | 2 +- pkgs/servers/sunshine/default.nix | 3 ++- pkgs/tools/graphics/waifu2x-converter-cpp/default.nix | 3 ++- pkgs/tools/security/truecrack/default.nix | 3 ++- 13 files changed, 28 insertions(+), 14 deletions(-) diff --git a/pkgs/applications/science/math/cntk/default.nix b/pkgs/applications/science/math/cntk/default.nix index f885dae444ba..248504501613 100644 --- a/pkgs/applications/science/math/cntk/default.nix +++ b/pkgs/applications/science/math/cntk/default.nix @@ -2,7 +2,8 @@ , fetchpatch , openblas, blas, lapack, opencv3, libzip, boost, protobuf, mpi , onebitSGDSupport ? false -, cudaSupport ? false, cudaPackages ? {}, addOpenGLRunpath, cudatoolkit, nvidia_x11 +, config +, cudaSupport ? config.cudaSupport or false, cudaPackages ? {}, addOpenGLRunpath, cudatoolkit, nvidia_x11 , cudnnSupport ? cudaSupport }: diff --git a/pkgs/applications/science/misc/colmap/default.nix b/pkgs/applications/science/misc/colmap/default.nix index e3ce66356ba6..b32aa86f9f2f 100644 --- a/pkgs/applications/science/misc/colmap/default.nix +++ b/pkgs/applications/science/misc/colmap/default.nix @@ -1,6 +1,7 @@ { mkDerivation, lib, fetchFromGitHub, cmake, boost179, ceres-solver, eigen, freeimage, glog, libGLU, glew, qtbase, - cudaSupport ? false, cudaPackages }: + config, + cudaSupport ? config.cudaSupport or false, cudaPackages }: assert cudaSupport -> cudaPackages != { }; diff --git a/pkgs/development/libraries/arrayfire/default.nix b/pkgs/development/libraries/arrayfire/default.nix index 8692aa3017f7..edc3c3bad57b 100644 --- a/pkgs/development/libraries/arrayfire/default.nix +++ b/pkgs/development/libraries/arrayfire/default.nix @@ -19,7 +19,8 @@ , clblas , doxygen , buildDocs ? false -, cudaSupport ? false +, config +, cudaSupport ? config.cudaSupport or false , cudatoolkit , darwin }: diff --git a/pkgs/development/python-modules/jaxlib/default.nix b/pkgs/development/python-modules/jaxlib/default.nix index 2bcf5e9c17c3..1e5b7bb6f785 100644 --- a/pkgs/development/python-modules/jaxlib/default.nix +++ b/pkgs/development/python-modules/jaxlib/default.nix @@ -40,8 +40,9 @@ , snappy , zlib +, config # CUDA flags: -, cudaSupport ? false +, cudaSupport ? config.cudaSupport or false , cudaPackages ? {} # MKL: diff --git a/pkgs/development/python-modules/libgpuarray/default.nix b/pkgs/development/python-modules/libgpuarray/default.nix index 6b141af3c96d..6e5bb05913a2 100644 --- a/pkgs/development/python-modules/libgpuarray/default.nix +++ b/pkgs/development/python-modules/libgpuarray/default.nix @@ -9,7 +9,9 @@ , six , nose , mako -, cudaSupport ? false, cudaPackages +, config +, cudaSupport ? config.cudaSupport or false +, cudaPackages ? { } , openclSupport ? true, ocl-icd, clblas }: diff --git a/pkgs/development/python-modules/numba/default.nix b/pkgs/development/python-modules/numba/default.nix index fae84969a661..9b34d4e55ed1 100644 --- a/pkgs/development/python-modules/numba/default.nix +++ b/pkgs/development/python-modules/numba/default.nix @@ -14,12 +14,14 @@ , runCommand , fetchpatch +, config + # CUDA-only dependencies: , addOpenGLRunpath ? null , cudaPackages ? {} # CUDA flags: -, cudaSupport ? false +, cudaSupport ? config.cudaSupport or false }: let diff --git a/pkgs/development/python-modules/tensorflow/bin.nix b/pkgs/development/python-modules/tensorflow/bin.nix index a988a39c388b..c9047614b3cd 100644 --- a/pkgs/development/python-modules/tensorflow/bin.nix +++ b/pkgs/development/python-modules/tensorflow/bin.nix @@ -21,7 +21,8 @@ , backports_weakref , tensorflow-estimator-bin , tensorboard -, cudaSupport ? false +, config +, cudaSupport ? config.cudaSupport or false , cudaPackages ? {} , zlib , python diff --git a/pkgs/development/python-modules/tensorflow/default.nix b/pkgs/development/python-modules/tensorflow/default.nix index ba7c36c9503c..fabe1fe7cd2a 100644 --- a/pkgs/development/python-modules/tensorflow/default.nix +++ b/pkgs/development/python-modules/tensorflow/default.nix @@ -17,7 +17,8 @@ # that in nix as well. It would make some things easier and less confusing, but # it would also make the default tensorflow package unfree. See # https://groups.google.com/a/tensorflow.org/forum/#!topic/developers/iRCt5m4qUz0 -, cudaSupport ? false +, config +, cudaSupport ? config.cudaSupport or false , cudaPackages ? { } , cudaCapabilities ? cudaPackages.cudaFlags.cudaCapabilities , mklSupport ? false, mkl diff --git a/pkgs/development/python-modules/theano/default.nix b/pkgs/development/python-modules/theano/default.nix index 1bcbda650a25..3a1af4a3517b 100644 --- a/pkgs/development/python-modules/theano/default.nix +++ b/pkgs/development/python-modules/theano/default.nix @@ -11,8 +11,9 @@ , setuptools , six , libgpuarray -, cudaSupport ? false, cudaPackages ? {} -, cudnnSupport ? false +, config +, cudaSupport ? config.cudaSupport or false, cudaPackages ? {} +, cudnnSupport ? cudaSupport }: let diff --git a/pkgs/development/python-modules/torch/default.nix b/pkgs/development/python-modules/torch/default.nix index 5e0c56800073..98116052649a 100644 --- a/pkgs/development/python-modules/torch/default.nix +++ b/pkgs/development/python-modules/torch/default.nix @@ -1,5 +1,5 @@ { stdenv, lib, fetchFromGitHub, buildPythonPackage, python, - cudaSupport ? false, cudaPackages, magma, + config, cudaSupport ? config.cudaSupport or false, cudaPackages, magma, useSystemNccl ? true, MPISupport ? false, mpi, buildDocs ? false, diff --git a/pkgs/servers/sunshine/default.nix b/pkgs/servers/sunshine/default.nix index 300c21f2a879..e5a619de395f 100644 --- a/pkgs/servers/sunshine/default.nix +++ b/pkgs/servers/sunshine/default.nix @@ -30,7 +30,8 @@ , svt-av1 , vulkan-loader , libappindicator -, cudaSupport ? false +, config +, cudaSupport ? config.cudaSupport or false , cudaPackages ? {} }: let diff --git a/pkgs/tools/graphics/waifu2x-converter-cpp/default.nix b/pkgs/tools/graphics/waifu2x-converter-cpp/default.nix index d8cb710b2936..b0d9249197a8 100644 --- a/pkgs/tools/graphics/waifu2x-converter-cpp/default.nix +++ b/pkgs/tools/graphics/waifu2x-converter-cpp/default.nix @@ -1,5 +1,6 @@ { cmake, fetchFromGitHub, makeWrapper, opencv3, lib, stdenv, ocl-icd, opencl-headers, OpenCL -, cudaSupport ? false, cudatoolkit ? null +, config +, cudaSupport ? config.cudaSupport or false, cudatoolkit ? null }: stdenv.mkDerivation rec { diff --git a/pkgs/tools/security/truecrack/default.nix b/pkgs/tools/security/truecrack/default.nix index aebbbc79f8f4..aaf1b2580de6 100644 --- a/pkgs/tools/security/truecrack/default.nix +++ b/pkgs/tools/security/truecrack/default.nix @@ -1,5 +1,6 @@ { lib, gccStdenv, fetchFromGitLab, cudatoolkit -, cudaSupport ? false +, config +, cudaSupport ? config.cudaSupport or false , pkg-config }: gccStdenv.mkDerivation rec { From a17baa5db4f809809e4ae8cae66f2935cd37f2ab Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Fri, 31 Mar 2023 16:16:02 +0300 Subject: [PATCH 08/34] doc: update #cuda to reflect the recommended config.cudaSupport style --- doc/languages-frameworks/cuda.section.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/languages-frameworks/cuda.section.md b/doc/languages-frameworks/cuda.section.md index 6b19e02e74e9..b571ca257427 100644 --- a/doc/languages-frameworks/cuda.section.md +++ b/doc/languages-frameworks/cuda.section.md @@ -12,8 +12,11 @@ compatible are available as well. For example, there can be a To use one or more CUDA packages in an expression, give the expression a `cudaPackages` parameter, and in case CUDA is optional ```nix -cudaSupport ? false -cudaPackages ? {} +{ config +, cudaSupport ? config.cudaSupport or false +, cudaPackages ? { } +, ... +}: ``` When using `callPackage`, you can choose to pass in a different variant, e.g. From 133993211b39907a09986b338e9394908de223f2 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Thu, 20 Jul 2023 17:57:06 +0300 Subject: [PATCH 09/34] config.cudaSupport: init option --- doc/languages-frameworks/cuda.section.md | 2 +- pkgs/top-level/config.nix | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/languages-frameworks/cuda.section.md b/doc/languages-frameworks/cuda.section.md index b571ca257427..b7f1f19546a7 100644 --- a/doc/languages-frameworks/cuda.section.md +++ b/doc/languages-frameworks/cuda.section.md @@ -13,7 +13,7 @@ compatible are available as well. For example, there can be a To use one or more CUDA packages in an expression, give the expression a `cudaPackages` parameter, and in case CUDA is optional ```nix { config -, cudaSupport ? config.cudaSupport or false +, cudaSupport ? config.cudaSupport , cudaPackages ? { } , ... }: diff --git a/pkgs/top-level/config.nix b/pkgs/top-level/config.nix index 42053ce95de7..5e25231d957c 100644 --- a/pkgs/top-level/config.nix +++ b/pkgs/top-level/config.nix @@ -117,6 +117,12 @@ let ''; }; + cudaSupport = mkMassRebuild { + type = types.bool; + default = false; + feature = "build packages with CUDA support by default"; + }; + showDerivationWarnings = mkOption { type = types.listOf (types.enum [ "maintainerless" ]); default = []; From 471dbe9bcfb844fb045f5591c35967f15e161657 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Thu, 20 Jul 2023 18:08:19 +0300 Subject: [PATCH 10/34] treewide: consume config.cudaSupport as required Eliminate uses of `config.cudaSupport or false` and alike, since the option is now declared in config.nix with a default value fd .nix -t f -x sed 's/config\.cudaSupport or false, cudaPackages [?] [{][}]/config.cudaSupport, cudaPackages ? { }/' '{}' -i fd .nix -t f -x sed 's/config\.cudaSupport or false/config.cudaSupport/' '{}' -i fd .nix -t f -x sed 's/cudaSupport = pkgs.config.cudaSupport/inherit (pkgs.config) cudaSupport/' '{}' -i fd .nix -t f -x sed 's/cudaSupport = config.cudaSupport/inherit (config) cudaSupport/' '{}' -i --- .../applications/graphics/digikam/default.nix | 2 +- pkgs/applications/misc/blender/default.nix | 2 +- .../science/math/caffe/default.nix | 2 +- .../science/math/cntk/default.nix | 2 +- .../science/math/mathematica/default.nix | 2 +- .../science/math/mxnet/default.nix | 2 +- .../science/misc/colmap/default.nix | 2 +- .../molecular-dynamics/gromacs/default.nix | 2 +- .../libraries/arrayfire/default.nix | 2 +- pkgs/development/libraries/elpa/default.nix | 2 +- pkgs/development/libraries/frei0r/default.nix | 2 +- pkgs/development/libraries/hwloc/default.nix | 2 +- .../libraries/librealsense/default.nix | 2 +- .../libraries/lightgbm/default.nix | 2 +- pkgs/development/libraries/mlt/default.nix | 2 +- .../libraries/nvidia-thrust/default.nix | 2 +- pkgs/development/libraries/opencv/3.x.nix | 2 +- pkgs/development/libraries/opencv/4.x.nix | 2 +- .../development/libraries/openmpi/default.nix | 2 +- .../libraries/opensubdiv/default.nix | 2 +- .../science/chemistry/openmm/default.nix | 2 +- .../libraries/science/math/faiss/default.nix | 2 +- .../science/math/suitesparse/4.4.nix | 2 +- .../science/math/suitesparse/default.nix | 2 +- pkgs/development/libraries/ucc/default.nix | 2 +- pkgs/development/libraries/ucx/default.nix | 2 +- .../development/libraries/xgboost/default.nix | 2 +- .../python-modules/chainer/default.nix | 2 +- .../development/python-modules/jaxlib/bin.nix | 2 +- .../python-modules/jaxlib/default.nix | 2 +- .../python-modules/libgpuarray/default.nix | 2 +- .../python-modules/numba/default.nix | 2 +- .../python-modules/tensorflow/bin.nix | 2 +- .../python-modules/tensorflow/default.nix | 2 +- .../python-modules/theano/default.nix | 2 +- .../python-modules/torch/default.nix | 2 +- pkgs/games/katago/default.nix | 2 +- pkgs/servers/sunshine/default.nix | 2 +- pkgs/tools/compression/zfp/default.nix | 2 +- .../waifu2x-converter-cpp/default.nix | 2 +- pkgs/tools/security/hashcat/default.nix | 2 +- pkgs/tools/security/truecrack/default.nix | 2 +- pkgs/top-level/all-packages.nix | 10 ++++----- pkgs/top-level/python-packages.nix | 22 +++++++++---------- 44 files changed, 58 insertions(+), 58 deletions(-) diff --git a/pkgs/applications/graphics/digikam/default.nix b/pkgs/applications/graphics/digikam/default.nix index ab75938760b3..8a95d10203c4 100644 --- a/pkgs/applications/graphics/digikam/default.nix +++ b/pkgs/applications/graphics/digikam/default.nix @@ -54,7 +54,7 @@ , breeze-icons , oxygen -, cudaSupport ? config.cudaSupport or false +, cudaSupport ? config.cudaSupport , cudaPackages ? {} }: diff --git a/pkgs/applications/misc/blender/default.nix b/pkgs/applications/misc/blender/default.nix index 81b7a54a754d..f6f5edc84ef8 100644 --- a/pkgs/applications/misc/blender/default.nix +++ b/pkgs/applications/misc/blender/default.nix @@ -5,7 +5,7 @@ , openvdb, libXxf86vm, tbb, alembic , zlib, zstd, fftw, opensubdiv, freetype, jemalloc, ocl-icd, addOpenGLRunpath , jackaudioSupport ? false, libjack2 -, cudaSupport ? config.cudaSupport or false, cudaPackages ? {} +, cudaSupport ? config.cudaSupport, cudaPackages ? { } , hipSupport ? false, hip # comes with a significantly larger closure size , colladaSupport ? true, opencollada , spaceNavSupport ? stdenv.isLinux, libspnav diff --git a/pkgs/applications/science/math/caffe/default.nix b/pkgs/applications/science/math/caffe/default.nix index 4cd2511786b3..5af927294d6c 100644 --- a/pkgs/applications/science/math/caffe/default.nix +++ b/pkgs/applications/science/math/caffe/default.nix @@ -13,7 +13,7 @@ , Accelerate, CoreGraphics, CoreVideo , lmdbSupport ? true, lmdb , leveldbSupport ? true, leveldb, snappy -, cudaSupport ? config.cudaSupport or false, cudaPackages ? {} +, cudaSupport ? config.cudaSupport, cudaPackages ? { } , cudnnSupport ? cudaSupport , ncclSupport ? false , pythonSupport ? false, python ? null, numpy ? null diff --git a/pkgs/applications/science/math/cntk/default.nix b/pkgs/applications/science/math/cntk/default.nix index 248504501613..91d208a56ede 100644 --- a/pkgs/applications/science/math/cntk/default.nix +++ b/pkgs/applications/science/math/cntk/default.nix @@ -3,7 +3,7 @@ , openblas, blas, lapack, opencv3, libzip, boost, protobuf, mpi , onebitSGDSupport ? false , config -, cudaSupport ? config.cudaSupport or false, cudaPackages ? {}, addOpenGLRunpath, cudatoolkit, nvidia_x11 +, cudaSupport ? config.cudaSupport, cudaPackages ? { }, addOpenGLRunpath, cudatoolkit, nvidia_x11 , cudnnSupport ? cudaSupport }: diff --git a/pkgs/applications/science/math/mathematica/default.nix b/pkgs/applications/science/math/mathematica/default.nix index c0f370d88457..289c9b7b6580 100644 --- a/pkgs/applications/science/math/mathematica/default.nix +++ b/pkgs/applications/science/math/mathematica/default.nix @@ -2,7 +2,7 @@ , config , lib , cudaPackages -, cudaSupport ? config.cudaSupport or false +, cudaSupport ? config.cudaSupport , lang ? "en" , webdoc ? false , version ? null diff --git a/pkgs/applications/science/math/mxnet/default.nix b/pkgs/applications/science/math/mxnet/default.nix index 240a1759397f..1e7af371c509 100644 --- a/pkgs/applications/science/math/mxnet/default.nix +++ b/pkgs/applications/science/math/mxnet/default.nix @@ -1,6 +1,6 @@ { config, stdenv, lib, fetchurl, fetchpatch, bash, cmake , opencv3, gtest, blas, gomp, llvmPackages, perl -, cudaSupport ? config.cudaSupport or false, cudaPackages ? {}, nvidia_x11 +, cudaSupport ? config.cudaSupport, cudaPackages ? { }, nvidia_x11 , cudnnSupport ? cudaSupport }: diff --git a/pkgs/applications/science/misc/colmap/default.nix b/pkgs/applications/science/misc/colmap/default.nix index b32aa86f9f2f..a029f5440b25 100644 --- a/pkgs/applications/science/misc/colmap/default.nix +++ b/pkgs/applications/science/misc/colmap/default.nix @@ -1,7 +1,7 @@ { mkDerivation, lib, fetchFromGitHub, cmake, boost179, ceres-solver, eigen, freeimage, glog, libGLU, glew, qtbase, config, - cudaSupport ? config.cudaSupport or false, cudaPackages }: + cudaSupport ? config.cudaSupport, cudaPackages }: assert cudaSupport -> cudaPackages != { }; diff --git a/pkgs/applications/science/molecular-dynamics/gromacs/default.nix b/pkgs/applications/science/molecular-dynamics/gromacs/default.nix index fe7a0030175b..c1e4aa350295 100644 --- a/pkgs/applications/science/molecular-dynamics/gromacs/default.nix +++ b/pkgs/applications/science/molecular-dynamics/gromacs/default.nix @@ -2,7 +2,7 @@ , singlePrec ? true , config , enableMpi ? false -, enableCuda ? config.cudaSupport or false +, enableCuda ? config.cudaSupport , cpuAcceleration ? null }: diff --git a/pkgs/development/libraries/arrayfire/default.nix b/pkgs/development/libraries/arrayfire/default.nix index edc3c3bad57b..2c1caf0bbb2b 100644 --- a/pkgs/development/libraries/arrayfire/default.nix +++ b/pkgs/development/libraries/arrayfire/default.nix @@ -20,7 +20,7 @@ , doxygen , buildDocs ? false , config -, cudaSupport ? config.cudaSupport or false +, cudaSupport ? config.cudaSupport , cudatoolkit , darwin }: diff --git a/pkgs/development/libraries/elpa/default.nix b/pkgs/development/libraries/elpa/default.nix index 73ebf218ee38..ec108adc61eb 100644 --- a/pkgs/development/libraries/elpa/default.nix +++ b/pkgs/development/libraries/elpa/default.nix @@ -8,7 +8,7 @@ # Enable NIVIA GPU support # Note, that this needs to be built on a system with a GPU # present for the tests to succeed. -, enableCuda ? config.cudaSupport or false +, enableCuda ? config.cudaSupport # type of GPU architecture , nvidiaArch ? "sm_60" , cudatoolkit diff --git a/pkgs/development/libraries/frei0r/default.nix b/pkgs/development/libraries/frei0r/default.nix index dbf5b9c2373e..0215b82a828c 100644 --- a/pkgs/development/libraries/frei0r/default.nix +++ b/pkgs/development/libraries/frei0r/default.nix @@ -7,7 +7,7 @@ , opencv , pcre , pkg-config -, cudaSupport ? config.cudaSupport or false +, cudaSupport ? config.cudaSupport , cudaPackages }: diff --git a/pkgs/development/libraries/hwloc/default.nix b/pkgs/development/libraries/hwloc/default.nix index 8159f31bbbb5..b0c632b69c03 100644 --- a/pkgs/development/libraries/hwloc/default.nix +++ b/pkgs/development/libraries/hwloc/default.nix @@ -3,7 +3,7 @@ , libX11 , cairo , config -, enableCuda ? config.cudaSupport or false +, enableCuda ? config.cudaSupport , cudaPackages }: diff --git a/pkgs/development/libraries/librealsense/default.nix b/pkgs/development/libraries/librealsense/default.nix index cfe7fb89bd56..aec9cfaaf91a 100644 --- a/pkgs/development/libraries/librealsense/default.nix +++ b/pkgs/development/libraries/librealsense/default.nix @@ -13,7 +13,7 @@ , glfw , libGLU , curl -, cudaSupport ? config.cudaSupport or false, cudaPackages ? {} +, cudaSupport ? config.cudaSupport, cudaPackages ? { } , enablePython ? false, pythonPackages ? null , enableGUI ? false, }: diff --git a/pkgs/development/libraries/lightgbm/default.nix b/pkgs/development/libraries/lightgbm/default.nix index 7ac716b326dd..25cb21a314ce 100644 --- a/pkgs/development/libraries/lightgbm/default.nix +++ b/pkgs/development/libraries/lightgbm/default.nix @@ -1,5 +1,5 @@ { config, stdenv, lib, fetchFromGitHub, cmake, gtest, doCheck ? true -, cudaSupport ? config.cudaSupport or false, openclSupport ? false, mpiSupport ? false, javaWrapper ? false, hdfsSupport ? false +, cudaSupport ? config.cudaSupport, openclSupport ? false, mpiSupport ? false, javaWrapper ? false, hdfsSupport ? false , rLibrary ? false, cudaPackages, opencl-headers, ocl-icd, boost, llvmPackages, openmpi, openjdk, swig, hadoop, R, rPackages }: assert doCheck -> mpiSupport != true; diff --git a/pkgs/development/libraries/mlt/default.nix b/pkgs/development/libraries/mlt/default.nix index 1cd14cbcb565..19b03a24a45a 100644 --- a/pkgs/development/libraries/mlt/default.nix +++ b/pkgs/development/libraries/mlt/default.nix @@ -21,7 +21,7 @@ , sox , vid-stab , darwin -, cudaSupport ? config.cudaSupport or false +, cudaSupport ? config.cudaSupport , cudaPackages ? { } , enableJackrack ? stdenv.isLinux , ladspa-sdk diff --git a/pkgs/development/libraries/nvidia-thrust/default.nix b/pkgs/development/libraries/nvidia-thrust/default.nix index 679b2c61c45a..f68b57f193b7 100644 --- a/pkgs/development/libraries/nvidia-thrust/default.nix +++ b/pkgs/development/libraries/nvidia-thrust/default.nix @@ -8,7 +8,7 @@ , symlinkJoin , tbb , hostSystem ? "CPP" -, deviceSystem ? if config.cudaSupport or false then "CUDA" else "OMP" +, deviceSystem ? if config.cudaSupport then "CUDA" else "OMP" }: # Policy for device_vector diff --git a/pkgs/development/libraries/opencv/3.x.nix b/pkgs/development/libraries/opencv/3.x.nix index 40614f489b51..0188e5e1ae96 100644 --- a/pkgs/development/libraries/opencv/3.x.nix +++ b/pkgs/development/libraries/opencv/3.x.nix @@ -14,7 +14,7 @@ , enableOpenblas ? true, openblas, blas, lapack , enableContrib ? true -, enableCuda ? (config.cudaSupport or false) && +, enableCuda ? config.cudaSupport && stdenv.hostPlatform.isx86_64 , cudaPackages ? { } , enableUnfree ? false diff --git a/pkgs/development/libraries/opencv/4.x.nix b/pkgs/development/libraries/opencv/4.x.nix index 3f120e2558f3..c82f0a0065b6 100644 --- a/pkgs/development/libraries/opencv/4.x.nix +++ b/pkgs/development/libraries/opencv/4.x.nix @@ -37,7 +37,7 @@ , blas , enableContrib ? true -, enableCuda ? (config.cudaSupport or false) && stdenv.hostPlatform.isx86_64 +, enableCuda ? config.cudaSupport && stdenv.hostPlatform.isx86_64 , enableCublas ? enableCuda , enableCudnn ? false # NOTE: CUDNN has a large impact on closure size so we disable it by default , enableCufft ? enableCuda diff --git a/pkgs/development/libraries/openmpi/default.nix b/pkgs/development/libraries/openmpi/default.nix index 1d2b0e759aa7..937669fc5855 100644 --- a/pkgs/development/libraries/openmpi/default.nix +++ b/pkgs/development/libraries/openmpi/default.nix @@ -3,7 +3,7 @@ , libpsm2, libfabric, pmix, ucx , config # Enable CUDA support -, cudaSupport ? config.cudaSupport or false, cudatoolkit +, cudaSupport ? config.cudaSupport, cudatoolkit # Enable the Sun Grid Engine bindings , enableSGE ? false diff --git a/pkgs/development/libraries/opensubdiv/default.nix b/pkgs/development/libraries/opensubdiv/default.nix index 9511f4f56f7e..4cd398e6394a 100644 --- a/pkgs/development/libraries/opensubdiv/default.nix +++ b/pkgs/development/libraries/opensubdiv/default.nix @@ -1,6 +1,6 @@ { config, lib, stdenv, fetchFromGitHub, cmake, pkg-config, xorg, libGLU , libGL, glew, ocl-icd, python3 -, cudaSupport ? config.cudaSupport or false, cudatoolkit +, cudaSupport ? config.cudaSupport, cudatoolkit # For visibility mostly. The whole approach to cuda architectures and capabilities # will be reworked soon. , cudaArch ? "compute_37" diff --git a/pkgs/development/libraries/science/chemistry/openmm/default.nix b/pkgs/development/libraries/science/chemistry/openmm/default.nix index 8b25554c4ab1..a7c388339de0 100644 --- a/pkgs/development/libraries/science/chemistry/openmm/default.nix +++ b/pkgs/development/libraries/science/chemistry/openmm/default.nix @@ -12,7 +12,7 @@ , opencl-headers , ocl-icd , config -, enableCuda ? config.cudaSupport or false +, enableCuda ? config.cudaSupport , cudaPackages , addOpenGLRunpath }: diff --git a/pkgs/development/libraries/science/math/faiss/default.nix b/pkgs/development/libraries/science/math/faiss/default.nix index d67f31375e7d..21e6cbf858cd 100644 --- a/pkgs/development/libraries/science/math/faiss/default.nix +++ b/pkgs/development/libraries/science/math/faiss/default.nix @@ -5,7 +5,7 @@ , stdenv , cmake , cudaPackages ? { } -, cudaSupport ? config.cudaSupport or false +, cudaSupport ? config.cudaSupport , nvidia-thrust , useThrustSourceBuild ? true , pythonSupport ? true diff --git a/pkgs/development/libraries/science/math/suitesparse/4.4.nix b/pkgs/development/libraries/science/math/suitesparse/4.4.nix index 0466027e03f3..cbc24b154656 100644 --- a/pkgs/development/libraries/science/math/suitesparse/4.4.nix +++ b/pkgs/development/libraries/science/math/suitesparse/4.4.nix @@ -1,6 +1,6 @@ { lib, stdenv, fetchurl, gfortran, blas, lapack , config -, enableCuda ? config.cudaSupport or false, cudatoolkit +, enableCuda ? config.cudaSupport, cudatoolkit }: let diff --git a/pkgs/development/libraries/science/math/suitesparse/default.nix b/pkgs/development/libraries/science/math/suitesparse/default.nix index 42413e66c714..67dfef186e7d 100644 --- a/pkgs/development/libraries/science/math/suitesparse/default.nix +++ b/pkgs/development/libraries/science/math/suitesparse/default.nix @@ -7,7 +7,7 @@ , gmp , mpfr , config -, enableCuda ? config.cudaSupport or false +, enableCuda ? config.cudaSupport , cudatoolkit }: diff --git a/pkgs/development/libraries/ucc/default.nix b/pkgs/development/libraries/ucc/default.nix index 1c1804e9004c..e26e6e603f8e 100644 --- a/pkgs/development/libraries/ucc/default.nix +++ b/pkgs/development/libraries/ucc/default.nix @@ -1,6 +1,6 @@ { stdenv, lib, fetchFromGitHub, libtool, automake, autoconf, ucx , config -, enableCuda ? config.cudaSupport or false +, enableCuda ? config.cudaSupport , cudatoolkit , enableAvx ? stdenv.hostPlatform.avxSupport , enableSse41 ? stdenv.hostPlatform.sse4_1Support diff --git a/pkgs/development/libraries/ucx/default.nix b/pkgs/development/libraries/ucx/default.nix index cc9cea442d31..4ded9c2860aa 100644 --- a/pkgs/development/libraries/ucx/default.nix +++ b/pkgs/development/libraries/ucx/default.nix @@ -1,7 +1,7 @@ { lib, stdenv, fetchFromGitHub, autoreconfHook, doxygen, numactl , rdma-core, libbfd, libiberty, perl, zlib, symlinkJoin, pkg-config , config -, enableCuda ? config.cudaSupport or false +, enableCuda ? config.cudaSupport , cudatoolkit , enableRocm ? false , rocm-core, rocm-runtime, rocm-device-libs, hip diff --git a/pkgs/development/libraries/xgboost/default.nix b/pkgs/development/libraries/xgboost/default.nix index 0a404f616b92..31d064c2af6d 100644 --- a/pkgs/development/libraries/xgboost/default.nix +++ b/pkgs/development/libraries/xgboost/default.nix @@ -5,7 +5,7 @@ , cmake , gtest , doCheck ? true -, cudaSupport ? config.cudaSupport or false +, cudaSupport ? config.cudaSupport , ncclSupport ? false , rLibrary ? false , cudaPackages diff --git a/pkgs/development/python-modules/chainer/default.nix b/pkgs/development/python-modules/chainer/default.nix index c6793137ba24..1f5be76e2d21 100644 --- a/pkgs/development/python-modules/chainer/default.nix +++ b/pkgs/development/python-modules/chainer/default.nix @@ -1,7 +1,7 @@ { lib , buildPythonPackage , config -, cudaSupport ? config.cudaSupport or false +, cudaSupport ? config.cudaSupport , cupy , fetchFromGitHub , filelock diff --git a/pkgs/development/python-modules/jaxlib/bin.nix b/pkgs/development/python-modules/jaxlib/bin.nix index c7e84e4c11a2..b3d3138ab443 100644 --- a/pkgs/development/python-modules/jaxlib/bin.nix +++ b/pkgs/development/python-modules/jaxlib/bin.nix @@ -27,7 +27,7 @@ , scipy , stdenv # Options: -, cudaSupport ? config.cudaSupport or false +, cudaSupport ? config.cudaSupport , cudaPackages ? {} }: diff --git a/pkgs/development/python-modules/jaxlib/default.nix b/pkgs/development/python-modules/jaxlib/default.nix index 1e5b7bb6f785..bf93bf1a5a26 100644 --- a/pkgs/development/python-modules/jaxlib/default.nix +++ b/pkgs/development/python-modules/jaxlib/default.nix @@ -42,7 +42,7 @@ , config # CUDA flags: -, cudaSupport ? config.cudaSupport or false +, cudaSupport ? config.cudaSupport , cudaPackages ? {} # MKL: diff --git a/pkgs/development/python-modules/libgpuarray/default.nix b/pkgs/development/python-modules/libgpuarray/default.nix index 6e5bb05913a2..699bbabdfc76 100644 --- a/pkgs/development/python-modules/libgpuarray/default.nix +++ b/pkgs/development/python-modules/libgpuarray/default.nix @@ -10,7 +10,7 @@ , nose , mako , config -, cudaSupport ? config.cudaSupport or false +, cudaSupport ? config.cudaSupport , cudaPackages ? { } , openclSupport ? true, ocl-icd, clblas }: diff --git a/pkgs/development/python-modules/numba/default.nix b/pkgs/development/python-modules/numba/default.nix index 9b34d4e55ed1..d503307ce67a 100644 --- a/pkgs/development/python-modules/numba/default.nix +++ b/pkgs/development/python-modules/numba/default.nix @@ -21,7 +21,7 @@ , cudaPackages ? {} # CUDA flags: -, cudaSupport ? config.cudaSupport or false +, cudaSupport ? config.cudaSupport }: let diff --git a/pkgs/development/python-modules/tensorflow/bin.nix b/pkgs/development/python-modules/tensorflow/bin.nix index c9047614b3cd..eb40824c8caa 100644 --- a/pkgs/development/python-modules/tensorflow/bin.nix +++ b/pkgs/development/python-modules/tensorflow/bin.nix @@ -22,7 +22,7 @@ , tensorflow-estimator-bin , tensorboard , config -, cudaSupport ? config.cudaSupport or false +, cudaSupport ? config.cudaSupport , cudaPackages ? {} , zlib , python diff --git a/pkgs/development/python-modules/tensorflow/default.nix b/pkgs/development/python-modules/tensorflow/default.nix index fabe1fe7cd2a..d95678f7fc6b 100644 --- a/pkgs/development/python-modules/tensorflow/default.nix +++ b/pkgs/development/python-modules/tensorflow/default.nix @@ -18,7 +18,7 @@ # it would also make the default tensorflow package unfree. See # https://groups.google.com/a/tensorflow.org/forum/#!topic/developers/iRCt5m4qUz0 , config -, cudaSupport ? config.cudaSupport or false +, cudaSupport ? config.cudaSupport , cudaPackages ? { } , cudaCapabilities ? cudaPackages.cudaFlags.cudaCapabilities , mklSupport ? false, mkl diff --git a/pkgs/development/python-modules/theano/default.nix b/pkgs/development/python-modules/theano/default.nix index 3a1af4a3517b..428bf4310d6b 100644 --- a/pkgs/development/python-modules/theano/default.nix +++ b/pkgs/development/python-modules/theano/default.nix @@ -12,7 +12,7 @@ , six , libgpuarray , config -, cudaSupport ? config.cudaSupport or false, cudaPackages ? {} +, cudaSupport ? config.cudaSupport, cudaPackages ? { } , cudnnSupport ? cudaSupport }: diff --git a/pkgs/development/python-modules/torch/default.nix b/pkgs/development/python-modules/torch/default.nix index 98116052649a..912628bf9497 100644 --- a/pkgs/development/python-modules/torch/default.nix +++ b/pkgs/development/python-modules/torch/default.nix @@ -1,5 +1,5 @@ { stdenv, lib, fetchFromGitHub, buildPythonPackage, python, - config, cudaSupport ? config.cudaSupport or false, cudaPackages, magma, + config, cudaSupport ? config.cudaSupport, cudaPackages, magma, useSystemNccl ? true, MPISupport ? false, mpi, buildDocs ? false, diff --git a/pkgs/games/katago/default.nix b/pkgs/games/katago/default.nix index 3d0b5a141c3c..0ca0deb518ff 100644 --- a/pkgs/games/katago/default.nix +++ b/pkgs/games/katago/default.nix @@ -15,7 +15,7 @@ , openssl , writeShellScriptBin , enableAVX2 ? stdenv.hostPlatform.avx2Support -, backend ? if (config.cudaSupport or false) then "cuda" else "opencl" +, backend ? if config.cudaSupport then "cuda" else "opencl" , enableBigBoards ? false , enableContrib ? false , enableTcmalloc ? true diff --git a/pkgs/servers/sunshine/default.nix b/pkgs/servers/sunshine/default.nix index e5a619de395f..bf3f4fa30058 100644 --- a/pkgs/servers/sunshine/default.nix +++ b/pkgs/servers/sunshine/default.nix @@ -31,7 +31,7 @@ , vulkan-loader , libappindicator , config -, cudaSupport ? config.cudaSupport or false +, cudaSupport ? config.cudaSupport , cudaPackages ? {} }: let diff --git a/pkgs/tools/compression/zfp/default.nix b/pkgs/tools/compression/zfp/default.nix index 487cd02eb59c..d63140b14760 100644 --- a/pkgs/tools/compression/zfp/default.nix +++ b/pkgs/tools/compression/zfp/default.nix @@ -1,7 +1,7 @@ { cmake, cudatoolkit, fetchFromGitHub, gfortran, lib, llvmPackages, python3Packages, stdenv , config , enableCfp ? true -, enableCuda ? config.cudaSupport or false +, enableCuda ? config.cudaSupport , enableFortran ? builtins.elem stdenv.targetPlatform.system gfortran.meta.platforms , enableOpenMP ? true , enablePython ? true diff --git a/pkgs/tools/graphics/waifu2x-converter-cpp/default.nix b/pkgs/tools/graphics/waifu2x-converter-cpp/default.nix index b0d9249197a8..56fe4e122e53 100644 --- a/pkgs/tools/graphics/waifu2x-converter-cpp/default.nix +++ b/pkgs/tools/graphics/waifu2x-converter-cpp/default.nix @@ -1,6 +1,6 @@ { cmake, fetchFromGitHub, makeWrapper, opencv3, lib, stdenv, ocl-icd, opencl-headers, OpenCL , config -, cudaSupport ? config.cudaSupport or false, cudatoolkit ? null +, cudaSupport ? config.cudaSupport, cudatoolkit ? null }: stdenv.mkDerivation rec { diff --git a/pkgs/tools/security/hashcat/default.nix b/pkgs/tools/security/hashcat/default.nix index dc7676ca764d..0fec2a9ec992 100644 --- a/pkgs/tools/security/hashcat/default.nix +++ b/pkgs/tools/security/hashcat/default.nix @@ -2,7 +2,7 @@ , addOpenGLRunpath , config , cudaPackages ? {} -, cudaSupport ? config.cudaSupport or false +, cudaSupport ? config.cudaSupport , fetchurl , makeWrapper , opencl-headers diff --git a/pkgs/tools/security/truecrack/default.nix b/pkgs/tools/security/truecrack/default.nix index aaf1b2580de6..c58ce4ae57b1 100644 --- a/pkgs/tools/security/truecrack/default.nix +++ b/pkgs/tools/security/truecrack/default.nix @@ -1,6 +1,6 @@ { lib, gccStdenv, fetchFromGitLab, cudatoolkit , config -, cudaSupport ? config.cudaSupport or false +, cudaSupport ? config.cudaSupport , pkg-config }: gccStdenv.mkDerivation rec { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 03fcb205dbff..ae86dc0a28b5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4162,7 +4162,7 @@ with pkgs; libtensorflow = python3.pkgs.tensorflow.libtensorflow; libtorch-bin = callPackage ../development/libraries/science/math/libtorch/bin.nix { - cudaSupport = config.cudaSupport or false; + inherit (config) cudaSupport; }; tensorflow-lite = callPackage ../development/libraries/science/math/tensorflow-lite { }; @@ -10825,7 +10825,7 @@ with pkgs; nvidia-thrust-intel = callPackage ../development/libraries/nvidia-thrust { hostSystem = "TBB"; - deviceSystem = if config.cudaSupport or false then "CUDA" else "TBB"; + deviceSystem = if config.cudaSupport then "CUDA" else "TBB"; }; nvidia-thrust-cuda = callPackage ../development/libraries/nvidia-thrust { @@ -15070,7 +15070,7 @@ with pkgs; colm = callPackage ../development/compilers/colm { }; - colmap = libsForQt5.callPackage ../applications/science/misc/colmap { cudaSupport = config.cudaSupport or false; }; + colmap = libsForQt5.callPackage ../applications/science/misc/colmap { inherit (config) cudaSupport; }; colmapWithCuda = colmap.override { cudaSupport = true; }; chickenPackages_4 = callPackage ../development/compilers/chicken/4 { }; @@ -39195,7 +39195,7 @@ with pkgs; ### SCIENCE / MATH caffe = callPackage ../applications/science/math/caffe ({ - cudaSupport = config.cudaSupport or false; + inherit (config) cudaSupport; cudaPackages = cudaPackages_10_1; opencv3 = opencv3WithoutCuda; # Used only for image loading. blas = openblas; @@ -39210,7 +39210,7 @@ with pkgs; stdenv = gcc7Stdenv; inherit (linuxPackages) nvidia_x11; opencv3 = opencv3WithoutCuda; # Used only for image loading. - cudaSupport = config.cudaSupport or false; + inherit (config) cudaSupport; }; dap = callPackage ../applications/science/math/dap { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 52c5deef152c..4af19c093655 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1816,7 +1816,7 @@ self: super: with self; { chai = callPackage ../development/python-modules/chai { }; chainer = callPackage ../development/python-modules/chainer { - cudaSupport = pkgs.config.cudaSupport or false; + inherit (pkgs.config) cudaSupport; }; chainmap = callPackage ../development/python-modules/chainmap { }; @@ -5256,13 +5256,13 @@ self: super: with self; { jax-jumpy = callPackage ../development/python-modules/jax-jumpy { }; jaxlib-bin = callPackage ../development/python-modules/jaxlib/bin.nix { - cudaSupport = pkgs.config.cudaSupport or false; + inherit (pkgs.config) cudaSupport; }; jaxlib-build = callPackage ../development/python-modules/jaxlib rec { inherit (pkgs.darwin) cctools; # Some platforms don't have `cudaSupport` defined, hence the need for 'or false'. - cudaSupport = pkgs.config.cudaSupport or false; + inherit (pkgs.config) cudaSupport; IOKit = pkgs.darwin.apple_sdk_11_0.IOKit; protobuf = pkgs.protobuf3_20; # jaxlib-build 0.3.15 won't build with protobuf 3.21 }; @@ -5803,7 +5803,7 @@ self: super: with self; { libgpuarray = callPackage ../development/python-modules/libgpuarray { clblas = pkgs.clblas.override { inherit (self) boost; }; - cudaSupport = pkgs.config.cudaSupport or false; + inherit (pkgs.config) cudaSupport; }; libiio = (toPythonModule (pkgs.libiio.override { inherit python; })).python; @@ -7105,7 +7105,7 @@ self: super: with self; { num2words = callPackage ../development/python-modules/num2words { }; numba = callPackage ../development/python-modules/numba { - cudaSupport = pkgs.config.cudaSupport or false; + inherit (pkgs.config) cudaSupport; }; numbaWithCuda = self.numba.override { @@ -7273,7 +7273,7 @@ self: super: with self; { openai-triton-bin = callPackage ../development/python-modules/openai-triton/bin.nix { }; openai-whisper = callPackage ../development/python-modules/openai-whisper { - cudaSupport = pkgs.config.cudaSupport or false; + inherit (pkgs.config) cudaSupport; }; openant = callPackage ../development/python-modules/openant { }; @@ -12304,12 +12304,12 @@ self: super: with self; { tensorboardx = callPackage ../development/python-modules/tensorboardx { }; tensorflow-bin = callPackage ../development/python-modules/tensorflow/bin.nix { - cudaSupport = pkgs.config.cudaSupport or false; + inherit (pkgs.config) cudaSupport; }; tensorflow-build = callPackage ../development/python-modules/tensorflow { inherit (pkgs.darwin) cctools; - cudaSupport = pkgs.config.cudaSupport or false; + inherit (pkgs.config) cudaSupport; inherit (self.tensorflow-bin) cudaPackages; inherit (pkgs.darwin.apple_sdk.frameworks) Foundation Security; flatbuffers-core = pkgs.flatbuffers; @@ -12428,7 +12428,7 @@ self: super: with self; { theano-pymc = callPackage ../development/python-modules/theano-pymc { }; theano = callPackage ../development/python-modules/theano rec { - cudaSupport = pkgs.config.cudaSupport or false; + inherit (pkgs.config) cudaSupport; cudnnSupport = cudaSupport; }; @@ -12595,9 +12595,9 @@ self: super: with self; { toposort = callPackage ../development/python-modules/toposort { }; torch = callPackage ../development/python-modules/torch { - cudaSupport = pkgs.config.cudaSupport or false; + inherit (pkgs.config) cudaSupport; magma = - if pkgs.config.cudaSupport or false + if pkgs.config.cudaSupport then pkgs.magma-cuda-static else pkgs.magma; inherit (pkgs.darwin.apple_sdk.frameworks) Accelerate CoreServices; From c04c43ccd1f7b789ffc3363d9c46fb98e79afd41 Mon Sep 17 00:00:00 2001 From: zimbatm Date: Sat, 22 Jul 2023 13:36:29 +0200 Subject: [PATCH 11/34] writers: fix fsharp writer dotnet needs a writable $HOME to operate --- pkgs/build-support/writers/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/build-support/writers/default.nix b/pkgs/build-support/writers/default.nix index 3016a45b8a0f..faac553dee3f 100644 --- a/pkgs/build-support/writers/default.nix +++ b/pkgs/build-support/writers/default.nix @@ -340,6 +340,7 @@ let }; fsi = writeBash "fsi" '' + export HOME=$NIX_BUILD_TOP/.home export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 export DOTNET_CLI_TELEMETRY_OPTOUT=1 export DOTNET_NOLOGO=1 From 73ee03cbc5a20c6c3d61946558e7aea4a48c5119 Mon Sep 17 00:00:00 2001 From: zimbatm Date: Sat, 22 Jul 2023 13:38:31 +0200 Subject: [PATCH 12/34] writers: split out the tests Make it easier to run and debug individual tests. --- pkgs/build-support/writers/test.nix | 166 +++++++++++++------------- pkgs/test/haskell/default.nix | 1 - pkgs/test/haskell/writers/default.nix | 26 ---- 3 files changed, 81 insertions(+), 112 deletions(-) delete mode 100644 pkgs/test/haskell/writers/default.nix diff --git a/pkgs/build-support/writers/test.nix b/pkgs/build-support/writers/test.nix index 561c3e4ab002..9484f8bbe31b 100644 --- a/pkgs/build-support/writers/test.nix +++ b/pkgs/build-support/writers/test.nix @@ -12,29 +12,49 @@ }: with writers; let + expectSuccess = test: + runCommand "run-${test.name}" {} '' + if test "$(${test})" != "success"; then + echo 'test ${test.name} failed' + exit 1 + fi - bin = { - bash = writeBashBin "test-writers-bash-bin" '' + touch $out + ''; + + expectSuccessBin = test: + runCommand "run-${test.name}" {} '' + if test "$(${lib.getExe test})" != "success"; then + echo 'test ${test.name} failed' + exit 1 + fi + + touch $out + ''; +in +lib.recurseIntoAttrs { + bin = lib.recurseIntoAttrs { + bash = expectSuccessBin (writeBashBin "test-writers-bash-bin" '' if [[ "test" == "test" ]]; then echo "success"; fi - ''; + ''); - dash = writeDashBin "test-writers-dash-bin" '' + dash = expectSuccessBin (writeDashBin "test-writers-dash-bin" '' test '~' = '~' && echo 'success' - ''; + ''); - fish = writeFishBin "test-writers-fish-bin" '' + fish = expectSuccessBin (writeFishBin "test-writers-fish-bin" '' if test "test" = "test" echo "success" end - ''; + ''); - rust = writeRustBin "test-writers-rust-bin" {} '' + rust = expectSuccessBin (writeRustBin "test-writers-rust-bin" {} '' fn main(){ println!("success") } - ''; + ''); - haskell = writeHaskellBin "test-writers-haskell-bin" { libraries = [ haskellPackages.acme-default ]; } '' + haskell = expectSuccessBin (writeHaskellBin "test-writers-haskell-bin" { libraries = [ haskellPackages.acme-default ]; } '' import Data.Default int :: Int @@ -44,9 +64,9 @@ let main = case int of 18871 -> putStrLn $ id "success" _ -> print "fail" - ''; + ''); - js = writeJSBin "test-writers-js-bin" { libraries = [ nodePackages.semver ]; } '' + js = expectSuccessBin (writeJSBin "test-writers-js-bin" { libraries = [ nodePackages.semver ]; } '' var semver = require('semver'); if (semver.valid('1.2.3')) { @@ -54,59 +74,57 @@ let } else { console.log('fail') } - ''; + ''); - perl = writePerlBin "test-writers-perl-bin" { libraries = [ perlPackages.boolean ]; } '' + perl = expectSuccessBin (writePerlBin "test-writers-perl-bin" { libraries = [ perlPackages.boolean ]; } '' use boolean; print "success\n" if true; - ''; + ''); - pypy2 = writePyPy2Bin "test-writers-pypy2-bin" { libraries = [ pypy2Packages.enum ]; } '' + pypy2 = expectSuccessBin (writePyPy2Bin "test-writers-pypy2-bin" { libraries = [ pypy2Packages.enum ]; } '' from enum import Enum - class Test(Enum): a = "success" - print Test.a - ''; + ''); - python3 = writePython3Bin "test-writers-python3-bin" { libraries = [ python3Packages.pyyaml ]; } '' + python3 = expectSuccessBin (writePython3Bin "test-writers-python3-bin" { libraries = [ python3Packages.pyyaml ]; } '' import yaml - y = yaml.load(""" + y = yaml.safe_load(""" - test: success """) print(y[0]['test']) - ''; + ''); - pypy3 = writePyPy3Bin "test-writers-pypy3-bin" { libraries = [ pypy3Packages.pyyaml ]; } '' + pypy3 = expectSuccessBin (writePyPy3Bin "test-writers-pypy3-bin" { libraries = [ pypy3Packages.pyyaml ]; } '' import yaml - y = yaml.load(""" + y = yaml.safe_load(""" - test: success """) print(y[0]['test']) - ''; + ''); }; - simple = { - bash = writeBash "test-writers-bash" '' + simple = lib.recurseIntoAttrs { + bash = expectSuccess (writeBash "test-writers-bash" '' if [[ "test" == "test" ]]; then echo "success"; fi - ''; + ''); - dash = writeDash "test-writers-dash" '' + dash = expectSuccess (writeDash "test-writers-dash" '' test '~' = '~' && echo 'success' - ''; + ''); - fish = writeFish "test-writers-fish" '' + fish = expectSuccess (writeFish "test-writers-fish" '' if test "test" = "test" echo "success" end - ''; + ''); - haskell = writeHaskell "test-writers-haskell" { libraries = [ haskellPackages.acme-default ]; } '' + haskell = expectSuccess (writeHaskell "test-writers-haskell" { libraries = [ haskellPackages.acme-default ]; } '' import Data.Default int :: Int @@ -116,9 +134,9 @@ let main = case int of 18871 -> putStrLn $ id "success" _ -> print "fail" - ''; + ''); - js = writeJS "test-writers-js" { libraries = [ nodePackages.semver ]; } '' + js = expectSuccess (writeJS "test-writers-js" { libraries = [ nodePackages.semver ]; } '' var semver = require('semver'); if (semver.valid('1.2.3')) { @@ -126,43 +144,41 @@ let } else { console.log('fail') } - ''; + ''); - perl = writePerl "test-writers-perl" { libraries = [ perlPackages.boolean ]; } '' + perl = expectSuccess (writePerl "test-writers-perl" { libraries = [ perlPackages.boolean ]; } '' use boolean; print "success\n" if true; - ''; + ''); - pypy2 = writePyPy2 "test-writers-pypy2" { libraries = [ pypy2Packages.enum ]; } '' + pypy2 = expectSuccess (writePyPy2 "test-writers-pypy2" { libraries = [ pypy2Packages.enum ]; } '' from enum import Enum - class Test(Enum): a = "success" - print Test.a - ''; + ''); - python3 = writePython3 "test-writers-python3" { libraries = [ python3Packages.pyyaml ]; } '' + python3 = expectSuccess (writePython3 "test-writers-python3" { libraries = [ python3Packages.pyyaml ]; } '' import yaml - y = yaml.load(""" + y = yaml.safe_load(""" - test: success """) print(y[0]['test']) - ''; + ''); - pypy3 = writePyPy3 "test-writers-pypy3" { libraries = [ pypy3Packages.pyyaml ]; } '' + pypy3 = expectSuccess (writePyPy3 "test-writers-pypy3" { libraries = [ pypy3Packages.pyyaml ]; } '' import yaml - y = yaml.load(""" + y = yaml.safe_load(""" - test: success """) print(y[0]['test']) - ''; + ''); - fsharp = makeFSharpWriter { + fsharp = expectSuccess (makeFSharpWriter { libraries = { fetchNuGet }: [ (fetchNuGet { pname = "FSharp.SystemTextJson"; version = "0.17.4"; sha256 = "1bplzc9ybdqspii4q28l8gmfvzpkmgq5l1hlsiyg2h46w881lwg2"; }) ]; @@ -183,31 +199,31 @@ let then "success" else "failed" |> printfn "%s" - ''; + ''); - pypy2NoLibs = writePyPy2 "test-writers-pypy2-no-libs" {} '' + pypy2NoLibs = expectSuccess (writePyPy2 "test-writers-pypy2-no-libs" {} '' print("success") - ''; + ''); - python3NoLibs = writePython3 "test-writers-python3-no-libs" {} '' + python3NoLibs = expectSuccess (writePython3 "test-writers-python3-no-libs" {} '' print("success") - ''; + ''); - pypy3NoLibs = writePyPy3 "test-writers-pypy3-no-libs" {} '' + pypy3NoLibs = expectSuccess (writePyPy3 "test-writers-pypy3-no-libs" {} '' print("success") - ''; + ''); - fsharpNoNugetDeps = writeFSharp "test-writers-fsharp-no-nuget-deps" '' + fsharpNoNugetDeps = expectSuccess (writeFSharp "test-writers-fsharp-no-nuget-deps" '' printfn "success" - ''; + ''); }; - - path = { - bash = writeBash "test-writers-bash-path" (writeText "test" '' + path = lib.recurseIntoAttrs { + bash = expectSuccess (writeBash "test-writers-bash-path" (writeText "test" '' if [[ "test" == "test" ]]; then echo "success"; fi - ''); - haskell = writeHaskell "test-writers-haskell-path" { libraries = [ haskellPackages.acme-default ]; } (writeText "test" '' + '')); + + haskell = expectSuccess (writeHaskell "test-writers-haskell-path" { libraries = [ haskellPackages.acme-default ]; } (writeText "test" '' import Data.Default int :: Int @@ -217,26 +233,6 @@ let main = case int of 18871 -> putStrLn $ id "success" _ -> print "fail" - ''); + '')); }; - - writeTest = expectedValue: name: test: - writeDash "run-${name}" '' - if test "$(${test})" != "${expectedValue}"; then - echo 'test ${test} failed' - exit 1 - fi - ''; - -in runCommand "test-writers" { - passthru = { inherit writeTest bin simple path; }; - meta.platforms = lib.platforms.all; -} '' - ${lib.concatMapStringsSep "\n" (test: writeTest "success" test.name "${test}/bin/${test.name}") (lib.attrValues bin)} - ${lib.concatMapStringsSep "\n" (test: writeTest "success" test.name test) (lib.attrValues simple)} - ${lib.concatMapStringsSep "\n" (test: writeTest "success" test.name test) (lib.attrValues path)} - - echo 'nix-writers successfully tested' >&2 - touch $out -'' - +} diff --git a/pkgs/test/haskell/default.nix b/pkgs/test/haskell/default.nix index 86764380ecc3..2ecbd4caf81b 100644 --- a/pkgs/test/haskell/default.nix +++ b/pkgs/test/haskell/default.nix @@ -5,6 +5,5 @@ lib.recurseIntoAttrs { cabalSdist = callPackage ./cabalSdist { }; documentationTarball = callPackage ./documentationTarball { }; setBuildTarget = callPackage ./setBuildTarget { }; - writers = callPackage ./writers { }; incremental = callPackage ./incremental { }; } diff --git a/pkgs/test/haskell/writers/default.nix b/pkgs/test/haskell/writers/default.nix deleted file mode 100644 index f05fda4bc736..000000000000 --- a/pkgs/test/haskell/writers/default.nix +++ /dev/null @@ -1,26 +0,0 @@ -# Wrap only the haskell-related tests from tests.writers -# in their own derivation for Hydra CI in the haskell-updates -# jobset. Can presumably removed as soon as tests.writers is -# always green on darwin as well: -# https://github.com/NixOS/nixpkgs/issues/126182 -{ runCommand, tests }: - -let - inherit (tests.writers) - writeTest - bin - simple - path - ; -in - -runCommand "test-haskell-writers" { - meta = { - inherit (tests.writers.meta) platforms; - }; -} '' - ${writeTest "success" "test-haskell-bin-writer" "${bin.haskell}/bin/${bin.haskell.name}"} - ${writeTest "success" "test-haskell-simple-writer" simple.haskell} - ${writeTest "success" "test-haskell-path-writer" path.haskell} - touch $out -'' From d0c7ffc596bd8da9298d693d1bdd0559c6777311 Mon Sep 17 00:00:00 2001 From: zimbatm Date: Sat, 22 Jul 2023 13:48:25 +0200 Subject: [PATCH 13/34] writers: make room for other types of writers --- pkgs/build-support/writers/default.nix | 364 +---------------------- pkgs/build-support/writers/scripts.nix | 383 +++++++++++++++++++++++++ 2 files changed, 386 insertions(+), 361 deletions(-) create mode 100644 pkgs/build-support/writers/scripts.nix diff --git a/pkgs/build-support/writers/default.nix b/pkgs/build-support/writers/default.nix index faac553dee3f..c26ada8bc571 100644 --- a/pkgs/build-support/writers/default.nix +++ b/pkgs/build-support/writers/default.nix @@ -1,368 +1,10 @@ -{ pkgs, config, buildPackages, lib, stdenv, libiconv, mkNugetDeps, mkNugetSource, gixy }: +{ pkgs, config, lib }: let aliases = if config.allowAliases then (import ./aliases.nix lib) else prev: {}; - writers = with lib; rec { - # Base implementation for non-compiled executables. - # Takes an interpreter, for example `${pkgs.bash}/bin/bash` - # - # Examples: - # writeBash = makeScriptWriter { interpreter = "${pkgs.bash}/bin/bash"; } - # makeScriptWriter { interpreter = "${pkgs.dash}/bin/dash"; } "hello" "echo hello world" - makeScriptWriter = { interpreter, check ? "" }: nameOrPath: content: - assert lib.or (types.path.check nameOrPath) (builtins.match "([0-9A-Za-z._])[0-9A-Za-z._-]*" nameOrPath != null); - assert lib.or (types.path.check content) (types.str.check content); - let - name = last (builtins.split "/" nameOrPath); - in + scriptWriters = import ./scripts.nix { inherit pkgs lib; }; - pkgs.runCommandLocal name (if (types.str.check content) then { - inherit content interpreter; - passAsFile = [ "content" ]; - } else { - inherit interpreter; - contentPath = content; - }) '' - # On darwin a script cannot be used as an interpreter in a shebang but - # there doesn't seem to be a limit to the size of shebang and multiple - # arguments to the interpreter are allowed. - if [[ -n "${toString pkgs.stdenvNoCC.isDarwin}" ]] && isScript $interpreter - then - wrapperInterpreterLine=$(head -1 "$interpreter" | tail -c+3) - # Get first word from the line (note: xargs echo remove leading spaces) - wrapperInterpreter=$(echo "$wrapperInterpreterLine" | xargs echo | cut -d " " -f1) - - if isScript $wrapperInterpreter - then - echo "error: passed interpreter ($interpreter) is a script which has another script ($wrapperInterpreter) as an interpreter, which is not supported." - exit 1 - fi - - # This should work as long as wrapperInterpreter is a shell, which is - # the case for programs wrapped with makeWrapper, like - # python3.withPackages etc. - interpreterLine="$wrapperInterpreterLine $interpreter" - else - interpreterLine=$interpreter - fi - - echo "#! $interpreterLine" > $out - cat "$contentPath" >> $out - ${optionalString (check != "") '' - ${check} $out - ''} - chmod +x $out - ${optionalString (types.path.check nameOrPath) '' - mv $out tmp - mkdir -p $out/$(dirname "${nameOrPath}") - mv tmp $out/${nameOrPath} - ''} - ''; - - # Base implementation for compiled executables. - # Takes a compile script, which in turn takes the name as an argument. - # - # Examples: - # writeSimpleC = makeBinWriter { compileScript = name: "gcc -o $out $contentPath"; } - makeBinWriter = { compileScript, strip ? true }: nameOrPath: content: - assert lib.or (types.path.check nameOrPath) (builtins.match "([0-9A-Za-z._])[0-9A-Za-z._-]*" nameOrPath != null); - assert lib.or (types.path.check content) (types.str.check content); - let - name = last (builtins.split "/" nameOrPath); - in - pkgs.runCommand name ((if (types.str.check content) then { - inherit content; - passAsFile = [ "content" ]; - } else { - contentPath = content; - }) // lib.optionalAttrs (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) { - # post-link-hook expects codesign_allocate to be in PATH - # https://github.com/NixOS/nixpkgs/issues/154203 - # https://github.com/NixOS/nixpkgs/issues/148189 - nativeBuildInputs = [ stdenv.cc.bintools ]; - }) '' - ${compileScript} - ${lib.optionalString strip - "${lib.getBin buildPackages.bintools-unwrapped}/bin/${buildPackages.bintools-unwrapped.targetPrefix}strip -S $out"} - # Sometimes binaries produced for darwin (e. g. by GHC) won't be valid - # mach-o executables from the get-go, but need to be corrected somehow - # which is done by fixupPhase. - ${lib.optionalString pkgs.stdenvNoCC.hostPlatform.isDarwin "fixupPhase"} - ${optionalString (types.path.check nameOrPath) '' - mv $out tmp - mkdir -p $out/$(dirname "${nameOrPath}") - mv tmp $out/${nameOrPath} - ''} - ''; - - # Like writeScript but the first line is a shebang to bash - # - # Example: - # writeBash "example" '' - # echo hello world - # '' - writeBash = makeScriptWriter { - interpreter = "${pkgs.bash}/bin/bash"; - }; - - # Like writeScriptBin but the first line is a shebang to bash - writeBashBin = name: - writeBash "/bin/${name}"; - - # Like writeScript but the first line is a shebang to dash - # - # Example: - # writeDash "example" '' - # echo hello world - # '' - writeDash = makeScriptWriter { - interpreter = "${pkgs.dash}/bin/dash"; - }; - - # Like writeScriptBin but the first line is a shebang to dash - writeDashBin = name: - writeDash "/bin/${name}"; - - # Like writeScript but the first line is a shebang to fish - # - # Example: - # writeFish "example" '' - # echo hello world - # '' - writeFish = makeScriptWriter { - interpreter = "${pkgs.fish}/bin/fish --no-config"; - check = "${pkgs.fish}/bin/fish --no-config --no-execute"; # syntax check only - }; - - # Like writeScriptBin but the first line is a shebang to fish - writeFishBin = name: - writeFish "/bin/${name}"; - - # writeHaskell takes a name, an attrset with libraries and haskell version (both optional) - # and some haskell source code and returns an executable. - # - # Example: - # writeHaskell "missiles" { libraries = [ pkgs.haskellPackages.acme-missiles ]; } '' - # import Acme.Missiles - # - # main = launchMissiles - # ''; - writeHaskell = name: { - libraries ? [], - ghc ? pkgs.ghc, - ghcArgs ? [], - threadedRuntime ? true, - strip ? true - }: - let - appendIfNotSet = el: list: if elem el list then list else list ++ [ el ]; - ghcArgs' = if threadedRuntime then appendIfNotSet "-threaded" ghcArgs else ghcArgs; - - in makeBinWriter { - compileScript = '' - cp $contentPath tmp.hs - ${ghc.withPackages (_: libraries )}/bin/ghc ${lib.escapeShellArgs ghcArgs'} tmp.hs - mv tmp $out - ''; - inherit strip; - } name; - - # writeHaskellBin takes the same arguments as writeHaskell but outputs a directory (like writeScriptBin) - writeHaskellBin = name: - writeHaskell "/bin/${name}"; - - writeRust = name: { - rustc ? pkgs.rustc, - rustcArgs ? [], - strip ? true - }: - let - darwinArgs = lib.optionals stdenv.isDarwin [ "-L${lib.getLib libiconv}/lib" ]; - in - makeBinWriter { - compileScript = '' - cp "$contentPath" tmp.rs - PATH=${makeBinPath [pkgs.gcc]} ${lib.getBin rustc}/bin/rustc ${lib.escapeShellArgs rustcArgs} ${lib.escapeShellArgs darwinArgs} -o "$out" tmp.rs - ''; - inherit strip; - } name; - - writeRustBin = name: - writeRust "/bin/${name}"; - - # writeJS takes a name an attributeset with libraries and some JavaScript sourcecode and - # returns an executable - # - # Example: - # writeJS "example" { libraries = [ pkgs.nodePackages.uglify-js ]; } '' - # var UglifyJS = require("uglify-js"); - # var code = "function add(first, second) { return first + second; }"; - # var result = UglifyJS.minify(code); - # console.log(result.code); - # '' - writeJS = name: { libraries ? [] }: content: - let - node-env = pkgs.buildEnv { - name = "node"; - paths = libraries; - pathsToLink = [ - "/lib/node_modules" - ]; - }; - in writeDash name '' - export NODE_PATH=${node-env}/lib/node_modules - exec ${pkgs.nodejs}/bin/node ${pkgs.writeText "js" content} "$@" - ''; - - # writeJSBin takes the same arguments as writeJS but outputs a directory (like writeScriptBin) - writeJSBin = name: - writeJS "/bin/${name}"; - - awkFormatNginx = builtins.toFile "awkFormat-nginx.awk" '' - awk -f - {sub(/^[ \t]+/,"");idx=0} - /\{/{ctx++;idx=1} - /\}/{ctx--} - {id="";for(i=idx;i $out - gixy $out - ''; - - # writePerl takes a name an attributeset with libraries and some perl sourcecode and - # returns an executable - # - # Example: - # writePerl "example" { libraries = [ pkgs.perlPackages.boolean ]; } '' - # use boolean; - # print "Howdy!\n" if true; - # '' - writePerl = name: { libraries ? [] }: - makeScriptWriter { - interpreter = "${pkgs.perl.withPackages (p: libraries)}/bin/perl"; - } name; - - # writePerlBin takes the same arguments as writePerl but outputs a directory (like writeScriptBin) - writePerlBin = name: - writePerl "/bin/${name}"; - - # makePythonWriter takes python and compatible pythonPackages and produces python script writer, - # which validates the script with flake8 at build time. If any libraries are specified, - # python.withPackages is used as interpreter, otherwise the "bare" python is used. - makePythonWriter = python: pythonPackages: buildPythonPackages: name: { libraries ? [], flakeIgnore ? [] }: - let - ignoreAttribute = optionalString (flakeIgnore != []) "--ignore ${concatMapStringsSep "," escapeShellArg flakeIgnore}"; - in - makeScriptWriter { - interpreter = - if libraries == [] - then python.interpreter - else (python.withPackages (ps: libraries)).interpreter - ; - check = optionalString python.isPy3k (writeDash "pythoncheck.sh" '' - exec ${buildPythonPackages.flake8}/bin/flake8 --show-source ${ignoreAttribute} "$1" - ''); - } name; - - # writePyPy2 takes a name an attributeset with libraries and some pypy2 sourcecode and - # returns an executable - # - # Example: - # writePyPy2 "test_pypy2" { libraries = [ pkgs.pypy2Packages.enum ]; } '' - # from enum import Enum - # - # class Test(Enum): - # a = "success" - # - # print Test.a - # '' - writePyPy2 = makePythonWriter pkgs.pypy2 pkgs.pypy2Packages buildPackages.pypy2Packages; - - # writePyPy2Bin takes the same arguments as writePyPy2 but outputs a directory (like writeScriptBin) - writePyPy2Bin = name: - writePyPy2 "/bin/${name}"; - - # writePython3 takes a name an attributeset with libraries and some python3 sourcecode and - # returns an executable - # - # Example: - # writePython3 "test_python3" { libraries = [ pkgs.python3Packages.pyyaml ]; } '' - # import yaml - # - # y = yaml.load(""" - # - test: success - # """) - # print(y[0]['test']) - # '' - writePython3 = makePythonWriter pkgs.python3 pkgs.python3Packages buildPackages.python3Packages; - - # writePython3Bin takes the same arguments as writePython3 but outputs a directory (like writeScriptBin) - writePython3Bin = name: - writePython3 "/bin/${name}"; - - # writePyPy3 takes a name an attributeset with libraries and some pypy3 sourcecode and - # returns an executable - # - # Example: - # writePyPy3 "test_pypy3" { libraries = [ pkgs.pypy3Packages.pyyaml ]; } '' - # import yaml - # - # y = yaml.load(""" - # - test: success - # """) - # print(y[0]['test']) - # '' - writePyPy3 = makePythonWriter pkgs.pypy3 pkgs.pypy3Packages buildPackages.pypy3Packages; - - # writePyPy3Bin takes the same arguments as writePyPy3 but outputs a directory (like writeScriptBin) - writePyPy3Bin = name: - writePyPy3 "/bin/${name}"; - - - makeFSharpWriter = { dotnet-sdk ? pkgs.dotnet-sdk, fsi-flags ? "", libraries ? _: [] }: nameOrPath: - let - fname = last (builtins.split "/" nameOrPath); - path = if strings.hasSuffix ".fsx" nameOrPath then nameOrPath else "${nameOrPath}.fsx"; - _nugetDeps = mkNugetDeps { name = "${fname}-nuget-deps"; nugetDeps = libraries; }; - - nuget-source = mkNugetSource { - name = "${fname}-nuget-source"; - description = "A Nuget source with the dependencies for ${fname}"; - deps = [ _nugetDeps ]; - }; - - fsi = writeBash "fsi" '' - export HOME=$NIX_BUILD_TOP/.home - export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 - export DOTNET_CLI_TELEMETRY_OPTOUT=1 - export DOTNET_NOLOGO=1 - script="$1"; shift - ${dotnet-sdk}/bin/dotnet fsi --quiet --nologo --readline- ${fsi-flags} "$@" < "$script" - ''; - - in content: writers.makeScriptWriter { - interpreter = fsi; - } path - '' - #i "nuget: ${nuget-source}/lib" - ${ content } - exit 0 - ''; - - writeFSharp = - makeFSharpWriter {}; - - writeFSharpBin = name: - writeFSharp "/bin/${name}"; - -}; + writers = scriptWriters; in writers // (aliases writers) diff --git a/pkgs/build-support/writers/scripts.nix b/pkgs/build-support/writers/scripts.nix new file mode 100644 index 000000000000..b8c5964c3fa3 --- /dev/null +++ b/pkgs/build-support/writers/scripts.nix @@ -0,0 +1,383 @@ +{ pkgs, lib }: +let + inherit (lib) + concatMapStringsSep + elem + escapeShellArg + last + optionalString + stringLength + strings + types + ; + + inherit (pkgs) + buildPackages + gixy + libiconv + mkNugetDeps + mkNugetSource + stdenv + ; +in +rec { + # Base implementation for non-compiled executables. + # Takes an interpreter, for example `${pkgs.bash}/bin/bash` + # + # Examples: + # writeBash = makeScriptWriter { interpreter = "${pkgs.bash}/bin/bash"; } + # makeScriptWriter { interpreter = "${pkgs.dash}/bin/dash"; } "hello" "echo hello world" + makeScriptWriter = { interpreter, check ? "" }: nameOrPath: content: + assert lib.or (types.path.check nameOrPath) (builtins.match "([0-9A-Za-z._])[0-9A-Za-z._-]*" nameOrPath != null); + assert lib.or (types.path.check content) (types.str.check content); + let + name = last (builtins.split "/" nameOrPath); + in + + pkgs.runCommandLocal name (if (types.str.check content) then { + inherit content interpreter; + passAsFile = [ "content" ]; + } else { + inherit interpreter; + contentPath = content; + }) '' + # On darwin a script cannot be used as an interpreter in a shebang but + # there doesn't seem to be a limit to the size of shebang and multiple + # arguments to the interpreter are allowed. + if [[ -n "${toString pkgs.stdenvNoCC.isDarwin}" ]] && isScript $interpreter + then + wrapperInterpreterLine=$(head -1 "$interpreter" | tail -c+3) + # Get first word from the line (note: xargs echo remove leading spaces) + wrapperInterpreter=$(echo "$wrapperInterpreterLine" | xargs echo | cut -d " " -f1) + + if isScript $wrapperInterpreter + then + echo "error: passed interpreter ($interpreter) is a script which has another script ($wrapperInterpreter) as an interpreter, which is not supported." + exit 1 + fi + + # This should work as long as wrapperInterpreter is a shell, which is + # the case for programs wrapped with makeWrapper, like + # python3.withPackages etc. + interpreterLine="$wrapperInterpreterLine $interpreter" + else + interpreterLine=$interpreter + fi + + echo "#! $interpreterLine" > $out + cat "$contentPath" >> $out + ${optionalString (check != "") '' + ${check} $out + ''} + chmod +x $out + ${optionalString (types.path.check nameOrPath) '' + mv $out tmp + mkdir -p $out/$(dirname "${nameOrPath}") + mv tmp $out/${nameOrPath} + ''} + ''; + + # Base implementation for compiled executables. + # Takes a compile script, which in turn takes the name as an argument. + # + # Examples: + # writeSimpleC = makeBinWriter { compileScript = name: "gcc -o $out $contentPath"; } + makeBinWriter = { compileScript, strip ? true }: nameOrPath: content: + assert lib.or (types.path.check nameOrPath) (builtins.match "([0-9A-Za-z._])[0-9A-Za-z._-]*" nameOrPath != null); + assert lib.or (types.path.check content) (types.str.check content); + let + name = last (builtins.split "/" nameOrPath); + in + pkgs.runCommand name ((if (types.str.check content) then { + inherit content; + passAsFile = [ "content" ]; + } else { + contentPath = content; + }) // lib.optionalAttrs (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) { + # post-link-hook expects codesign_allocate to be in PATH + # https://github.com/NixOS/nixpkgs/issues/154203 + # https://github.com/NixOS/nixpkgs/issues/148189 + nativeBuildInputs = [ stdenv.cc.bintools ]; + }) '' + ${compileScript} + ${lib.optionalString strip + "${lib.getBin buildPackages.bintools-unwrapped}/bin/${buildPackages.bintools-unwrapped.targetPrefix}strip -S $out"} + # Sometimes binaries produced for darwin (e. g. by GHC) won't be valid + # mach-o executables from the get-go, but need to be corrected somehow + # which is done by fixupPhase. + ${lib.optionalString pkgs.stdenvNoCC.hostPlatform.isDarwin "fixupPhase"} + ${optionalString (types.path.check nameOrPath) '' + mv $out tmp + mkdir -p $out/$(dirname "${nameOrPath}") + mv tmp $out/${nameOrPath} + ''} + ''; + + # Like writeScript but the first line is a shebang to bash + # + # Example: + # writeBash "example" '' + # echo hello world + # '' + writeBash = makeScriptWriter { + interpreter = "${pkgs.bash}/bin/bash"; + }; + + # Like writeScriptBin but the first line is a shebang to bash + writeBashBin = name: + writeBash "/bin/${name}"; + + # Like writeScript but the first line is a shebang to dash + # + # Example: + # writeDash "example" '' + # echo hello world + # '' + writeDash = makeScriptWriter { + interpreter = "${pkgs.dash}/bin/dash"; + }; + + # Like writeScriptBin but the first line is a shebang to dash + writeDashBin = name: + writeDash "/bin/${name}"; + + # Like writeScript but the first line is a shebang to fish + # + # Example: + # writeFish "example" '' + # echo hello world + # '' + writeFish = makeScriptWriter { + interpreter = "${pkgs.fish}/bin/fish --no-config"; + check = "${pkgs.fish}/bin/fish --no-config --no-execute"; # syntax check only + }; + + # Like writeScriptBin but the first line is a shebang to fish + writeFishBin = name: + writeFish "/bin/${name}"; + + # writeHaskell takes a name, an attrset with libraries and haskell version (both optional) + # and some haskell source code and returns an executable. + # + # Example: + # writeHaskell "missiles" { libraries = [ pkgs.haskellPackages.acme-missiles ]; } '' + # import Acme.Missiles + # + # main = launchMissiles + # ''; + writeHaskell = name: { + libraries ? [], + ghc ? pkgs.ghc, + ghcArgs ? [], + threadedRuntime ? true, + strip ? true + }: + let + appendIfNotSet = el: list: if elem el list then list else list ++ [ el ]; + ghcArgs' = if threadedRuntime then appendIfNotSet "-threaded" ghcArgs else ghcArgs; + + in makeBinWriter { + compileScript = '' + cp $contentPath tmp.hs + ${ghc.withPackages (_: libraries )}/bin/ghc ${lib.escapeShellArgs ghcArgs'} tmp.hs + mv tmp $out + ''; + inherit strip; + } name; + + # writeHaskellBin takes the same arguments as writeHaskell but outputs a directory (like writeScriptBin) + writeHaskellBin = name: + writeHaskell "/bin/${name}"; + + writeRust = name: { + rustc ? pkgs.rustc, + rustcArgs ? [], + strip ? true + }: + let + darwinArgs = lib.optionals stdenv.isDarwin [ "-L${lib.getLib libiconv}/lib" ]; + in + makeBinWriter { + compileScript = '' + cp "$contentPath" tmp.rs + PATH=${lib.makeBinPath [pkgs.gcc]} ${lib.getBin rustc}/bin/rustc ${lib.escapeShellArgs rustcArgs} ${lib.escapeShellArgs darwinArgs} -o "$out" tmp.rs + ''; + inherit strip; + } name; + + writeRustBin = name: + writeRust "/bin/${name}"; + + # writeJS takes a name an attributeset with libraries and some JavaScript sourcecode and + # returns an executable + # + # Example: + # writeJS "example" { libraries = [ pkgs.nodePackages.uglify-js ]; } '' + # var UglifyJS = require("uglify-js"); + # var code = "function add(first, second) { return first + second; }"; + # var result = UglifyJS.minify(code); + # console.log(result.code); + # '' + writeJS = name: { libraries ? [] }: content: + let + node-env = pkgs.buildEnv { + name = "node"; + paths = libraries; + pathsToLink = [ + "/lib/node_modules" + ]; + }; + in writeDash name '' + export NODE_PATH=${node-env}/lib/node_modules + exec ${pkgs.nodejs}/bin/node ${pkgs.writeText "js" content} "$@" + ''; + + # writeJSBin takes the same arguments as writeJS but outputs a directory (like writeScriptBin) + writeJSBin = name: + writeJS "/bin/${name}"; + + awkFormatNginx = builtins.toFile "awkFormat-nginx.awk" '' + awk -f + {sub(/^[ \t]+/,"");idx=0} + /\{/{ctx++;idx=1} + /\}/{ctx--} + {id="";for(i=idx;i $out + gixy $out + ''; + + # writePerl takes a name an attributeset with libraries and some perl sourcecode and + # returns an executable + # + # Example: + # writePerl "example" { libraries = [ pkgs.perlPackages.boolean ]; } '' + # use boolean; + # print "Howdy!\n" if true; + # '' + writePerl = name: { libraries ? [] }: + makeScriptWriter { + interpreter = "${pkgs.perl.withPackages (p: libraries)}/bin/perl"; + } name; + + # writePerlBin takes the same arguments as writePerl but outputs a directory (like writeScriptBin) + writePerlBin = name: + writePerl "/bin/${name}"; + + # makePythonWriter takes python and compatible pythonPackages and produces python script writer, + # which validates the script with flake8 at build time. If any libraries are specified, + # python.withPackages is used as interpreter, otherwise the "bare" python is used. + makePythonWriter = python: pythonPackages: buildPythonPackages: name: { libraries ? [], flakeIgnore ? [] }: + let + ignoreAttribute = optionalString (flakeIgnore != []) "--ignore ${concatMapStringsSep "," escapeShellArg flakeIgnore}"; + in + makeScriptWriter { + interpreter = + if libraries == [] + then python.interpreter + else (python.withPackages (ps: libraries)).interpreter + ; + check = optionalString python.isPy3k (writeDash "pythoncheck.sh" '' + exec ${buildPythonPackages.flake8}/bin/flake8 --show-source ${ignoreAttribute} "$1" + ''); + } name; + + # writePyPy2 takes a name an attributeset with libraries and some pypy2 sourcecode and + # returns an executable + # + # Example: + # writePyPy2 "test_pypy2" { libraries = [ pkgs.pypy2Packages.enum ]; } '' + # from enum import Enum + # + # class Test(Enum): + # a = "success" + # + # print Test.a + # '' + writePyPy2 = makePythonWriter pkgs.pypy2 pkgs.pypy2Packages buildPackages.pypy2Packages; + + # writePyPy2Bin takes the same arguments as writePyPy2 but outputs a directory (like writeScriptBin) + writePyPy2Bin = name: + writePyPy2 "/bin/${name}"; + + # writePython3 takes a name an attributeset with libraries and some python3 sourcecode and + # returns an executable + # + # Example: + # writePython3 "test_python3" { libraries = [ pkgs.python3Packages.pyyaml ]; } '' + # import yaml + # + # y = yaml.load(""" + # - test: success + # """) + # print(y[0]['test']) + # '' + writePython3 = makePythonWriter pkgs.python3 pkgs.python3Packages buildPackages.python3Packages; + + # writePython3Bin takes the same arguments as writePython3 but outputs a directory (like writeScriptBin) + writePython3Bin = name: + writePython3 "/bin/${name}"; + + # writePyPy3 takes a name an attributeset with libraries and some pypy3 sourcecode and + # returns an executable + # + # Example: + # writePyPy3 "test_pypy3" { libraries = [ pkgs.pypy3Packages.pyyaml ]; } '' + # import yaml + # + # y = yaml.load(""" + # - test: success + # """) + # print(y[0]['test']) + # '' + writePyPy3 = makePythonWriter pkgs.pypy3 pkgs.pypy3Packages buildPackages.pypy3Packages; + + # writePyPy3Bin takes the same arguments as writePyPy3 but outputs a directory (like writeScriptBin) + writePyPy3Bin = name: + writePyPy3 "/bin/${name}"; + + + makeFSharpWriter = { dotnet-sdk ? pkgs.dotnet-sdk, fsi-flags ? "", libraries ? _: [] }: nameOrPath: + let + fname = last (builtins.split "/" nameOrPath); + path = if strings.hasSuffix ".fsx" nameOrPath then nameOrPath else "${nameOrPath}.fsx"; + _nugetDeps = mkNugetDeps { name = "${fname}-nuget-deps"; nugetDeps = libraries; }; + + nuget-source = mkNugetSource { + name = "${fname}-nuget-source"; + description = "A Nuget source with the dependencies for ${fname}"; + deps = [ _nugetDeps ]; + }; + + fsi = writeBash "fsi" '' + export HOME=$NIX_BUILD_TOP/.home + export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 + export DOTNET_CLI_TELEMETRY_OPTOUT=1 + export DOTNET_NOLOGO=1 + script="$1"; shift + ${dotnet-sdk}/bin/dotnet fsi --quiet --nologo --readline- ${fsi-flags} "$@" < "$script" + ''; + + in content: makeScriptWriter { + interpreter = fsi; + } path + '' + #i "nuget: ${nuget-source}/lib" + ${ content } + exit 0 + ''; + + writeFSharp = + makeFSharpWriter {}; + + writeFSharpBin = name: + writeFSharp "/bin/${name}"; + +} From 504e42b559d74b013e95d93f5fc3868f756fd46b Mon Sep 17 00:00:00 2001 From: zimbatm Date: Sat, 22 Jul 2023 11:14:51 +0200 Subject: [PATCH 14/34] writers: introduce data writers Make it easy to write structured data back to disk. --- pkgs/build-support/writers/data.nix | 80 ++++++++++++++++++++++++++ pkgs/build-support/writers/default.nix | 12 +++- pkgs/build-support/writers/test.nix | 38 +++++++++++- 3 files changed, 126 insertions(+), 4 deletions(-) create mode 100644 pkgs/build-support/writers/data.nix diff --git a/pkgs/build-support/writers/data.nix b/pkgs/build-support/writers/data.nix new file mode 100644 index 000000000000..a080f8c29d0e --- /dev/null +++ b/pkgs/build-support/writers/data.nix @@ -0,0 +1,80 @@ +{ lib, runCommandNoCC, dasel }: +let + daselBin = lib.getExe dasel; + + inherit (lib) + last + optionalString + types + ; +in +rec { + # Creates a transformer function that writes input data to disk, transformed + # by both the `input` and `output` arguments. + # + # Type: makeDataWriter :: input -> output -> nameOrPath -> data -> (any -> string) -> string -> string -> any -> derivation + # + # input :: T -> string: function that takes the nix data and returns a string + # output :: string: script that takes the $inputFile and write the result into $out + # nameOrPath :: string: if the name contains a / the files gets written to a sub-folder of $out. The derivation name is the basename of this argument. + # data :: T: the data that will be converted. + # + # Example: + # writeJSON = makeDataWriter { input = builtins.toJSON; output = "cp $inputPath $out"; }; + # myConfig = writeJSON "config.json" { hello = "world"; } + # + makeDataWriter = { input ? lib.id, output ? "cp $inputPath $out" }: nameOrPath: data: + assert lib.or (types.path.check nameOrPath) (builtins.match "([0-9A-Za-z._])[0-9A-Za-z._-]*" nameOrPath != null); + let + name = last (builtins.split "/" nameOrPath); + in + runCommandNoCC name + { + input = input data; + passAsFile = [ "input" ]; + } '' + ${output} + + ${optionalString (types.path.check nameOrPath) '' + mv $out tmp + mkdir -p $out/$(dirname "${nameOrPath}") + mv tmp $out/${nameOrPath} + ''} + ''; + + # Writes the content to text. + # + # Example: + # writeText "filename.txt" "file content" + writeText = makeDataWriter { + input = toString; + output = "cp $inputPath $out"; + }; + + # Writes the content to a JSON file. + # + # Example: + # writeJSON "data.json" { hello = "world"; } + writeJSON = makeDataWriter { + input = builtins.toJSON; + output = "${daselBin} -f $inputPath -r json -w json > $out"; + }; + + # Writes the content to a TOML file. + # + # Example: + # writeTOML "data.toml" { hello = "world"; } + writeTOML = makeDataWriter { + input = builtins.toJSON; + output = "${daselBin} -f $inputPath -r json -w toml > $out"; + }; + + # Writes the content to a YAML file. + # + # Example: + # writeYAML "data.yaml" { hello = "world"; } + writeYAML = makeDataWriter { + input = builtins.toJSON; + output = "${daselBin} -f $inputPath -r json -w yaml > $out"; + }; +} diff --git a/pkgs/build-support/writers/default.nix b/pkgs/build-support/writers/default.nix index c26ada8bc571..5ef579422195 100644 --- a/pkgs/build-support/writers/default.nix +++ b/pkgs/build-support/writers/default.nix @@ -3,8 +3,16 @@ let aliases = if config.allowAliases then (import ./aliases.nix lib) else prev: {}; - scriptWriters = import ./scripts.nix { inherit pkgs lib; }; + # Writers for JSON-like data structures + dataWriters = import ./data.nix { + inherit lib; inherit (pkgs) runCommandNoCC dasel; + }; - writers = scriptWriters; + # Writers for scripts + scriptWriters = import ./scripts.nix { + inherit lib pkgs; + }; + + writers = scriptWriters // dataWriters; in writers // (aliases writers) diff --git a/pkgs/build-support/writers/test.nix b/pkgs/build-support/writers/test.nix index 9484f8bbe31b..2411f8c03a70 100644 --- a/pkgs/build-support/writers/test.nix +++ b/pkgs/build-support/writers/test.nix @@ -14,7 +14,7 @@ with writers; let expectSuccess = test: runCommand "run-${test.name}" {} '' - if test "$(${test})" != "success"; then + if [[ "$(${test})" != success ]]; then echo 'test ${test.name} failed' exit 1 fi @@ -24,11 +24,24 @@ let expectSuccessBin = test: runCommand "run-${test.name}" {} '' - if test "$(${lib.getExe test})" != "success"; then + if [[ "$(${lib.getExe test})" != success ]]; then echo 'test ${test.name} failed' exit 1 fi + touch $out + ''; + + expectDataEqual = { file, expected }: + let + expectedFile = writeText "${file.name}-expected" expected; + in + runCommand "run-${file.name}" {} '' + if ! diff -u ${file} ${expectedFile}; then + echo 'test ${file.name} failed' + exit 1 + fi + touch $out ''; in @@ -235,4 +248,25 @@ lib.recurseIntoAttrs { _ -> print "fail" '')); }; + + data = { + json = expectDataEqual { + file = writeJSON "data.json" { hello = "world"; }; + expected = '' + { + "hello": "world" + } + ''; + }; + + toml = expectDataEqual { + file = writeTOML "data.toml" { hello = "world"; }; + expected = "hello = 'world'\n"; + }; + + yaml = expectDataEqual { + file = writeYAML "data.yaml" { hello = "world"; }; + expected = "hello: world\n"; + }; + }; } From c161060dc7e17f427cbb6e79e88248fdf3c57539 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Mon, 24 Jul 2023 11:26:05 +0200 Subject: [PATCH 15/34] goofys: update vendor hash --- pkgs/tools/filesystems/goofys/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/filesystems/goofys/default.nix b/pkgs/tools/filesystems/goofys/default.nix index 53841f684208..207fcfc9c74f 100644 --- a/pkgs/tools/filesystems/goofys/default.nix +++ b/pkgs/tools/filesystems/goofys/default.nix @@ -16,7 +16,7 @@ buildGoModule { sha256 = "sha256-6yVMNSwwPZlADXuPBDRlgoz4Stuz2pgv6r6+y2/C8XY="; }; - vendorSha256 = "sha256-2N8MshBo9+2q8K00eTW5So6d8ZNRzOfQkEKmxR428gI="; + vendorSha256 = "sha256-shFld293pdmVcnu3p0NoBmPGLJddZd4O/gJ8klgdlQ8="; subPackages = [ "." ]; From c4c444a59f3c73a81540087a17174dde6ac807b9 Mon Sep 17 00:00:00 2001 From: figsoda Date: Tue, 25 Jul 2023 10:02:13 -0400 Subject: [PATCH 16/34] gtree: 1.9.1 -> 1.9.2 Diff: https://github.com/ddddddO/gtree/compare/v1.9.1...v1.9.2 Changelog: https://github.com/ddddddO/gtree/releases/tag/v1.9.2 --- pkgs/tools/text/gtree/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/text/gtree/default.nix b/pkgs/tools/text/gtree/default.nix index 5a087d276c00..5d18e7834dbb 100644 --- a/pkgs/tools/text/gtree/default.nix +++ b/pkgs/tools/text/gtree/default.nix @@ -7,13 +7,13 @@ buildGoModule rec { pname = "gtree"; - version = "1.9.1"; + version = "1.9.2"; src = fetchFromGitHub { owner = "ddddddO"; repo = "gtree"; rev = "v${version}"; - hash = "sha256-IH+dqPTtVBgIUI63tetS/s5gjleqdTEQ6iD0DeliOjY="; + hash = "sha256-RBGbFC+MOteCImPwzn2WYq5LTYF6rZEpTt1hlfHvUBw="; }; vendorHash = "sha256-QxcDa499XV43p8fstENOtfe3iZ176R5/Ub5iovXlYIM="; From 3575aa76c5e0c59284e341d2f5f6343ec4a14223 Mon Sep 17 00:00:00 2001 From: Jennifer Graul Date: Tue, 25 Jul 2023 16:14:11 +0200 Subject: [PATCH 17/34] python3Packages.reprshed: init at 1.0.6 --- .../python-modules/reprshed/default.nix | 28 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 30 insertions(+) create mode 100644 pkgs/development/python-modules/reprshed/default.nix diff --git a/pkgs/development/python-modules/reprshed/default.nix b/pkgs/development/python-modules/reprshed/default.nix new file mode 100644 index 000000000000..1aa9469aab29 --- /dev/null +++ b/pkgs/development/python-modules/reprshed/default.nix @@ -0,0 +1,28 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +}: + +buildPythonPackage rec { + pname = "python-reprshed"; + version = "1.0.6"; + format = "setuptools"; + + src = fetchFromGitHub { + owner = "mentalisttraceur"; + repo = "python-reprshed"; + rev = "v${version}"; + hash = "sha256-XfmiewI74eDLKTAU6Ed76QXfJYMRb+idRACl6CW07ME="; + }; + + pythonImportsCheck = [ + "reprshed" + ]; + + meta = with lib; { + homepage = "https://github.com/mentalisttraceur/python-reprshed"; + description = "A toolshed for writing great __repr__ methods quickly and easily"; + license = licenses.bsd0; + maintainers = with maintainers; [ netali ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index e2f1691e5815..393666035af1 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10906,6 +10906,8 @@ self: super: with self; { reproject = callPackage ../development/python-modules/reproject { }; + reprshed = callPackage ../development/python-modules/reprshed { }; + reqif = callPackage ../development/python-modules/reqif { }; requests-aws4auth = callPackage ../development/python-modules/requests-aws4auth { }; From e1823135fd76b3751015eb3e8043eff0d4f14332 Mon Sep 17 00:00:00 2001 From: Jennifer Graul Date: Tue, 25 Jul 2023 16:14:40 +0200 Subject: [PATCH 18/34] python3Packages.macaddress: init at 2.0.2 --- .../python-modules/macaddress/default.nix | 41 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 43 insertions(+) create mode 100644 pkgs/development/python-modules/macaddress/default.nix diff --git a/pkgs/development/python-modules/macaddress/default.nix b/pkgs/development/python-modules/macaddress/default.nix new file mode 100644 index 000000000000..2849506671b2 --- /dev/null +++ b/pkgs/development/python-modules/macaddress/default.nix @@ -0,0 +1,41 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytestCheckHook +, hypothesis +, reprshed +}: + +buildPythonPackage rec { + pname = "macaddress"; + version = "2.0.2"; + format = "setuptools"; + + src = fetchFromGitHub { + owner = "mentalisttraceur"; + repo = "python-macaddress"; + rev = "v${version}"; + hash = "sha256-2eD5Ui8kUduKLJ0mSiwaz7TQSeF1+2ASirp70V/8+EA="; + }; + + pythonImportsCheck = [ + "macaddress" + ]; + + nativeCheckInputs = [ + pytestCheckHook + hypothesis + reprshed + ]; + + pytestFlagsArray = [ + "$src/test.py" + ]; + + meta = with lib; { + homepage = "https://github.com/mentalisttraceur/python-macaddress"; + description = "A module for handling hardware identifiers like MAC addresses"; + license = licenses.bsd0; + maintainers = with maintainers; [ netali ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 393666035af1..7e137d0ec096 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6167,6 +6167,8 @@ self: super: with self; { mac-vendor-lookup = callPackage ../development/python-modules/mac-vendor-lookup { }; + macaddress = callPackage ../development/python-modules/macaddress{ }; + macfsevents = callPackage ../development/python-modules/macfsevents { inherit (pkgs.darwin.apple_sdk.frameworks) CoreFoundation CoreServices; }; From fcf915b0629095c7e00f305a3f78279072c89e40 Mon Sep 17 00:00:00 2001 From: figsoda Date: Tue, 25 Jul 2023 11:38:34 -0400 Subject: [PATCH 19/34] ripdrag: add wrapGAppsHook4 Co-Authored-by: Lewis Arias --- pkgs/tools/misc/ripdrag/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/misc/ripdrag/default.nix b/pkgs/tools/misc/ripdrag/default.nix index dea4349c140c..f6b6a24e726a 100644 --- a/pkgs/tools/misc/ripdrag/default.nix +++ b/pkgs/tools/misc/ripdrag/default.nix @@ -1,4 +1,4 @@ -{ lib, rustPlatform, fetchCrate, pkg-config, gtk4 }: +{ lib, rustPlatform, fetchCrate, pkg-config, wrapGAppsHook4, gtk4 }: rustPlatform.buildRustPackage rec { pname = "ripdrag"; @@ -11,7 +11,7 @@ rustPlatform.buildRustPackage rec { cargoSha256 = "sha256-C2I26E/dd18A4DDgOYGR8aS1RBrrNUwaXI4ZJHcrKy0="; - nativeBuildInputs = [ pkg-config ]; + nativeBuildInputs = [ pkg-config wrapGAppsHook4 ]; buildInputs = [ gtk4 ]; From 28d4ded6b0bd9e440042f94ccbf1b42fd6b0ec05 Mon Sep 17 00:00:00 2001 From: figsoda Date: Tue, 25 Jul 2023 11:48:21 -0400 Subject: [PATCH 20/34] ripdrag: 0.3.0 -> 0.3.1 Diff: https://diff.rs/ripdrag/0.3.0/0.3.1 --- pkgs/tools/misc/ripdrag/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/misc/ripdrag/default.nix b/pkgs/tools/misc/ripdrag/default.nix index f6b6a24e726a..bcb7d40877f6 100644 --- a/pkgs/tools/misc/ripdrag/default.nix +++ b/pkgs/tools/misc/ripdrag/default.nix @@ -2,14 +2,14 @@ rustPlatform.buildRustPackage rec { pname = "ripdrag"; - version = "0.3.0"; + version = "0.3.1"; src = fetchCrate { inherit pname version; - sha256 = "sha256-D4WB1RdMPJfSLbJ96h3OuFhokfyY8Gamctm0XY694YM="; + hash = "sha256-SSH/HCvrUvWNIqlx7F6eNMM1eGxGGg5eel/X/q1Um1g="; }; - cargoSha256 = "sha256-C2I26E/dd18A4DDgOYGR8aS1RBrrNUwaXI4ZJHcrKy0="; + cargoHash = "sha256-FvStPBmyETjCaBqQK/KYHpwtqNCiY6n484E5bumdRzk="; nativeBuildInputs = [ pkg-config wrapGAppsHook4 ]; From 408ece7d3d5b68f5c0d870abb936ee8950a1b9f9 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Tue, 25 Jul 2023 11:48:09 +0200 Subject: [PATCH 21/34] libreoffice-fresh: strip away BUILDCONFIG, reduce runtime closure size by ~20% In v7.5.x a change was introduced that writes the BUILDCONFIG into `$out/lib/libreoffice/program/libsofficeapp.so` including the `PKG_CONFIG_PATH` containing references to all `dev` outputs of library dependencies: $ strings $(nix-build -A libreoffice-fresh)/lib/libreoffice/program/libsofficeapp.so|grep PKG_CONFIG_PATH [...], "BuildConfig": "[...] 'PKG_CONFIG_PATH=[...]'" This isn't really needed because this information can also be obtained by `nix derivation show`. Also, this causes a 20% larger runtime-closure because of all the dev dependencies being referenced by the output and thus downloaded whenever libreoffice is substituted somewhere. The actual numbers look like this: $ nix path-info -Sh ./result-old /nix/store/3mzrqh4gg7v27vdrrap9dj3x8myysmyf-libreoffice-7.5.4.1-wrapped 2.0G $ nix path-info -Sh ./result /nix/store/g5y60s0a2q2v6r58xcayv62z7fjfi816-libreoffice-7.5.4.1-wrapped 1.6G Only `libreoffice-fresh` is affected, `pkgs.libreoffice` isn't because it still points to 7.4 whereas the problematic change was introduced in 7.5. To make sure this doesn't get reintroduced by accident, the derivation also prohibits now to reference any dev output from a build input. [1] https://gerrit.libreoffice.org/c/core/+/141197 --- .../0001-Strip-away-BUILDCONFIG.patch | 32 +++++++++++++++++++ .../office/libreoffice/default.nix | 16 ++++++++++ 2 files changed, 48 insertions(+) create mode 100644 pkgs/applications/office/libreoffice/0001-Strip-away-BUILDCONFIG.patch diff --git a/pkgs/applications/office/libreoffice/0001-Strip-away-BUILDCONFIG.patch b/pkgs/applications/office/libreoffice/0001-Strip-away-BUILDCONFIG.patch new file mode 100644 index 000000000000..b477f902b2fb --- /dev/null +++ b/pkgs/applications/office/libreoffice/0001-Strip-away-BUILDCONFIG.patch @@ -0,0 +1,32 @@ +From 982d38084f08950863b55043f36ce5548bd73635 Mon Sep 17 00:00:00 2001 +From: Maximilian Bosch +Date: Mon, 24 Jul 2023 19:12:25 +0200 +Subject: [PATCH] Strip away BUILDCONFIG + +The `BuildConfig` field in `libsofficeapp.so` includes the entire +`PKG_CONFIG_PATH` and subsequently references to a lot of `dev` outputs +of library dependencies blowing up the closure. + +Since this is not strictly needed and the inputs are comprehensible via +`nix derivation show`, this doesn't bring a real benefit in the case of +nixpkgs anyways. +--- + desktop/source/lib/init.cxx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx +index 8d830c0cbd00..fbdc86aa7115 100644 +--- a/desktop/source/lib/init.cxx ++++ b/desktop/source/lib/init.cxx +@@ -7097,7 +7097,7 @@ static char* lo_getVersionInfo(SAL_UNUSED_PARAMETER LibreOfficeKit* /*pThis*/) + "\"ProductVersion\": \"%PRODUCTVERSION\", " + "\"ProductExtension\": \"%PRODUCTEXTENSION\", " + "\"BuildId\": \"%BUILDID\", " +- "\"BuildConfig\": \"" BUILDCONFIG "\" " ++ "\"BuildConfig\": \"removed to avoid runtime dependencies against dev outputs of each dependency. Use 'nix derivation show' against the package to find out details about BuildConfig.\" " + "}")); + } + +-- +2.40.1 + diff --git a/pkgs/applications/office/libreoffice/default.nix b/pkgs/applications/office/libreoffice/default.nix index 518167cb33d1..cf769bf20478 100644 --- a/pkgs/applications/office/libreoffice/default.nix +++ b/pkgs/applications/office/libreoffice/default.nix @@ -214,6 +214,22 @@ in tar -xf ${srcs.translations} ''; + # Remove build config to reduce the amount of `-dev` outputs in the + # runtime closure. This was introduced in upstream commit + # cbfac11330882c7d0a817b6c37a08b2ace2b66f4, so the patch doesn't apply + # for 7.4. + patches = lib.optionals (lib.versionAtLeast version "7.5") [ + ./0001-Strip-away-BUILDCONFIG.patch + ]; + + # libreoffice tries to reference the BUILDCONFIG (e.g. PKG_CONFIG_PATH) + # in the binary causing the closure size to blow up because of many unnecessary + # dependencies to dev outputs. This behavior was patched away in nixpkgs + # (see above), make sure these don't leak again by accident. + disallowedRequisites = lib.concatMap + (x: lib.optional (x?dev) x.dev) + buildInputs; + ### QT/KDE # # configure.ac assumes that the first directory that contains headers and From 6847b194588be88315fca29621db59a1342e0959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Tue, 25 Jul 2023 19:15:39 +0200 Subject: [PATCH 22/34] topgrade: 12.0.1 -> 12.0.2 Diff: https://github.com/topgrade-rs/topgrade/compare/v12.0.1...v12.0.2 Changelog: https://github.com/topgrade-rs/topgrade/releases/tag/v12.0.2 --- pkgs/tools/misc/topgrade/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/misc/topgrade/default.nix b/pkgs/tools/misc/topgrade/default.nix index a01ee6bb86dd..f900eafaacd1 100644 --- a/pkgs/tools/misc/topgrade/default.nix +++ b/pkgs/tools/misc/topgrade/default.nix @@ -10,16 +10,16 @@ rustPlatform.buildRustPackage rec { pname = "topgrade"; - version = "12.0.1"; + version = "12.0.2"; src = fetchFromGitHub { owner = "topgrade-rs"; repo = "topgrade"; rev = "v${version}"; - hash = "sha256-H+Vx5yfHKgiUCrk42PMlu+XQsehol6aBLSwCuiBWCrs="; + hash = "sha256-PfrtTegJULzPAmKUk/6P9rD+ttPJOhaf2505og64C0Y="; }; - cargoHash = "sha256-ixFTkTyPKLeH6VcFAOAwmdc6YrrIpJ8obBwm19tFq3s="; + cargoHash = "sha256-S6jSI/KuHocYD2dhg3o1NSyA8Q04Xo215TWl8Y1C7g8="; nativeBuildInputs = [ installShellFiles From 2c9bd9bcfca002c083770fefe9630523780a1ded Mon Sep 17 00:00:00 2001 From: Darwin Corn Date: Tue, 25 Jul 2023 10:40:58 -0700 Subject: [PATCH 23/34] vimPlugins: update --- .../editors/vim/plugins/generated.nix | 150 ++++++++++-------- 1 file changed, 81 insertions(+), 69 deletions(-) diff --git a/pkgs/applications/editors/vim/plugins/generated.nix b/pkgs/applications/editors/vim/plugins/generated.nix index 93c39d8c289c..7cef87bafcc0 100644 --- a/pkgs/applications/editors/vim/plugins/generated.nix +++ b/pkgs/applications/editors/vim/plugins/generated.nix @@ -173,24 +173,24 @@ final: prev: LazyVim = buildVimPluginFrom2Nix { pname = "LazyVim"; - version = "2023-07-23"; + version = "2023-07-25"; src = fetchFromGitHub { owner = "LazyVim"; repo = "LazyVim"; - rev = "9a0543531d05a417ba63f3dd710530ba5765aca5"; - sha256 = "0xr0brs8wvcmw6zpqp2khq7f6k2nscicjd537gg0mv23pcw6skgm"; + rev = "aa1cccf230a01bd85d5173f7d87f782fd83caa88"; + sha256 = "1kx8n6rn9vgsp7j9kmdz2f6yg812i64nclii0y2cjpnb8h1aa0cf"; }; meta.homepage = "https://github.com/LazyVim/LazyVim/"; }; LeaderF = buildVimPluginFrom2Nix { pname = "LeaderF"; - version = "2023-07-24"; + version = "2023-07-25"; src = fetchFromGitHub { owner = "Yggdroot"; repo = "LeaderF"; - rev = "4c5290e277d2a50d83222dacba35aec42c096875"; - sha256 = "1a99sdvdjz61hh357psbq4jxyksv1lpn8nn96a5cm02g81922r3z"; + rev = "8d51a3512fa318393df2bc092e458fd7d6c8e75b"; + sha256 = "0abffydl0h8nnxq5m0vicbi4cxcbfa34m13al7xx0plbk31q3iyd"; }; meta.homepage = "https://github.com/Yggdroot/LeaderF/"; }; @@ -559,12 +559,12 @@ final: prev: ale = buildVimPluginFrom2Nix { pname = "ale"; - version = "2023-07-24"; + version = "2023-07-25"; src = fetchFromGitHub { owner = "dense-analysis"; repo = "ale"; - rev = "481c5cccbf48f6df97cfa1489e811438b4f2f088"; - sha256 = "1qf42k28p4im6cm9nizxdkzfxnriw7nbnbcinkyg1i56axm4iz3d"; + rev = "b216892f0c1ce7bbe9efeeb6cf55b52a473f49c2"; + sha256 = "0df56hrqyv1vq19alnpv981fmrb68gx3127izp7pi974r4if87pa"; }; meta.homepage = "https://github.com/dense-analysis/ale/"; }; @@ -967,12 +967,12 @@ final: prev: base46 = buildVimPluginFrom2Nix { pname = "base46"; - version = "2023-07-23"; + version = "2023-07-25"; src = fetchFromGitHub { owner = "nvchad"; repo = "base46"; - rev = "4191712e74c44f135a32aeab30576d569bbbded4"; - sha256 = "06sr52pz0904hrb04zpz3q5rddgbbkh8rxsiwyp3ygs8w717ij5g"; + rev = "cb012feef7ce8c0bb8cdcb2b858393aa92834f46"; + sha256 = "1zg0pw2jhx8w21yfky3icai0wq87884ybls34hhn9rwkzn78m4n9"; }; meta.homepage = "https://github.com/nvchad/base46/"; }; @@ -1303,12 +1303,12 @@ final: prev: clangd_extensions-nvim = buildVimPluginFrom2Nix { pname = "clangd_extensions.nvim"; - version = "2023-07-24"; + version = "2023-07-25"; src = fetchFromGitHub { owner = "p00f"; repo = "clangd_extensions.nvim"; - rev = "4a822fca87c40099a4e8b27f396e7b24114b60d0"; - sha256 = "1jw9hrb4577vn6yx037bd7diklcpkajasw7mv70mdwlxckdvvn02"; + rev = "b3b0eb798ecbdd16832fd38d4b07ba31ab4fe831"; + sha256 = "127sb5w8sv5ldx6vgzf7ynkw24wpvpdp7m192fh1qgymlnma8hsy"; }; meta.homepage = "https://github.com/p00f/clangd_extensions.nvim/"; }; @@ -3021,12 +3021,12 @@ final: prev: edgy-nvim = buildVimPluginFrom2Nix { pname = "edgy.nvim"; - version = "2023-07-01"; + version = "2023-07-25"; src = fetchFromGitHub { owner = "folke"; repo = "edgy.nvim"; - rev = "0d3b64f9159442cf9edcad451a0dd9fb7e31bc41"; - sha256 = "1w43qilfhacnmqr76lp2fkbawbndas180f5ab7h133rwgr64lc7p"; + rev = "4ccc1c67ae2b1a0c55f18c83d03b714e2bb1bae4"; + sha256 = "0s0h8s2wwg2niacp401j7l3c0knl44awf32clq15h1hcabqvvkn3"; }; meta.homepage = "https://github.com/folke/edgy.nvim/"; }; @@ -3708,12 +3708,12 @@ final: prev: gitsigns-nvim = buildNeovimPlugin { pname = "gitsigns.nvim"; - version = "2023-07-18"; + version = "2023-07-25"; src = fetchFromGitHub { owner = "lewis6991"; repo = "gitsigns.nvim"; - rev = "adcf2c7f2f495f5df148683764bf7cba6a70f34c"; - sha256 = "1lhcysi2v51l5hbv7x74wah0hsndfd6c8slg8q4avbyb46wycppr"; + rev = "11b80e7eea249affc8776483272bcfc627b5552a"; + sha256 = "0mwmyci65w4rzrvlcws7s6yw4m801vdcqr585harccifyrvpslls"; }; meta.homepage = "https://github.com/lewis6991/gitsigns.nvim/"; }; @@ -3732,12 +3732,12 @@ final: prev: glance-nvim = buildVimPluginFrom2Nix { pname = "glance.nvim"; - version = "2023-07-23"; + version = "2023-07-25"; src = fetchFromGitHub { owner = "DNLHC"; repo = "glance.nvim"; - rev = "866d0f8584c129e071d84138c679d39aa9b5684c"; - sha256 = "1i2ly61swp25h1vkw2sk7nkkgdbr03qfgqj4j6bd5llyjppypj3q"; + rev = "3d67c10c422b2d2800761f4f484305540d54450b"; + sha256 = "186zb2zh4njwy2rxfhmgq0bb3nyfiwf7d289k35qnzw0i7b21wkj"; }; meta.homepage = "https://github.com/DNLHC/glance.nvim/"; }; @@ -3768,12 +3768,12 @@ final: prev: go-nvim = buildVimPluginFrom2Nix { pname = "go.nvim"; - version = "2023-07-07"; + version = "2023-07-25"; src = fetchFromGitHub { owner = "ray-x"; repo = "go.nvim"; - rev = "6550ddf5ce491d17af009c397aceb25310566eaa"; - sha256 = "01im6m0h7pa04dzh0daxkll5y1i7zf5kxlj01cribghl04zlhdxc"; + rev = "816fbe43b5dc15edcafa0b32785a4972fb34e67f"; + sha256 = "0fs3rf3l0dp0141rc0g75alq89z9khjcvhfz7brn291bik7xm56b"; }; meta.homepage = "https://github.com/ray-x/go.nvim/"; }; @@ -5062,12 +5062,12 @@ final: prev: lsp_signature-nvim = buildVimPluginFrom2Nix { pname = "lsp_signature.nvim"; - version = "2023-06-01"; + version = "2023-07-25"; src = fetchFromGitHub { owner = "ray-x"; repo = "lsp_signature.nvim"; - rev = "17ff7a405fea8376b015b8ea7910d2e59958bf68"; - sha256 = "1qgl3j9a0b3wf381q859xjw0pcfbfxxm0fsdhj7bgfdq11v2q60p"; + rev = "58d4e810801da74c29313da86075d6aea537501f"; + sha256 = "14v8mkv3q7l0pv63i3sgiv81bg5yfq927n94nrfz7nwfmg82rxxa"; }; meta.homepage = "https://github.com/ray-x/lsp_signature.nvim/"; }; @@ -5267,12 +5267,12 @@ final: prev: mason-nvim = buildVimPluginFrom2Nix { pname = "mason.nvim"; - version = "2023-07-21"; + version = "2023-07-25"; src = fetchFromGitHub { owner = "williamboman"; repo = "mason.nvim"; - rev = "3f6b544c75c01549f7a2a9e395e0f1cea42b25dd"; - sha256 = "0sjdxx2lfnaq90vw8n7418bj4dhvk65ksxs7r4mjp0jhygzhssdb"; + rev = "fe9e34a9ab4d64321cdc3ecab4ea1809239bb73f"; + sha256 = "1yvf5hml1nhglmfaa0da5mjmgxaysc8x8k1rk820vpj5f1bhl70p"; }; meta.homepage = "https://github.com/williamboman/mason.nvim/"; }; @@ -5363,12 +5363,12 @@ final: prev: minimap-vim = buildVimPluginFrom2Nix { pname = "minimap.vim"; - version = "2023-07-24"; + version = "2023-07-25"; src = fetchFromGitHub { owner = "wfxr"; repo = "minimap.vim"; - rev = "d8c78a8435196e6884cf93360abe76bbf946e6a7"; - sha256 = "0cs4qhl9siymbpg5xw1g4h2qji2vwzy6s430pm05iyrbdrq92gwy"; + rev = "74573b63b9ef0583262b6bf6ef209eb7f3b06b94"; + sha256 = "040z12dxagbfsbkdwpsz6dk2vpak3z737ra5ipb1ljqsswgrj5f9"; }; meta.homepage = "https://github.com/wfxr/minimap.vim/"; }; @@ -5783,12 +5783,12 @@ final: prev: neogit = buildVimPluginFrom2Nix { pname = "neogit"; - version = "2023-07-23"; + version = "2023-07-25"; src = fetchFromGitHub { owner = "NeogitOrg"; repo = "neogit"; - rev = "805a7aa3e5412bbc05c88fb97bef2bc219441098"; - sha256 = "0i61s5rdbnsak1a4vwx0164hilx7xslhk112yzr6bxbrnmgxw0sl"; + rev = "e94b15969e65eafbf31749700828cac117cc1336"; + sha256 = "1anzm10mc94lwnhlcxp4qkxnvf1kwr1bxb4kjq1a2c6v05sx5jfb"; }; meta.homepage = "https://github.com/NeogitOrg/neogit/"; }; @@ -6335,12 +6335,12 @@ final: prev: noice-nvim = buildVimPluginFrom2Nix { pname = "noice.nvim"; - version = "2023-07-22"; + version = "2023-07-25"; src = fetchFromGitHub { owner = "folke"; repo = "noice.nvim"; - rev = "c7969e3c25530087b3a52128030163280a7cf679"; - sha256 = "0hzn57jsa6ffw9dfyj71pm4r2f1w978qx0s6bk6qv93rrznvjnwz"; + rev = "894db25ec726d32047799d4d0a982b701bec453b"; + sha256 = "1vpdl0905vxxbcc354v4g2m2nrpc7fmzpn2yjwgmwz34wacvmik5"; }; meta.homepage = "https://github.com/folke/noice.nvim/"; }; @@ -6743,12 +6743,12 @@ final: prev: nvim-fzf = buildVimPluginFrom2Nix { pname = "nvim-fzf"; - version = "2022-07-12"; + version = "2023-07-25"; src = fetchFromGitHub { owner = "vijaymarupudi"; repo = "nvim-fzf"; - rev = "a8dc4bae4c1e1552e0233df796e512ab9ca65e44"; - sha256 = "0cyq5rq029hnk9p3qw6gfhxvqiz5m788i4w6n4xxb6wif642bd4l"; + rev = "45d14cd66c160b199b3c5cef0e7c81793dc2b1e0"; + sha256 = "1qv7k1nvh61sd24k0c1iayhv3xw9vx14ciqgdmfggl8d4cfvlg21"; }; meta.homepage = "https://github.com/vijaymarupudi/nvim-fzf/"; }; @@ -6935,12 +6935,12 @@ final: prev: nvim-lspconfig = buildVimPluginFrom2Nix { pname = "nvim-lspconfig"; - version = "2023-07-21"; + version = "2023-07-25"; src = fetchFromGitHub { owner = "neovim"; repo = "nvim-lspconfig"; - rev = "dd11ba7b3c8f82d51b6d4dd7d68fce2d78bf78a0"; - sha256 = "0qkb5bwd6l17j52pi405ma1iq0lidqz300m3322jv8z8fhagp8si"; + rev = "6f426c34c8e21af2f934e56be9d1198a507ecc9f"; + sha256 = "167d9df5a3sh69frklk70ff3aw9ks33cc1v6y32iky8i16479zfi"; }; meta.homepage = "https://github.com/neovim/nvim-lspconfig/"; }; @@ -7271,12 +7271,12 @@ final: prev: nvim-treesitter = buildVimPluginFrom2Nix { pname = "nvim-treesitter"; - version = "2023-07-24"; + version = "2023-07-25"; src = fetchFromGitHub { owner = "nvim-treesitter"; repo = "nvim-treesitter"; - rev = "7c1e944311a0d4eb2c8a346661ee4ed207aca514"; - sha256 = "01aw60dzgj72yk5npwwfgq7l8193kr67yypkyrc6938gdw4p3mqk"; + rev = "74a7da4e4be5ee71e9efb6d7bdffa16ad620cc57"; + sha256 = "017fp6rmqqf60br9fzc0xkndxcbq68s092k80ac4p47cqwr3blqn"; }; meta.homepage = "https://github.com/nvim-treesitter/nvim-treesitter/"; }; @@ -7655,12 +7655,12 @@ final: prev: orgmode = buildVimPluginFrom2Nix { pname = "orgmode"; - version = "2023-07-20"; + version = "2023-07-25"; src = fetchFromGitHub { owner = "nvim-orgmode"; repo = "orgmode"; - rev = "b5e12db00e88a9183fd19d9868698d85aec96aca"; - sha256 = "0w016pgkdcrgjviz1banjnr85fp09kyx7wc8h0xwnlxr16d812lm"; + rev = "6b6eb8eabbed4d95568fd1f5374a3dff7ed51a3b"; + sha256 = "1snqqrpck8wgkc67dzcy6y0y9n37sipkaq6fxxy1h71d8363vkwd"; }; meta.homepage = "https://github.com/nvim-orgmode/orgmode/"; }; @@ -8485,12 +8485,12 @@ final: prev: sg-nvim = buildVimPluginFrom2Nix { pname = "sg.nvim"; - version = "2023-07-24"; + version = "2023-07-25"; src = fetchFromGitHub { owner = "sourcegraph"; repo = "sg.nvim"; - rev = "6a59833ea23c7dce49936a71309465ba17e9b661"; - sha256 = "0fv3rs74gz56vcishxwpjy4rzxbc58c4kpzcapmrg1ia5hrlmgzb"; + rev = "3fdedc7f14ee3967e2b0a49d51fdef1f92b802af"; + sha256 = "14lf8izgkr5m0w41k63vp2r2b2ll0zvjkm5c6lqrm3i7cmmln229"; }; meta.homepage = "https://github.com/sourcegraph/sg.nvim/"; }; @@ -9800,12 +9800,12 @@ final: prev: trouble-nvim = buildVimPluginFrom2Nix { pname = "trouble.nvim"; - version = "2023-07-23"; + version = "2023-07-25"; src = fetchFromGitHub { owner = "folke"; repo = "trouble.nvim"; - rev = "0e6703c1d37d2d34ed029ab54f9bd66e3f2ecbf7"; - sha256 = "1rz22rmv5cg0zr07cwmsh9gxkmfgz4s3ld7g3mnybpxgan251k17"; + rev = "e64578893e60dce2b8e1ca5c2e19c678c01260f1"; + sha256 = "0ga8fgwdn36gi5d1zrark7idpq5ndqz8m7gqfymc5k2yf07nxfm1"; }; meta.homepage = "https://github.com/folke/trouble.nvim/"; }; @@ -15205,12 +15205,12 @@ final: prev: wiki-vim = buildVimPluginFrom2Nix { pname = "wiki.vim"; - version = "2023-07-20"; + version = "2023-07-25"; src = fetchFromGitHub { owner = "lervag"; repo = "wiki.vim"; - rev = "1c733d36026c4f9c9dac742c73a23f24838e6fef"; - sha256 = "01ff7cj784h2w970hmjmvhbv8f76wla3b1pnhsvrgfl2rlcf6gd9"; + rev = "4bd7d1b21a0197f11b336cefb434132b5e595dcf"; + sha256 = "176v8idcjv32q4kywdrr5xqpj849ckcdlvqybv04mhd6wcnq3xzr"; }; meta.homepage = "https://github.com/lervag/wiki.vim/"; }; @@ -15566,12 +15566,12 @@ final: prev: lspsaga-nvim-original = buildVimPluginFrom2Nix { pname = "lspsaga-nvim-original"; - version = "2023-07-24"; + version = "2023-07-25"; src = fetchFromGitHub { owner = "nvimdev"; repo = "lspsaga.nvim"; - rev = "e1e617638b08179273ab2a0161249b9ff57cee0c"; - sha256 = "158l3qicvx1fi56frn4na6yangjw66mdxdf1n682ambr62fvgcj6"; + rev = "31b4b4336d05e7c8ff0f833a493de2a2875f1b38"; + sha256 = "0m426zxd6liah3xfdnxjs289c27z31fw8r0fdw8dvnvgsbhz1a2v"; }; meta.homepage = "https://github.com/nvimdev/lspsaga.nvim/"; }; @@ -15588,6 +15588,18 @@ final: prev: meta.homepage = "https://github.com/mattn/calendar-vim/"; }; + nightfly = buildVimPluginFrom2Nix { + pname = "nightfly"; + version = "2023-07-19"; + src = fetchFromGitHub { + owner = "bluz71"; + repo = "vim-nightfly-colors"; + rev = "cd68ec3c0a3ca2bf15072dd2040401ea4b89e79f"; + sha256 = "00nfpkpv0li3wgh926azp8xf1zvdh3zc6fx5aznplhs9j6xbdx21"; + }; + meta.homepage = "https://github.com/bluz71/vim-nightfly-colors/"; + }; + nord-vim = buildVimPluginFrom2Nix { pname = "nord-vim"; version = "2023-05-03"; @@ -15602,12 +15614,12 @@ final: prev: nvchad-extensions = buildVimPluginFrom2Nix { pname = "nvchad-extensions"; - version = "2023-07-24"; + version = "2023-07-25"; src = fetchFromGitHub { owner = "nvchad"; repo = "extensions"; - rev = "16715bc45900e9771be3656c50801f751a8d9b46"; - sha256 = "1pjny541m23h4iw8b9wg6dlapa57ffzqlpws6bcsdiw6j91mcpla"; + rev = "0abb3ead8ce6ffa0e03b596a000d231b5e5d406b"; + sha256 = "13bngm38j90n21szilc27bpdzgjk4g41a6a8yz1bc60rddxxjxr3"; }; meta.homepage = "https://github.com/nvchad/extensions/"; }; From d286aef1b1b5fb771816a92e519d3b4eca0b460b Mon Sep 17 00:00:00 2001 From: Darwin Corn Date: Tue, 25 Jul 2023 10:41:26 -0700 Subject: [PATCH 24/34] vimPlugins: resolve github repository redirects --- pkgs/applications/editors/vim/plugins/generated.nix | 4 ++-- pkgs/applications/editors/vim/plugins/vim-plugin-names | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/editors/vim/plugins/generated.nix b/pkgs/applications/editors/vim/plugins/generated.nix index 7cef87bafcc0..ef7f26c0d273 100644 --- a/pkgs/applications/editors/vim/plugins/generated.nix +++ b/pkgs/applications/editors/vim/plugins/generated.nix @@ -9804,8 +9804,8 @@ final: prev: src = fetchFromGitHub { owner = "folke"; repo = "trouble.nvim"; - rev = "e64578893e60dce2b8e1ca5c2e19c678c01260f1"; - sha256 = "0ga8fgwdn36gi5d1zrark7idpq5ndqz8m7gqfymc5k2yf07nxfm1"; + rev = "fc4bb22b1d2cd5eb46fe61a9f6d6416d742beb5c"; + sha256 = "0mhhjl4q45bn0i22jqri6v3rp24d7l3k2q72ggx5i1xinxls3ap5"; }; meta.homepage = "https://github.com/folke/trouble.nvim/"; }; diff --git a/pkgs/applications/editors/vim/plugins/vim-plugin-names b/pkgs/applications/editors/vim/plugins/vim-plugin-names index e4706a7b2853..1cee9362cc6a 100644 --- a/pkgs/applications/editors/vim/plugins/vim-plugin-names +++ b/pkgs/applications/editors/vim/plugins/vim-plugin-names @@ -1093,6 +1093,7 @@ https://github.com/jistr/vim-nerdtree-tabs/,, https://github.com/nfnty/vim-nftables/,, https://github.com/kana/vim-niceblock/,, https://github.com/nickel-lang/vim-nickel/,main, +https://github.com/bluz71/vim-nightfly-colors/,,nightfly https://github.com/tommcdo/vim-ninja-feet/,, https://github.com/LnL7/vim-nix/,, https://github.com/symphorien/vim-nixhash/,, From b77627bb64753596282cf872af8479e674dc2bc7 Mon Sep 17 00:00:00 2001 From: Darwin Corn Date: Tue, 25 Jul 2023 10:41:38 -0700 Subject: [PATCH 25/34] vimPlugins.nvim-treesitter: update grammars --- .../editors/vim/plugins/nvim-treesitter/generated.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/editors/vim/plugins/nvim-treesitter/generated.nix b/pkgs/applications/editors/vim/plugins/nvim-treesitter/generated.nix index 0e582bfffbb1..fe10e57a8433 100644 --- a/pkgs/applications/editors/vim/plugins/nvim-treesitter/generated.nix +++ b/pkgs/applications/editors/vim/plugins/nvim-treesitter/generated.nix @@ -1509,12 +1509,12 @@ }; puppet = buildGrammar { language = "puppet"; - version = "0.0.0+rev=8e13a37"; + version = "0.0.0+rev=9ce9a5f"; src = fetchFromGitHub { owner = "amaanq"; repo = "tree-sitter-puppet"; - rev = "8e13a3768091703ac27ef1e5763e542af7f6dead"; - hash = "sha256-vBxCqFsSF2kwUK5uNWDPvl7F+mcD8rdTzsckcab4vUU="; + rev = "9ce9a5f7d64528572aaa8d59459ba869e634086b"; + hash = "sha256-YEjjy9WLwITERYqoeSVrRYnwVBIAwdc4o0lvAK9wizw="; }; meta.homepage = "https://github.com/amaanq/tree-sitter-puppet"; }; From 8c8d1164de84808c61a233ead50e1ee27f78a0a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 25 Jul 2023 11:18:32 -0700 Subject: [PATCH 26/34] bitwarden-cli: 2023.5.0 -> 2023.7.0 Diff: https://github.com/bitwarden/clients/compare/cli-v2023.5.0...cli-v2023.7.0 Changelog: https://github.com/bitwarden/clients/releases/tag/cli-v2023.7.0 --- pkgs/tools/security/bitwarden/cli.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/security/bitwarden/cli.nix b/pkgs/tools/security/bitwarden/cli.nix index 715811046d7a..b2953bc4c358 100644 --- a/pkgs/tools/security/bitwarden/cli.nix +++ b/pkgs/tools/security/bitwarden/cli.nix @@ -11,16 +11,16 @@ let buildNpmPackage' = buildNpmPackage.override { nodejs = nodejs_18; }; in buildNpmPackage' rec { pname = "bitwarden-cli"; - version = "2023.5.0"; + version = "2023.7.0"; src = fetchFromGitHub { owner = "bitwarden"; repo = "clients"; rev = "cli-v${version}"; - hash = "sha256-ELKpGSY4ZbgSk4vJnTiB+IOa8RQU8Ahy3A1mYsKtthU="; + hash = "sha256-Xnfjp+qRJWvxvgSODbajLxYsP2DtOYK9CXBMfIn+qwA="; }; - npmDepsHash = "sha256-G8DEYPjEP3L4s0pr5n2ZTj8kkT0E7Po1BKhZ2hUdJuY="; + npmDepsHash = "sha256-vz7erDhh3BpHNadPwIXkD2PRCnbxM7e7lE0rvBEXGyc="; nativeBuildInputs = [ python3 From 3fbcc9f0c20be9af12282fe049e0ed7028f99cd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 25 Jul 2023 11:20:13 -0700 Subject: [PATCH 27/34] bitwarden-cli: add passthru.tests --- pkgs/tools/security/bitwarden/cli.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/tools/security/bitwarden/cli.nix b/pkgs/tools/security/bitwarden/cli.nix index b2953bc4c358..446dc89bd8b7 100644 --- a/pkgs/tools/security/bitwarden/cli.nix +++ b/pkgs/tools/security/bitwarden/cli.nix @@ -5,6 +5,7 @@ , fetchFromGitHub , python3 , darwin +, nixosTests }: let @@ -36,6 +37,10 @@ in buildNpmPackage' rec { npmWorkspace = "apps/cli"; + passthru.tests = { + vaultwarden = nixosTests.vaultwarden.sqlite; + }; + meta = with lib; { changelog = "https://github.com/bitwarden/clients/releases/tag/${src.rev}"; description = "A secure and free password manager for all of your devices"; From 76c96656d4d8bc645c4045c3df231c026af2552e Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Tue, 25 Jul 2023 18:33:19 +0000 Subject: [PATCH 28/34] python310Packages.teslajsonpy: 3.9.0 -> 3.9.1 --- pkgs/development/python-modules/teslajsonpy/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/teslajsonpy/default.nix b/pkgs/development/python-modules/teslajsonpy/default.nix index d005791642ab..65d89ad175c7 100644 --- a/pkgs/development/python-modules/teslajsonpy/default.nix +++ b/pkgs/development/python-modules/teslajsonpy/default.nix @@ -17,7 +17,7 @@ buildPythonPackage rec { pname = "teslajsonpy"; - version = "3.9.0"; + version = "3.9.1"; format = "pyproject"; disabled = pythonOlder "3.7"; @@ -26,7 +26,7 @@ buildPythonPackage rec { owner = "zabuldon"; repo = pname; rev = "refs/tags/v${version}"; - hash = "sha256-6H8miS0tKB99ZkiBvqJ77NIsswJ+ivYt1VZOLwTQr24="; + hash = "sha256-6QwBXWV/oMPDogzS5+EtRP9uzySvdYtnRR4Lb5IWwh4="; }; nativeBuildInputs = [ From 59921f9ee196246caabfa15bb8e98757b0a7533c Mon Sep 17 00:00:00 2001 From: Evan Richter Date: Tue, 25 Jul 2023 14:02:56 -0500 Subject: [PATCH 29/34] gex: 0.5.0 -> 0.6.0 --- pkgs/applications/version-management/gex/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/version-management/gex/default.nix b/pkgs/applications/version-management/gex/default.nix index 4675b22a6192..5e1faa58dced 100644 --- a/pkgs/applications/version-management/gex/default.nix +++ b/pkgs/applications/version-management/gex/default.nix @@ -8,19 +8,19 @@ rustPlatform.buildRustPackage rec { pname = "gex"; - version = "0.5.0"; + version = "0.6.0"; src = fetchFromGitHub { owner = "Piturnah"; repo = pname; rev = "v${version}"; - hash = "sha256-//sQ0s8bBQzuu5aO3RjPRjFuVYiGW6BwSPoCWKAx9DQ="; + hash = "sha256-J2tmDpt4vRFgD5yfFZOdBLROvyZVEthc+MHM1Yta5jI="; }; nativeBuildInputs = [ pkg-config ]; buildInputs = [ libgit2 ]; - cargoHash = "sha256-rkhkFnRDtMTWFM+E5C4jR7TWtHdy3WUtIzvGDDLHqtE="; + cargoHash = "sha256-AsUHswR7+wMyAvOp3rkvRJvThHLH993gQ+/V38vbbNQ="; meta = with lib; { description = "Git Explorer: cross-platform git workflow improvement tool inspired by Magit"; From c93a5c8e684b41bacd2ef21cd46343b3b5fb30df Mon Sep 17 00:00:00 2001 From: Shawn8901 Date: Tue, 25 Jul 2023 21:45:04 +0200 Subject: [PATCH 30/34] teamspeak_client: 3.6.0 -> 3.6.1 --- .../networking/instant-messengers/teamspeak/client.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix index 8735870e106d..d4c5b18c5cd1 100644 --- a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix +++ b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix @@ -30,11 +30,11 @@ in stdenv.mkDerivation rec { pname = "teamspeak-client"; - version = "3.6.0"; + version = "3.6.1"; src = fetchurl { url = "https://files.teamspeak-services.com/releases/client/${version}/TeamSpeak3-Client-linux_${arch}-${version}.run"; - hash = "sha256-ZbElnFoQmXdtCR9lb6eOz4dMzSwpfjC1DvG3VbDoSEA="; + hash = "sha256-j4sgZ+tJpV6ST0yLmbLTLgBxQTcK1LZoEEfMe3TUAC4="; }; # grab the plugin sdk for the desktop icon From 827bb4b2a7578ec7f9c4f09479f6490f77648c36 Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Mon, 24 Jul 2023 21:38:48 -0400 Subject: [PATCH 31/34] hop-cli: 0.2.35 -> 0.2.52 Diff: https://github.com/hopinc/cli/compare/v0.2.35...v0.2.52 Changelog: https://github.com/hopinc/cli/releases/tag/v0.2.52 --- pkgs/tools/admin/hop-cli/default.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/admin/hop-cli/default.nix b/pkgs/tools/admin/hop-cli/default.nix index 3e06006df17c..eea6a9e73661 100644 --- a/pkgs/tools/admin/hop-cli/default.nix +++ b/pkgs/tools/admin/hop-cli/default.nix @@ -10,16 +10,16 @@ rustPlatform.buildRustPackage rec { pname = "hop-cli"; - version = "0.2.35"; + version = "0.2.52"; src = fetchFromGitHub { owner = "hopinc"; repo = "cli"; rev = "v${version}"; - hash = "sha256-TgPEcsv7/n+PzZXazozbgmX2tt4WDvyH3j6rY+M0AGE="; + hash = "sha256-xuOkW5jetl+8obeFJnbkVZa+wYWfTNiTOmcrzC8+wGE="; }; - cargoHash = "sha256-HEUsyboZQ4j5IEOqiWEBSlJqmaNDHPg1kstnM9AgZBo="; + cargoHash = "sha256-ePUlw4UzsQ2lNuJ5g5OAYh6nKTIoHdDMb34Jzuqtas8="; nativeBuildInputs = [ pkg-config @@ -33,6 +33,11 @@ rustPlatform.buildRustPackage rec { OPENSSL_NO_VENDOR = 1; + checkFlags = [ + # This test fails on read-only filesystems + "--skip=commands::volumes::utils::test::test_parse_target_from_path_like" + ]; + meta = with lib; { mainProgram = "hop"; description = "Interact with Hop in your terminal"; From 4076c4f668ca521a09262693a4f9a231a9206a88 Mon Sep 17 00:00:00 2001 From: Nikolay Korotkiy Date: Sun, 23 Jul 2023 13:58:00 +0400 Subject: [PATCH 32/34] urh: enable on unix --- pkgs/applications/radio/urh/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/radio/urh/default.nix b/pkgs/applications/radio/urh/default.nix index 3dd7a5422537..9a5d3c3cbbb1 100644 --- a/pkgs/applications/radio/urh/default.nix +++ b/pkgs/applications/radio/urh/default.nix @@ -33,7 +33,7 @@ python3Packages.buildPythonApplication rec { homepage = "https://github.com/jopohl/urh"; description = "Universal Radio Hacker: investigate wireless protocols like a boss"; license = licenses.gpl3; - platforms = platforms.linux; + platforms = platforms.unix; maintainers = with maintainers; [ fpletz ]; }; } From 781b5dfaf37da6ff955c2bcec724426a7f4d2fa2 Mon Sep 17 00:00:00 2001 From: figsoda Date: Tue, 25 Jul 2023 17:18:05 -0400 Subject: [PATCH 33/34] vimPlugins.sg-nvim: fix cargoHash --- pkgs/applications/editors/vim/plugins/overrides.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/editors/vim/plugins/overrides.nix b/pkgs/applications/editors/vim/plugins/overrides.nix index 2247f03aba51..2db6a83baa25 100644 --- a/pkgs/applications/editors/vim/plugins/overrides.nix +++ b/pkgs/applications/editors/vim/plugins/overrides.nix @@ -932,7 +932,7 @@ self: super: { pname = "sg-nvim-rust"; inherit (old) version src; - cargoHash = "sha256-wR1QIB4Qqw/b2f7XFbPytDSz/8BtaFep3BZuT0RJ3hg="; + cargoHash = "sha256-KhUCIAGSgf7TxabEzcjo582VgbSU79QSGlaEP7BbJCE="; nativeBuildInputs = [ pkg-config ]; From 259bd12f22749d188b212114a89cc70096207db4 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Tue, 25 Jul 2023 21:41:14 +0000 Subject: [PATCH 34/34] git-machete: 3.17.6 -> 3.17.8 --- pkgs/applications/version-management/git-machete/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/version-management/git-machete/default.nix b/pkgs/applications/version-management/git-machete/default.nix index 05e21b641e94..f571cee0fa45 100644 --- a/pkgs/applications/version-management/git-machete/default.nix +++ b/pkgs/applications/version-management/git-machete/default.nix @@ -12,13 +12,13 @@ buildPythonApplication rec { pname = "git-machete"; - version = "3.17.6"; + version = "3.17.8"; src = fetchFromGitHub { owner = "virtuslab"; repo = pname; rev = "v${version}"; - hash = "sha256-o3Z1xPu5RcspU4m3Bb6ydZkXOMgOMJPN/+TLekwe/wI="; + hash = "sha256-d1vbLlGKln/zcuuKZgNOcu/z15co3p8ecrwL5lucIEk="; }; nativeBuildInputs = [ installShellFiles ];