From 059696a890221d2a5b1c71c744d9bbf711d12252 Mon Sep 17 00:00:00 2001 From: hacker1024 Date: Fri, 16 Aug 2024 11:34:54 +1000 Subject: [PATCH 01/36] python310Packages.tensorflow-bin: Add Jetson source --- pkgs/development/python-modules/tensorflow/binary-hashes.nix | 5 +++++ pkgs/development/python-modules/tensorflow/prefetcher.sh | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/pkgs/development/python-modules/tensorflow/binary-hashes.nix b/pkgs/development/python-modules/tensorflow/binary-hashes.nix index 53cff3494dea..2a6a31b540b2 100644 --- a/pkgs/development/python-modules/tensorflow/binary-hashes.nix +++ b/pkgs/development/python-modules/tensorflow/binary-hashes.nix @@ -1,5 +1,6 @@ { version = "2.17.0"; + version_jetson = "2.16.1+nv24.07"; x86_64-linux_39 = { url = "https://storage.googleapis.com/tensorflow/versions/2.17.0/tensorflow_cpu-2.17.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"; sha256 = "1aacn68b88bnnmpl1q0irih0avzm2lfyhwr3wldg144n5zljlrbx"; @@ -48,6 +49,10 @@ url = "https://storage.googleapis.com/tensorflow/versions/2.17.0/tensorflow-2.17.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl"; sha256 = "1zrscms9qkfpiscnl8c7ibfipwpw8jrdfvwh4wb69p9rxvqgxbbj"; }; + aarch64-linux_310_jetson = { + url = "https://developer.download.nvidia.com/compute/redist/jp/v60/tensorflow/tensorflow-2.16.1+nv24.07-cp310-cp310-linux_aarch64.whl"; + sha256 = "1ymdknl5v41z6z0wg068diici30am8vysg6b6sqxr8w6yk4aib42"; + }; aarch64-darwin_39 = { url = "https://storage.googleapis.com/tensorflow/versions/2.17.0/tensorflow-2.17.0-cp39-cp39-macosx_12_0_arm64.whl"; sha256 = "01a3hjnrgjp2i0ciwyy0gki41cy32prvjhr20zhlcjwbssarxy4p"; diff --git a/pkgs/development/python-modules/tensorflow/prefetcher.sh b/pkgs/development/python-modules/tensorflow/prefetcher.sh index b0ad86eccab8..912977ecc42a 100755 --- a/pkgs/development/python-modules/tensorflow/prefetcher.sh +++ b/pkgs/development/python-modules/tensorflow/prefetcher.sh @@ -1,8 +1,10 @@ #!/usr/bin/env bash version="2.17.0" +version_jetson="2.16.1+nv24.07" bucket="https://storage.googleapis.com/tensorflow/versions/${version}" +bucket_jetson="https://developer.download.nvidia.com/compute/redist/jp/v60/tensorflow" # List of binary wheels for Tensorflow. The most recent versions can be found # on the following page: @@ -20,6 +22,7 @@ url_and_key_list=( "aarch64-linux_310 $bucket/tensorflow-${version}-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl" "aarch64-linux_311 $bucket/tensorflow-${version}-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl" "aarch64-linux_312 $bucket/tensorflow-${version}-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl" +"aarch64-linux_310_jetson $bucket_jetson/tensorflow-${version_jetson}-cp310-cp310-linux_aarch64.whl" "aarch64-darwin_39 $bucket/tensorflow-${version}-cp39-cp39-macosx_12_0_arm64.whl" "aarch64-darwin_310 $bucket/tensorflow-${version}-cp310-cp310-macosx_12_0_arm64.whl" "aarch64-darwin_311 $bucket/tensorflow-${version}-cp311-cp311-macosx_12_0_arm64.whl" @@ -30,6 +33,7 @@ hashfile=binary-hashes.nix rm -f $hashfile echo "{" >> $hashfile echo "version = \"$version\";" >> $hashfile +echo "version_jetson = \"$version_jetson\";" >> $hashfile for url_and_key in "${url_and_key_list[@]}"; do key=$(echo "$url_and_key" | cut -d' ' -f1) From 3aa424743f6824bcdfe4b6d469e3342d6c03563d Mon Sep 17 00:00:00 2001 From: hacker1024 Date: Fri, 16 Aug 2024 11:35:00 +1000 Subject: [PATCH 02/36] python310Packages.tensorflow-bin: Allow building for Jetsons --- .../python-modules/tensorflow/bin.nix | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/tensorflow/bin.nix b/pkgs/development/python-modules/tensorflow/bin.nix index 140a77942dab..5b816bee894c 100644 --- a/pkgs/development/python-modules/tensorflow/bin.nix +++ b/pkgs/development/python-modules/tensorflow/bin.nix @@ -20,6 +20,7 @@ distutils, wheel, jax, + ml-dtypes, opt-einsum, tensorflow-estimator-bin, tensorboard, @@ -38,9 +39,10 @@ typing-extensions, }: -# We keep this binary build for two reasons: +# We keep this binary build for three reasons: # - the source build doesn't work on Darwin. # - the source build is currently brittle and not easy to maintain +# - the source build doesn't work on NVIDIA Jetson platforms # unsupported combination assert !(stdenv.isDarwin && cudaSupport); @@ -49,19 +51,19 @@ let packages = import ./binary-hashes.nix; inherit (cudaPackages) cudatoolkit cudnn; in -buildPythonPackage { +buildPythonPackage rec { pname = "tensorflow" + lib.optionalString cudaSupport "-gpu"; - inherit (packages) version; + version = packages."${"version" + lib.optionalString (cudaSupport && cudaPackages.cudaFlags.isJetsonBuild) "_jetson"}"; format = "wheel"; src = let pyVerNoDot = lib.strings.stringAsChars (x: lib.optionalString (x != ".") x) python.pythonVersion; platform = stdenv.system; - cuda = lib.optionalString cudaSupport "_gpu"; + cuda = lib.optionalString cudaSupport (if cudaPackages.cudaFlags.isJetsonBuild then "_jetson" else "_gpu"); key = "${platform}_${pyVerNoDot}${cuda}"; in - fetchurl (packages.${key} or (throw "tensoflow-bin: unsupported system: ${stdenv.system}")); + fetchurl (packages.${key} or (throw "tensoflow-bin: unsupported configuration: ${key}")); buildInputs = [ llvmPackages.openmp ]; @@ -73,7 +75,7 @@ buildPythonPackage { protobuf numpy scipy - jax + (if !cudaPackages.cudaFlags.isJetsonBuild then jax else ml-dtypes) termcolor grpcio six @@ -103,6 +105,10 @@ buildPythonPackage { pushd dist + for f in tensorflow-*+nv*.whl; do + mv "$f" "$(sed -E 's/(nv[0-9]+)\.0*([0-9]+)/\1.\2/' <<< "$f")" + done + wheel unpack --dest unpacked ./*.whl rm ./*.whl ( @@ -134,11 +140,12 @@ buildPythonPackage { postFixup = let # rpaths we only need to add if CUDA is enabled. - cudapaths = lib.optionals cudaSupport [ + cudapaths = lib.optionals cudaSupport ([ cudatoolkit.out cudatoolkit.lib + ] ++ lib.optionals (!cudaPackages.cudaFlags.isJetsonBuild) [ cudnn - ]; + ]); libpaths = [ stdenv.cc.cc.lib From a5fcc930b44cb11589ed4995aede3082f641d249 Mon Sep 17 00:00:00 2001 From: hacker1024 Date: Fri, 16 Aug 2024 11:35:02 +1000 Subject: [PATCH 03/36] python310Packages.geoip2: Disable TestAsyncClient for Python 3.10 as well --- pkgs/development/python-modules/geoip2/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/geoip2/default.nix b/pkgs/development/python-modules/geoip2/default.nix index b4a458327587..45b9545397ab 100644 --- a/pkgs/development/python-modules/geoip2/default.nix +++ b/pkgs/development/python-modules/geoip2/default.nix @@ -48,7 +48,7 @@ buildPythonPackage rec { pythonImportsCheck = [ "geoip2" ]; disabledTests = - lib.optionals (pythonAtLeast "3.11") [ + lib.optionals (pythonAtLeast "3.10") [ # https://github.com/maxmind/GeoIP2-python/pull/136 "TestAsyncClient" ] From 4aa67c9517ceada7f94e531ecec6899f938f12f4 Mon Sep 17 00:00:00 2001 From: hacker1024 Date: Fri, 16 Aug 2024 14:11:15 +1000 Subject: [PATCH 04/36] python311Packages.tensorflow-bin: Use CUDA 12 --- pkgs/development/python-modules/tensorflow/bin.nix | 5 ++--- pkgs/top-level/python-packages.nix | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/tensorflow/bin.nix b/pkgs/development/python-modules/tensorflow/bin.nix index 5b816bee894c..8e8fb14c5ff6 100644 --- a/pkgs/development/python-modules/tensorflow/bin.nix +++ b/pkgs/development/python-modules/tensorflow/bin.nix @@ -140,12 +140,11 @@ buildPythonPackage rec { postFixup = let # rpaths we only need to add if CUDA is enabled. - cudapaths = lib.optionals cudaSupport ([ + cudapaths = lib.optionals cudaSupport [ cudatoolkit.out cudatoolkit.lib - ] ++ lib.optionals (!cudaPackages.cudaFlags.isJetsonBuild) [ cudnn - ]); + ]; libpaths = [ stdenv.cc.cc.lib diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 4c3fb9e6b5e2..0659918bfd9a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -15392,7 +15392,7 @@ self: super: with self; { tensorflow-bin = callPackage ../development/python-modules/tensorflow/bin.nix { inherit (pkgs.config) cudaSupport; # https://www.tensorflow.org/install/source#gpu - cudaPackages = pkgs.cudaPackages_11; + cudaPackages = pkgs.cudaPackages_12; }; tensorflow-build = let From 90b1b8d60c65d253bc5e373ffd9657c032aaf913 Mon Sep 17 00:00:00 2001 From: hacker1024 Date: Fri, 16 Aug 2024 14:21:55 +1000 Subject: [PATCH 05/36] python311Packages.tensorflow-bin: Remove redundant rec --- pkgs/development/python-modules/tensorflow/bin.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/tensorflow/bin.nix b/pkgs/development/python-modules/tensorflow/bin.nix index 8e8fb14c5ff6..a1849bcb53e2 100644 --- a/pkgs/development/python-modules/tensorflow/bin.nix +++ b/pkgs/development/python-modules/tensorflow/bin.nix @@ -51,7 +51,7 @@ let packages = import ./binary-hashes.nix; inherit (cudaPackages) cudatoolkit cudnn; in -buildPythonPackage rec { +buildPythonPackage { pname = "tensorflow" + lib.optionalString cudaSupport "-gpu"; version = packages."${"version" + lib.optionalString (cudaSupport && cudaPackages.cudaFlags.isJetsonBuild) "_jetson"}"; format = "wheel"; From cc47f00391200ee643a28fb3c91dfec20f213063 Mon Sep 17 00:00:00 2001 From: hacker1024 Date: Fri, 16 Aug 2024 14:51:38 +1000 Subject: [PATCH 06/36] python3Packages.tensorflow-bin: Use cuda_compat on Jetsons --- pkgs/development/python-modules/tensorflow/bin.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/tensorflow/bin.nix b/pkgs/development/python-modules/tensorflow/bin.nix index a1849bcb53e2..9b3ee33e1977 100644 --- a/pkgs/development/python-modules/tensorflow/bin.nix +++ b/pkgs/development/python-modules/tensorflow/bin.nix @@ -95,7 +95,8 @@ buildPythonPackage { build-system = [ distutils wheel - ] ++ lib.optionals cudaSupport [ addDriverRunpath ]; + ] ++ lib.optionals cudaSupport ([ addDriverRunpath ] + ++ lib.optionals cudaPackages.cudaFlags.isJetsonBuild [ cudaPackages.autoAddCudaCompatRunpath ]); preConfigure = '' unset SOURCE_DATE_EPOCH From 9e9a1f737d0252a1a51424749c3949be832f47df Mon Sep 17 00:00:00 2001 From: Audrey Dutcher Date: Fri, 16 Aug 2024 14:21:49 -0700 Subject: [PATCH 07/36] freebsd: Add upstream patch fixing obscure c++98 interaction https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=276738#c12 Using _Static_assert under -std=c++98 -pedantic-errors will fail in FreeBSD 14.1. This fixes that, allowing software like gbenchmark to run its tests against legacy c++ standards. This patch is pending for FreeBSD 14.2, and should be removed for that release. --- .../14.1/sys-cdefs-static-assert.patch | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 pkgs/os-specific/bsd/freebsd/patches/14.1/sys-cdefs-static-assert.patch diff --git a/pkgs/os-specific/bsd/freebsd/patches/14.1/sys-cdefs-static-assert.patch b/pkgs/os-specific/bsd/freebsd/patches/14.1/sys-cdefs-static-assert.patch new file mode 100644 index 000000000000..b5a054f124d3 --- /dev/null +++ b/pkgs/os-specific/bsd/freebsd/patches/14.1/sys-cdefs-static-assert.patch @@ -0,0 +1,41 @@ +From 22cdafe197ac960c5ce839ef6ec699b59f4b0080 Mon Sep 17 00:00:00 2001 +From: Warner Losh +Date: Sat, 20 Jul 2024 09:57:53 -0600 +Subject: cdefs.h: Don't define fallback for _Static_assert + +Remove pre 4.6 code to define _Static_assert in terms of _COUNTER. We +no longer need to support compilers this old (in fact support for all +pre gcc 10 compilers has been removed in -current). This is a partial +MFC of that work because removing this fixes a bug that's oft reported +with -pedantic-errors and C++98 compilations. + +PR: 280382, 276738 +Sponsored by: Netflix + +This is a direct commit to stable/14. +--- + sys/sys/cdefs.h | 9 --------- + 1 file changed, 9 deletions(-) + +diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h +index 19b7d8fe427d..a52864c5db9d 100644 +--- a/sys/sys/cdefs.h ++++ b/sys/sys/cdefs.h +@@ -277,15 +277,6 @@ + #if (defined(__cplusplus) && __cplusplus >= 201103L) || \ + __has_extension(cxx_static_assert) + #define _Static_assert(x, y) static_assert(x, y) +-#elif __GNUC_PREREQ__(4,6) && !defined(__cplusplus) +-/* Nothing, gcc 4.6 and higher has _Static_assert built-in */ +-#elif defined(__COUNTER__) +-#define _Static_assert(x, y) __Static_assert(x, __COUNTER__) +-#define __Static_assert(x, y) ___Static_assert(x, y) +-#define ___Static_assert(x, y) typedef char __assert_ ## y[(x) ? 1 : -1] \ +- __unused +-#else +-#define _Static_assert(x, y) struct __hack + #endif + #endif + +-- +cgit v1.2.3 From 2c66c45cf39a298971a6237bd818eeeec46beb97 Mon Sep 17 00:00:00 2001 From: Audrey Dutcher Date: Fri, 16 Aug 2024 14:13:52 -0700 Subject: [PATCH 08/36] gbenchmark: mark support for FreeBSD --- pkgs/development/libraries/gbenchmark/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/gbenchmark/default.nix b/pkgs/development/libraries/gbenchmark/default.nix index d8666d92cf3e..16d4d28219db 100644 --- a/pkgs/development/libraries/gbenchmark/default.nix +++ b/pkgs/development/libraries/gbenchmark/default.nix @@ -40,7 +40,7 @@ stdenv.mkDerivation rec { description = "Microbenchmark support library"; homepage = "https://github.com/google/benchmark"; license = licenses.asl20; - platforms = platforms.linux ++ platforms.darwin; + platforms = platforms.linux ++ platforms.darwin ++ platforms.freebsd; maintainers = with maintainers; [ abbradar ]; }; } From cca503598d7170dff2dea80cc3a6e3f815ade0b8 Mon Sep 17 00:00:00 2001 From: hacker1024 Date: Thu, 22 Aug 2024 10:53:42 +1000 Subject: [PATCH 09/36] python3Packages.tensorflow-bin: Explain wheel rename on Jetsons --- pkgs/development/python-modules/tensorflow/bin.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/python-modules/tensorflow/bin.nix b/pkgs/development/python-modules/tensorflow/bin.nix index 9b3ee33e1977..8bfd2b2c86ca 100644 --- a/pkgs/development/python-modules/tensorflow/bin.nix +++ b/pkgs/development/python-modules/tensorflow/bin.nix @@ -107,6 +107,7 @@ buildPythonPackage { pushd dist for f in tensorflow-*+nv*.whl; do + # e.g. *nv24.07* -> *nv24.7* mv "$f" "$(sed -E 's/(nv[0-9]+)\.0*([0-9]+)/\1.\2/' <<< "$f")" done From f2a4ee0a3e437e9a63b9699221b8f2bc7d573a35 Mon Sep 17 00:00:00 2001 From: hacker1024 Date: Thu, 22 Aug 2024 11:03:37 +1000 Subject: [PATCH 10/36] python3Packages.tensorflow-bin: Simplify CUDA platform branching --- .../python-modules/tensorflow/bin.nix | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/tensorflow/bin.nix b/pkgs/development/python-modules/tensorflow/bin.nix index 8bfd2b2c86ca..b0371e7a20f2 100644 --- a/pkgs/development/python-modules/tensorflow/bin.nix +++ b/pkgs/development/python-modules/tensorflow/bin.nix @@ -50,17 +50,20 @@ assert !(stdenv.isDarwin && cudaSupport); let packages = import ./binary-hashes.nix; inherit (cudaPackages) cudatoolkit cudnn; + + isCudaJetson = cudaSupport && cudaPackages.cudaFlags.isJetsonBuild; + isCudaX64 = cudaSupport && stdenv.hostPlatform.isx86_64; in buildPythonPackage { pname = "tensorflow" + lib.optionalString cudaSupport "-gpu"; - version = packages."${"version" + lib.optionalString (cudaSupport && cudaPackages.cudaFlags.isJetsonBuild) "_jetson"}"; + version = packages."${"version" + lib.optionalString isCudaJetson "_jetson"}"; format = "wheel"; src = let pyVerNoDot = lib.strings.stringAsChars (x: lib.optionalString (x != ".") x) python.pythonVersion; platform = stdenv.system; - cuda = lib.optionalString cudaSupport (if cudaPackages.cudaFlags.isJetsonBuild then "_jetson" else "_gpu"); + cuda = lib.optionalString cudaSupport (if isCudaJetson then "_jetson" else "_gpu"); key = "${platform}_${pyVerNoDot}${cuda}"; in fetchurl (packages.${key} or (throw "tensoflow-bin: unsupported configuration: ${key}")); @@ -75,7 +78,7 @@ buildPythonPackage { protobuf numpy scipy - (if !cudaPackages.cudaFlags.isJetsonBuild then jax else ml-dtypes) + (if isCudaX64 then jax else ml-dtypes) termcolor grpcio six @@ -92,11 +95,13 @@ buildPythonPackage { h5py ] ++ lib.optional (!isPy3k) mock; - build-system = [ - distutils - wheel - ] ++ lib.optionals cudaSupport ([ addDriverRunpath ] - ++ lib.optionals cudaPackages.cudaFlags.isJetsonBuild [ cudaPackages.autoAddCudaCompatRunpath ]); + build-system = + [ + distutils + wheel + ] + ++ lib.optionals cudaSupport [ addDriverRunpath ] + ++ lib.optionals isCudaJetson [ cudaPackages.autoAddCudaCompatRunpath ]; preConfigure = '' unset SOURCE_DATE_EPOCH From 1b52ef11fe8822a19d1257f9b49fa5632f585002 Mon Sep 17 00:00:00 2001 From: Daniel Britten Date: Fri, 6 Sep 2024 17:57:47 +1200 Subject: [PATCH 11/36] lean4: 4.9.0 -> 4.9.1 --- pkgs/applications/science/logic/lean4/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/science/logic/lean4/default.nix b/pkgs/applications/science/logic/lean4/default.nix index 81be0baf5cde..f4ed711e2c89 100644 --- a/pkgs/applications/science/logic/lean4/default.nix +++ b/pkgs/applications/science/logic/lean4/default.nix @@ -10,13 +10,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "lean4"; - version = "4.9.0"; + version = "4.9.1"; src = fetchFromGitHub { owner = "leanprover"; repo = "lean4"; rev = "v${finalAttrs.version}"; - hash = "sha256-wi7outnKpz60to6Z7MSGAKK6COxmpJo6iu6Re86jqlo="; + hash = "sha256-C3N56f3mT+5f149T1BIYQil2UleAWmnRYLqUq4zcLgs="; }; postPatch = '' @@ -53,6 +53,7 @@ stdenv.mkDerivation (finalAttrs: { passthru.tests = { version = testers.testVersion { package = finalAttrs.finalPackage; + version = "v${finalAttrs.version}"; }; }; From b4cc989874b7bc35e98458c66eaae7a50bc06867 Mon Sep 17 00:00:00 2001 From: TudbuT Date: Fri, 6 Sep 2024 23:30:29 +0200 Subject: [PATCH 12/36] spl: init at v0.3.2 https://git.tudbut.de/tudbut/spl - a scripting language --- pkgs/by-name/sp/spl/package.nix | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 pkgs/by-name/sp/spl/package.nix diff --git a/pkgs/by-name/sp/spl/package.nix b/pkgs/by-name/sp/spl/package.nix new file mode 100644 index 000000000000..60204b378ae4 --- /dev/null +++ b/pkgs/by-name/sp/spl/package.nix @@ -0,0 +1,24 @@ +{ + lib, + fetchgit, + rustPlatform, +}: +rustPlatform.buildRustPackage rec { + pname = "spl"; + version = "0.3.2"; + src = fetchgit { + url = "https://git.tudbut.de/tudbut/spl"; + rev = "v${version}"; + hash = "sha256-thTKM07EtgAVvjpIx8pVssTmN0jPK/OrPYhRfwp7T+U="; + }; + + cargoHash = "sha256-7MYwWA3F7uJewmBRR0iQD4iXJZokHqIt9Q9dMoj6JVs="; + + meta = { + description = "Simple, concise, concatenative scripting language"; + homepage = "https://git.tudbut.de/tudbut/spl"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ tudbut ]; + mainProgram = "spl"; + }; +} From 5567f3ace542430b99023bb5363f13db1b7b3302 Mon Sep 17 00:00:00 2001 From: K900 Date: Sat, 14 Sep 2024 20:16:11 +0300 Subject: [PATCH 13/36] deviceTree.applyOverlays: rewrite in Python/libfdt Pros: - code you can actually read - compatible strings handled properly - no shelling out to what's essentially test tools Cons: - Python --- .../linux/device-tree/apply_overlays.py | 102 ++++++++++++++++++ .../os-specific/linux/device-tree/default.nix | 42 ++------ 2 files changed, 108 insertions(+), 36 deletions(-) create mode 100644 pkgs/os-specific/linux/device-tree/apply_overlays.py diff --git a/pkgs/os-specific/linux/device-tree/apply_overlays.py b/pkgs/os-specific/linux/device-tree/apply_overlays.py new file mode 100644 index 000000000000..307c00fa7863 --- /dev/null +++ b/pkgs/os-specific/linux/device-tree/apply_overlays.py @@ -0,0 +1,102 @@ +from argparse import ArgumentParser +from dataclasses import dataclass +from functools import cached_property +import json +from pathlib import Path + +from libfdt import Fdt, FdtException, FDT_ERR_NOSPACE, fdt_overlay_apply + + +@dataclass +class Overlay: + name: str + filter: str + dtbo_file: Path + + @cached_property + def fdt(self): + with self.dtbo_file.open("rb") as fd: + return Fdt(fd.read()) + + @cached_property + def compatible(self): + return get_compatible(self.fdt) + + +def get_compatible(fdt): + root_offset = fdt.path_offset("/") + return set(fdt.getprop(root_offset, "compatible").as_stringlist()) + + +def apply_overlay(dt: Fdt, dto: Fdt) -> Fdt: + while True: + # we need to copy the buffers because they can be left in an inconsistent state + # if the operation fails (ref: fdtoverlay source) + result = dt.as_bytearray().copy() + err = fdt_overlay_apply(result, dto.as_bytearray().copy()) + + if err == 0: + new_dt = Fdt(result) + # trim the extra space from the final tree + new_dt.pack() + return new_dt + + if err == -FDT_ERR_NOSPACE: + # not enough space, add some blank space and try again + # magic number of more space taken from fdtoverlay + dt.resize(dt.totalsize() + 65536) + continue + + raise FdtException(err) + +def main(): + parser = ArgumentParser(description='Apply a list of overlays to a directory of device trees') + parser.add_argument("--source", type=Path, help="Source directory") + parser.add_argument("--destination", type=Path, help="Destination directory") + parser.add_argument("--overlays", type=Path, help="JSON file with overlay descriptions") + args = parser.parse_args() + + source: Path = args.source + destination: Path = args.destination + overlays: Path = args.overlays + + with overlays.open() as fd: + overlays_data = [ + Overlay( + name=item["name"], + filter=item["filter"], + dtbo_file=Path(item["dtboFile"]), + ) + for item in json.load(fd) + ] + + for source_dt in source.glob("**/*.dtb"): + rel_path = source_dt.relative_to(source) + + print(f"Processing source device tree {rel_path}...") + with source_dt.open("rb") as fd: + dt = Fdt(fd.read()) + + dt_compatible = get_compatible(dt) + + for overlay in overlays_data: + if overlay.filter and overlay.filter not in str(rel_path): + print(f" Skipping overlay {overlay.name}: filter does not match") + continue + + if not overlay.compatible.intersection(dt_compatible): + print(f" Skipping overlay {overlay.name}: {overlay.compatible} is incompatible with {dt_compatible}") + continue + + print(f" Applying overlay {overlay.name}") + dt = apply_overlay(dt, overlay.fdt) + + print(f"Saving final device tree {rel_path}...") + dest_path = destination / rel_path + dest_path.parent.mkdir(parents=True, exist_ok=True) + with dest_path.open("wb") as fd: + fd.write(dt.as_bytearray()) + + +if __name__ == '__main__': + main() diff --git a/pkgs/os-specific/linux/device-tree/default.nix b/pkgs/os-specific/linux/device-tree/default.nix index 87c9b84e1240..b8c71cc5a8ae 100644 --- a/pkgs/os-specific/linux/device-tree/default.nix +++ b/pkgs/os-specific/linux/device-tree/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, stdenvNoCC, dtc }: +{ lib, stdenv, stdenvNoCC, dtc, writers, python3 }: { # Compile single Device Tree overlay source @@ -26,41 +26,11 @@ applyOverlays = (base: overlays': stdenvNoCC.mkDerivation { name = "device-tree-overlays"; - nativeBuildInputs = [ dtc ]; - buildCommand = let - overlays = lib.toList overlays'; - in '' - mkdir -p $out - cd "${base}" - find -L . -type f -name '*.dtb' -print0 \ - | xargs -0 cp -v --no-preserve=mode --target-directory "$out" --parents - - for dtb in $(find "$out" -type f -name '*.dtb'); do - dtbCompat=$(fdtget -t s "$dtb" / compatible 2>/dev/null || true) - # skip files without `compatible` string - test -z "$dtbCompat" && continue - - ${lib.flip (lib.concatMapStringsSep "\n") overlays (o: '' - overlayCompat="$(fdtget -t s "${o.dtboFile}" / compatible)" - - # skip incompatible and non-matching overlays - if [[ ! "$dtbCompat" =~ "$overlayCompat" ]]; then - echo "Skipping overlay ${o.name}: incompatible with $(basename "$dtb")" - elif ${if (o.filter == null) then "false" else '' - [[ "''${dtb//${o.filter}/}" == "$dtb" ]] - ''} - then - echo "Skipping overlay ${o.name}: filter does not match $(basename "$dtb")" - else - echo -n "Applying overlay ${o.name} to $(basename "$dtb")... " - mv "$dtb"{,.in} - fdtoverlay -o "$dtb" -i "$dtb.in" "${o.dtboFile}" - echo "ok" - rm "$dtb.in" - fi - '')} - - done + nativeBuildInputs = [ + (python3.pythonOnBuildForHost.withPackages(ps: [ps.libfdt])) + ]; + buildCommand = '' + python ${./apply_overlays.py} --source ${base} --destination $out --overlays ${writers.writeJSON "overlays.json" overlays'} ''; }); } From b7e0e296fdefd14787eed3113d8ee0a595129254 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Tue, 17 Sep 2024 23:35:50 +0000 Subject: [PATCH 14/36] werf: 2.10.5 -> 2.10.6 --- pkgs/by-name/we/werf/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/we/werf/package.nix b/pkgs/by-name/we/werf/package.nix index 4eb34b1cf124..aa914fdd8f7a 100644 --- a/pkgs/by-name/we/werf/package.nix +++ b/pkgs/by-name/we/werf/package.nix @@ -11,13 +11,13 @@ buildGoModule rec { pname = "werf"; - version = "2.10.5"; + version = "2.10.6"; src = fetchFromGitHub { owner = "werf"; repo = "werf"; rev = "v${version}"; - hash = "sha256-pNKcBiZSZa8F8E5grEXbgPpqk9H+mu/TeiU3FSAalQE="; + hash = "sha256-TVjmPylomSp8WT2YW6x6CPkk6FinKGrGRlDEAtl8vRI="; }; vendorHash = "sha256-OR2nIR2q3iRfaSQSQRKn+jbygETx2+WmkOIjOCIB9O8="; From 118a6b2e7d785e10beb8e523953b95bfb3005c01 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 18 Sep 2024 03:23:48 +0000 Subject: [PATCH 15/36] termius: 9.5.0 -> 9.6.1 --- pkgs/applications/networking/termius/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/networking/termius/default.nix b/pkgs/applications/networking/termius/default.nix index 79ffd109e52d..487b13e55705 100644 --- a/pkgs/applications/networking/termius/default.nix +++ b/pkgs/applications/networking/termius/default.nix @@ -15,8 +15,8 @@ stdenv.mkDerivation rec { pname = "termius"; - version = "9.5.0"; - revision = "203"; + version = "9.6.1"; + revision = "204"; src = fetchurl { # find the latest version with @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { # and the sha512 with # curl -H 'X-Ubuntu-Series: 16' https://api.snapcraft.io/api/v1/snaps/details/termius-app | jq '.download_sha512' -r url = "https://api.snapcraft.io/api/v1/snaps/download/WkTBXwoX81rBe3s3OTt3EiiLKBx2QhuS_${revision}.snap"; - hash = "sha512-BouIQvJZbi350l30gl9fnXKYRHhi5q1oOvyEIVEmd4DjXvJLQisV4cK4OZIJ/bPOCI5DTxNOY7PwEduVQd3SYA=="; + hash = "sha512-ok3B/h+d0Q7k5i+IjgGB+4S5g2kzrQT/b4dYz4k07OnyfjJRgJ4X4f7BFFrwKLd+IbIC5OIibrvivWnkSWU3Ew=="; }; desktopItem = makeDesktopItem { From 2d182775317802a15d62d33c2bd948df0b02e351 Mon Sep 17 00:00:00 2001 From: jecaro Date: Wed, 18 Sep 2024 14:42:16 +0200 Subject: [PATCH 16/36] vimPlugins.vim-jjdescription: init at 2024-05-28 --- pkgs/applications/editors/vim/plugins/generated.nix | 12 ++++++++++++ .../editors/vim/plugins/vim-plugin-names | 1 + 2 files changed, 13 insertions(+) diff --git a/pkgs/applications/editors/vim/plugins/generated.nix b/pkgs/applications/editors/vim/plugins/generated.nix index 55db14c1d0e3..831ad9ec0dcc 100644 --- a/pkgs/applications/editors/vim/plugins/generated.nix +++ b/pkgs/applications/editors/vim/plugins/generated.nix @@ -14334,6 +14334,18 @@ final: prev: meta.homepage = "https://github.com/seirl/vim-jinja-languages/"; }; + vim-jjdescription = buildVimPlugin { + pname = "vim-jjdescription"; + version = "2024-05-28"; + src = fetchFromGitHub { + owner = "avm99963"; + repo = "vim-jjdescription"; + rev = "ca14325202f3cd894d01ba833451017624249222"; + sha256 = "1y83fdih991ivlvgcwp0sx97icmf9k6px7mr26vb77izjlf011w2"; + }; + meta.homepage = "https://github.com/avm99963/vim-jjdescription/"; + }; + vim-jsbeautify = buildVimPlugin { pname = "vim-jsbeautify"; version = "2020-12-11"; diff --git a/pkgs/applications/editors/vim/plugins/vim-plugin-names b/pkgs/applications/editors/vim/plugins/vim-plugin-names index 59fa8a6ece60..5a9216f863f4 100644 --- a/pkgs/applications/editors/vim/plugins/vim-plugin-names +++ b/pkgs/applications/editors/vim/plugins/vim-plugin-names @@ -1207,6 +1207,7 @@ https://github.com/pangloss/vim-javascript/,, https://github.com/jelera/vim-javascript-syntax/,, https://github.com/lepture/vim-jinja/,, https://github.com/seirl/vim-jinja-languages/,HEAD, +https://github.com/avm99963/vim-jjdescription/,HEAD, https://github.com/maksimr/vim-jsbeautify/,, https://github.com/heavenshell/vim-jsdoc/,, https://github.com/elzr/vim-json/,, From 9008265a35b80a88a93871e28cc8241f45407a29 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 18 Sep 2024 13:09:24 +0000 Subject: [PATCH 17/36] lazygit: 0.44.0 -> 0.44.1 --- pkgs/by-name/la/lazygit/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/la/lazygit/package.nix b/pkgs/by-name/la/lazygit/package.nix index 6d3e74a04758..c9ccf34d2e40 100644 --- a/pkgs/by-name/la/lazygit/package.nix +++ b/pkgs/by-name/la/lazygit/package.nix @@ -7,13 +7,13 @@ }: buildGoModule rec { pname = "lazygit"; - version = "0.44.0"; + version = "0.44.1"; src = fetchFromGitHub { owner = "jesseduffield"; repo = pname; rev = "v${version}"; - hash = "sha256-bJ2wdS0BCAGjfbnMoQSUhw/xAkC5HPRklefXx2ux078="; + hash = "sha256-BP5PMgRq8LHLuUYDrWaX1PgfT9VEhj3xeLE2aDMAPF0="; }; vendorHash = null; From 0b8f6029b66b54ff558eafbe94ecf6c0d8f5e750 Mon Sep 17 00:00:00 2001 From: zi3m5f <113244000+zi3m5f@users.noreply.github.com> Date: Wed, 18 Sep 2024 18:13:31 +0200 Subject: [PATCH 18/36] lunatask: add update script Add python update script which parses latest version from atom feed and calls `update-source-version`. Additionally set meta.changelog url. Tested with `nix-shell maintainers/scripts/update.nix --argstr package lunatask`. --- pkgs/applications/misc/lunatask/default.nix | 3 +++ pkgs/applications/misc/lunatask/update.py | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100755 pkgs/applications/misc/lunatask/update.py diff --git a/pkgs/applications/misc/lunatask/default.nix b/pkgs/applications/misc/lunatask/default.nix index dda7343d25e1..8850ec597fee 100644 --- a/pkgs/applications/misc/lunatask/default.nix +++ b/pkgs/applications/misc/lunatask/default.nix @@ -24,6 +24,8 @@ appimageTools.wrapType2 rec { --replace 'Exec=AppRun' 'Exec=${pname}' ''; + passthru.updateScript = ./update.py; + meta = with lib; { description = "All-in-one encrypted todo list, notebook, habit and mood tracker, pomodoro timer, and journaling app"; longDescription = '' @@ -31,6 +33,7 @@ appimageTools.wrapType2 rec { ''; homepage = "https://lunatask.app"; downloadPage = "https://lunatask.app/download"; + changelog = "https://lunatask.app/releases/${version}"; license = licenses.unfree; sourceProvenance = with sourceTypes; [ binaryNativeCode ]; maintainers = with maintainers; [ henkery ]; diff --git a/pkgs/applications/misc/lunatask/update.py b/pkgs/applications/misc/lunatask/update.py new file mode 100755 index 000000000000..128b7e78fbaf --- /dev/null +++ b/pkgs/applications/misc/lunatask/update.py @@ -0,0 +1,18 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i python --packages python3 python3Packages.feedparser common-updater-scripts +""" +Parses the latest version from atom feed and runs update-source-version +""" + +import subprocess +import feedparser + +URL = "https://lunatask.app/releases/atom.xml" + +feed = feedparser.parse(URL) + +latest_entry = feed.entries[0] + +latest_version = latest_entry.title.split()[-1].lstrip("v") + +subprocess.run(["update-source-version", "lunatask", latest_version], check=True) From 310f0ae4d5d6822a7a5c055953d85d47e931a27c Mon Sep 17 00:00:00 2001 From: Robert Rose Date: Wed, 18 Sep 2024 18:59:52 +0200 Subject: [PATCH 19/36] nixos/k3s: replace deprecated extra flag in usage example The previously used `--kubelet-arg=v=4` extra flag causes k3s to crash with `Error: initialize logging: the logging configuration should not be changed after setting it once`. Replace it with the working `--debug` flag. --- pkgs/applications/networking/cluster/k3s/docs/USAGE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/networking/cluster/k3s/docs/USAGE.md b/pkgs/applications/networking/cluster/k3s/docs/USAGE.md index 27c5963bd0b8..326118e1712a 100644 --- a/pkgs/applications/networking/cluster/k3s/docs/USAGE.md +++ b/pkgs/applications/networking/cluster/k3s/docs/USAGE.md @@ -15,7 +15,7 @@ services.k3s.enable = true; services.k3s.role = "server"; services.k3s.extraFlags = toString [ - # "--kubelet-arg=v=4" # Optionally add additional args to k3s + # "--debug" # Optionally add additional args to k3s ]; } ``` From 46b97e7f0f1ce7c1432d156c78f41afc7b7b902c Mon Sep 17 00:00:00 2001 From: Jared Baur Date: Wed, 18 Sep 2024 10:45:12 -0700 Subject: [PATCH 20/36] nixos/plasma6: install discover if flatpak is enabled Just like for gnome, we should install the respective PackageKit frontend for KDE Plasma if flatpak is enabled in the NixOS config. --- nixos/modules/services/desktop-managers/plasma6.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nixos/modules/services/desktop-managers/plasma6.nix b/nixos/modules/services/desktop-managers/plasma6.nix index c165c0b47eed..2df28c80e8a1 100644 --- a/nixos/modules/services/desktop-managers/plasma6.nix +++ b/nixos/modules/services/desktop-managers/plasma6.nix @@ -147,6 +147,10 @@ in { spectacle ffmpegthumbs krdp + ] ++ lib.optionals config.services.flatpak.enable [ + # Since PackageKit Nix support is not there yet, + # only install discover if flatpak is enabled. + discover ]; in requiredPackages From abc51d1654fceca7c2b91fcce5028508aa73b66e Mon Sep 17 00:00:00 2001 From: hatch01 <42416805+hatch01@users.noreply.github.com> Date: Tue, 17 Sep 2024 21:26:20 +0200 Subject: [PATCH 21/36] nixos/authelia: complete level enum --- nixos/modules/services/security/authelia.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/security/authelia.nix b/nixos/modules/services/security/authelia.nix index f73c1ce41e5b..1cc137341e11 100644 --- a/nixos/modules/services/security/authelia.nix +++ b/nixos/modules/services/security/authelia.nix @@ -165,10 +165,10 @@ let log = { level = mkOption { - type = types.enum [ "info" "debug" "trace" ]; + type = types.enum [ "trace" "debug" "info" "warn" "error" ]; default = "debug"; example = "info"; - description = "Level of verbosity for logs: info, debug, trace."; + description = "Level of verbosity for logs."; }; format = mkOption { From 4983e987c0fcee37b9ba68e8f8ba1d98c385e301 Mon Sep 17 00:00:00 2001 From: Herwig Hochleitner Date: Wed, 18 Sep 2024 14:00:20 -0700 Subject: [PATCH 22/36] libmirage: 3.2.7 -> 3.2.9 --- pkgs/applications/emulators/cdemu/libmirage.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/emulators/cdemu/libmirage.nix b/pkgs/applications/emulators/cdemu/libmirage.nix index bbc013be18a0..9773c900fda3 100644 --- a/pkgs/applications/emulators/cdemu/libmirage.nix +++ b/pkgs/applications/emulators/cdemu/libmirage.nix @@ -5,9 +5,9 @@ stdenv.mkDerivation { inherit (callPackage ./common-drv-attrs.nix { - version = "3.2.7"; + version = "3.2.9"; pname = "libmirage"; - hash = "sha256-+okkgNeVS8yoKSrQDy4It7PiPlTSiOsUoFxQ1FS9s9M="; + hash = "sha256-JBd+wHSZRyRW1SZsaAaRO2dNUFkpwRCr3s1f39KyWIs="; }) pname version src meta; PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_GIRDIR = "${placeholder "out"}/share/gir-1.0"; From c8d155a277530efbfebae4fd511a733b20b24c8d Mon Sep 17 00:00:00 2001 From: Herwig Hochleitner Date: Wed, 18 Sep 2024 14:00:01 -0700 Subject: [PATCH 23/36] cdemu-daemon: 3.2.6 -> 3.2.7 --- pkgs/applications/emulators/cdemu/daemon.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/emulators/cdemu/daemon.nix b/pkgs/applications/emulators/cdemu/daemon.nix index 5382efbff237..9b43c2084ba6 100644 --- a/pkgs/applications/emulators/cdemu/daemon.nix +++ b/pkgs/applications/emulators/cdemu/daemon.nix @@ -2,9 +2,9 @@ stdenv.mkDerivation { inherit (callPackage ./common-drv-attrs.nix { - version = "3.2.6"; + version = "3.2.7"; pname = "cdemu-daemon"; - hash = "sha256-puQE4+91xhRuNjVPZYgN/WO0uO8fVAOdxQWOGQ+FfY8="; + hash = "sha256-EKh2G6RA9Yq46BpTAqN2s6TpLJb8gwDuEpGiwdGcelc="; }) pname version src meta; nativeBuildInputs = [ cmake pkg-config intltool ]; From ed138e20f12652dc724d7328f456987bdebeed1b Mon Sep 17 00:00:00 2001 From: Herwig Hochleitner Date: Wed, 18 Sep 2024 14:00:38 -0700 Subject: [PATCH 24/36] linuxPackages.vhba: 20240202 -> 20240917 --- pkgs/applications/emulators/cdemu/vhba.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/emulators/cdemu/vhba.nix b/pkgs/applications/emulators/cdemu/vhba.nix index 15b69500f3d2..e1d251a76392 100644 --- a/pkgs/applications/emulators/cdemu/vhba.nix +++ b/pkgs/applications/emulators/cdemu/vhba.nix @@ -2,11 +2,11 @@ stdenv.mkDerivation rec { pname = "vhba"; - version = "20240202"; + version = "20240917"; src = fetchurl { url = "mirror://sourceforge/cdemu/vhba-module-${version}.tar.xz"; - hash = "sha256-v1hQ1Lj1AiHKh9c0OpKe2oexkfb1roxhQXRUO1ut3oM="; + hash = "sha256-zjTLriw2zvjX0Jxfa9QtaHG5tTC7cLTKEA+WSCP+Dpg="; }; makeFlags = kernel.makeFlags ++ [ "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" "INSTALL_MOD_PATH=$(out)" ]; From b798dd7d720870ae3e8ac2b5ea4eedec1800e3d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 18 Sep 2024 14:14:13 -0700 Subject: [PATCH 25/36] cdemu-daemon: add meta.mainProgram --- pkgs/applications/emulators/cdemu/daemon.nix | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/emulators/cdemu/daemon.nix b/pkgs/applications/emulators/cdemu/daemon.nix index 9b43c2084ba6..0100ea5321d6 100644 --- a/pkgs/applications/emulators/cdemu/daemon.nix +++ b/pkgs/applications/emulators/cdemu/daemon.nix @@ -1,11 +1,14 @@ { stdenv, callPackage, cmake, pkg-config, glib, libao, intltool, libmirage, coreutils }: -stdenv.mkDerivation { +let inherit (callPackage ./common-drv-attrs.nix { version = "3.2.7"; pname = "cdemu-daemon"; hash = "sha256-EKh2G6RA9Yq46BpTAqN2s6TpLJb8gwDuEpGiwdGcelc="; }) pname version src meta; +in +stdenv.mkDerivation { + inherit pname version src; nativeBuildInputs = [ cmake pkg-config intltool ]; buildInputs = [ glib libao libmirage ]; @@ -17,4 +20,16 @@ stdenv.mkDerivation { $out/share/dbus-1/services/net.sf.cdemu.CDEmuDaemon.service \ --replace /bin/true ${coreutils}/bin/true ''; + + meta = { + inherit (meta) + description + license + longDescription + maintainers + platforms + ; + homepage = "https://cdemu.sourceforge.io/about/daemon/"; + mainProgram = "cdemu-daemon"; + }; } From 5e89ea3d30d282778077157825dd8f77e07e71b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 18 Sep 2024 14:17:11 -0700 Subject: [PATCH 26/36] nixos/cdemu: use lib.getExe --- nixos/modules/programs/cdemu.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/programs/cdemu.nix b/nixos/modules/programs/cdemu.nix index 1aac28af1d2c..cdfab3ee9f39 100644 --- a/nixos/modules/programs/cdemu.nix +++ b/nixos/modules/programs/cdemu.nix @@ -60,7 +60,7 @@ in { systemd.user.services.cdemu-daemon.serviceConfig = { Type = "dbus"; BusName = "net.sf.cdemu.CDEmuDaemon"; - ExecStart = "${pkgs.cdemu-daemon}/bin/cdemu-daemon --config-file \"%h/.config/cdemu-daemon\""; + ExecStart = "${lib.getExe pkgs.cdemu-daemon} --config-file \"%h/.config/cdemu-daemon\""; Restart = "no"; }; From 801b8a218d0a8d1e69e81beed6a1042fa59bdb3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 18 Sep 2024 14:19:58 -0700 Subject: [PATCH 27/36] libmirage: improve meta.description --- pkgs/applications/emulators/cdemu/libmirage.nix | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/emulators/cdemu/libmirage.nix b/pkgs/applications/emulators/cdemu/libmirage.nix index 9773c900fda3..2cad36725997 100644 --- a/pkgs/applications/emulators/cdemu/libmirage.nix +++ b/pkgs/applications/emulators/cdemu/libmirage.nix @@ -2,13 +2,15 @@ , glib, libsndfile, zlib, bzip2, xz, libsamplerate, intltool , pcre, util-linux, libselinux, libsepol }: -stdenv.mkDerivation { - +let inherit (callPackage ./common-drv-attrs.nix { version = "3.2.9"; pname = "libmirage"; hash = "sha256-JBd+wHSZRyRW1SZsaAaRO2dNUFkpwRCr3s1f39KyWIs="; }) pname version src meta; +in +stdenv.mkDerivation { + inherit pname version src; PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_GIRDIR = "${placeholder "out"}/share/gir-1.0"; PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_TYPELIBDIR = "${placeholder "out"}/lib/girepository-1.0"; @@ -16,4 +18,13 @@ stdenv.mkDerivation { nativeBuildInputs = [ cmake pkg-config intltool gobject-introspection ]; propagatedBuildInputs = [ pcre util-linux libselinux libsepol ]; + meta = { + inherit (meta) + maintainers + license + platforms + ; + description = "CD-ROM image access library"; + homepage = "https://cdemu.sourceforge.io/about/libmirage/"; + }; } From f6e2fb5e11f411c56b2076e27d270f2cabf80f40 Mon Sep 17 00:00:00 2001 From: Ashish SHUKLA Date: Wed, 18 Sep 2024 23:50:19 +0000 Subject: [PATCH 28/36] nixos/services.tarsnap: fix escapeSystemdPath invocation --- nixos/modules/services/backup/tarsnap.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/backup/tarsnap.nix b/nixos/modules/services/backup/tarsnap.nix index ef531a0707c5..43493997931c 100644 --- a/nixos/modules/services/backup/tarsnap.nix +++ b/nixos/modules/services/backup/tarsnap.nix @@ -87,7 +87,7 @@ in cachedir = lib.mkOption { type = lib.types.nullOr lib.types.path; - default = "/var/cache/tarsnap/${utils.lib.escapeSystemdPath config.keyfile}"; + default = "/var/cache/tarsnap/${utils.escapeSystemdPath config.keyfile}"; defaultText = lib.literalExpression '' "/var/cache/tarsnap/''${utils.escapeSystemdPath config.${options.keyfile}}" ''; From 4016385fe22cb13cd608d2d738740b037b1c1db6 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 19 Sep 2024 02:11:56 +0000 Subject: [PATCH 29/36] msolve: 0.7.1 -> 0.7.2 --- pkgs/by-name/ms/msolve/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/ms/msolve/package.nix b/pkgs/by-name/ms/msolve/package.nix index db05acd3bbce..45b7b0f62015 100644 --- a/pkgs/by-name/ms/msolve/package.nix +++ b/pkgs/by-name/ms/msolve/package.nix @@ -9,13 +9,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "msolve"; - version = "0.7.1"; + version = "0.7.2"; src = fetchFromGitHub { owner = "algebraic-solving"; repo = "msolve"; rev = "v${finalAttrs.version}"; - hash = "sha256-f1AtZ0tyHg3fqz44GK7eCsye+wiKeBbpKK9JWXpV/tk="; + hash = "sha256-p7fD954aMApyBP58cvGrPwHEqhkxWlaiDHUlQT7kX4c="; }; postPatch = '' From 7547a1f5f862cc013fca1712dfbf300ed86c8161 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Wed, 18 Sep 2024 23:18:28 -0400 Subject: [PATCH 30/36] amazon-ssm-agent: add the system's software to the path Follow up to #342584. Similarly to that PR, it is surprising that software which was installed by the user isn't available to a script run over ssm by default. When executing commands with ssm, users will now have more predictable access to baked-in software instead of an extremely bare-minimum set currently there. --- nixos/modules/services/misc/amazon-ssm-agent.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/misc/amazon-ssm-agent.nix b/nixos/modules/services/misc/amazon-ssm-agent.nix index 89acbf09fea8..8267f9c42f8c 100644 --- a/nixos/modules/services/misc/amazon-ssm-agent.nix +++ b/nixos/modules/services/misc/amazon-ssm-agent.nix @@ -37,7 +37,12 @@ in { after = [ "network-online.target" ]; wantedBy = [ "multi-user.target" ]; - path = [ fake-lsb-release pkgs.coreutils ]; + path = [ + fake-lsb-release + pkgs.coreutils + "/run/wrappers" + "/run/current-system/sw" + ]; serviceConfig = { ExecStart = "${cfg.package}/bin/amazon-ssm-agent"; From a003c8a2c2c17814bdb3fafe7e3fbacafb9f7c1f Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 19 Sep 2024 03:37:13 +0000 Subject: [PATCH 31/36] elixir: 1.17.2 -> 1.17.3 --- pkgs/development/interpreters/elixir/1.17.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/interpreters/elixir/1.17.nix b/pkgs/development/interpreters/elixir/1.17.nix index ac1ddc8134b5..41d72d2ff907 100644 --- a/pkgs/development/interpreters/elixir/1.17.nix +++ b/pkgs/development/interpreters/elixir/1.17.nix @@ -1,8 +1,8 @@ { mkDerivation }: mkDerivation { - version = "1.17.2"; - sha256 = "sha256-8rb2f4CvJzio3QgoxvCv1iz8HooXze0tWUJ4Sc13dxg="; - # https://hexdocs.pm/elixir/1.17.2/compatibility-and-deprecations.html#compatibility-between-elixir-and-erlang-otp + version = "1.17.3"; + sha256 = "sha256-7Qo6y0KAQ9lwD4oH+7wQ4W5i6INHIBDN9IQAAsYzNJw="; + # https://hexdocs.pm/elixir/1.17.3/compatibility-and-deprecations.html#compatibility-between-elixir-and-erlang-otp minimumOTPVersion = "25"; escriptPath = "lib/elixir/scripts/generate_app.escript"; } From 0c9495abe2305e7950bc874256d7139041cdb6b7 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 19 Sep 2024 05:20:16 +0000 Subject: [PATCH 32/36] firefoxpwa: 2.12.3 -> 2.12.4 --- pkgs/by-name/fi/firefoxpwa/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/fi/firefoxpwa/package.nix b/pkgs/by-name/fi/firefoxpwa/package.nix index 16590548c0a7..45c837756867 100644 --- a/pkgs/by-name/fi/firefoxpwa/package.nix +++ b/pkgs/by-name/fi/firefoxpwa/package.nix @@ -28,13 +28,13 @@ rustPlatform.buildRustPackage rec { pname = "firefoxpwa"; - version = "2.12.3"; + version = "2.12.4"; src = fetchFromGitHub { owner = "filips123"; repo = "PWAsForFirefox"; rev = "v${version}"; - hash = "sha256-+dQr8eMOvCKt3ZEVU/EbEroVSpLQsBC+1Wix01IrOyc="; + hash = "sha256-VNCQUF/Xep/PkrNd9Mzbm3NWPToqXpJM6SzDoqBXbNY="; }; sourceRoot = "${src.name}/native"; From 256855afc56e5a698b0f70a037e8e07d14f04802 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 19 Sep 2024 07:56:01 +0200 Subject: [PATCH 33/36] protobuf_27: 27.4 -> 27.5 Diff: https://github.com/protocolbuffers/protobuf/compare/v27.4...v27.5 Changelog: https://github.com/protocolbuffers/protobuf/releases/tag/v27.5 --- pkgs/development/libraries/protobuf/27.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/protobuf/27.nix b/pkgs/development/libraries/protobuf/27.nix index 9945587daecc..8e93e443b18e 100644 --- a/pkgs/development/libraries/protobuf/27.nix +++ b/pkgs/development/libraries/protobuf/27.nix @@ -1,6 +1,6 @@ { callPackage, ... } @ args: callPackage ./generic.nix ({ - version = "27.4"; - hash = "sha256-PejX1RlEw8ASU7vWMdpQ8WaPJrxURK01GXBx+pvwV4I="; + version = "27.5"; + hash = "sha256-wUXvdlz19VYpFGU9o0pap/PrwE2AkopLZJVUqfEpJVI="; } // args) From f6c31a3b668663944545ea4681e283424fae522f Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 16 Sep 2024 01:36:20 +0300 Subject: [PATCH 34/36] radicle-explorer: init at 0.17.0 This commit adds radicle-explorer, a web interface for Radicle which displays repositories, issues and patches. The package builds the web interface itself, but a web server still needs to be configured to serve it. This is out-of-scope for this commit, but may be added to the related NixOS modules in the future. The web interface is based on the API exposed by radicle-httpd. For this reason the sources and version of the web interface have been tied directly to the radicle-httpd package, necessitating corresponding updates on this package whenever httpd is updated. There's a little bit of fixed-point magic in this change to enable two features: * Overriding build-time configuration (required to, for example, display a different Radicle seed by default). Documentation for this is available in the upstream repo. * Building radicle-explorer without plausible, a web tracking package which sends user-data to a remote host by default. These are configured through slightly different overriding mechanisms, but I hope to simplify this in the future with some upstream patches. --- .../0001-remove-dependency-on-plausible.patch | 77 +++++++++++ pkgs/by-name/ra/radicle-explorer/package.nix | 130 ++++++++++++++++++ pkgs/by-name/ra/radicle-httpd/package.nix | 2 + 3 files changed, 209 insertions(+) create mode 100644 pkgs/by-name/ra/radicle-explorer/0001-remove-dependency-on-plausible.patch create mode 100644 pkgs/by-name/ra/radicle-explorer/package.nix diff --git a/pkgs/by-name/ra/radicle-explorer/0001-remove-dependency-on-plausible.patch b/pkgs/by-name/ra/radicle-explorer/0001-remove-dependency-on-plausible.patch new file mode 100644 index 000000000000..06b3511d4078 --- /dev/null +++ b/pkgs/by-name/ra/radicle-explorer/0001-remove-dependency-on-plausible.patch @@ -0,0 +1,77 @@ +From cc4718cbea1bd70de21a2be515a944802246ffc7 Mon Sep 17 00:00:00 2001 +From: Vincent Ambo +Date: Sun, 15 Sep 2024 03:08:28 +0300 +Subject: [PATCH] remove dependency on plausible + +--- + package-lock.json | 9 --------- + package.json | 1 - + src/App.svelte | 8 -------- + 3 files changed, 18 deletions(-) + +diff --git a/package-lock.json b/package-lock.json +index d52de6c0..d96e342f 100644 +--- a/package-lock.json ++++ b/package-lock.json +@@ -29,7 +29,6 @@ + "marked-katex-extension": "^5.1.1", + "marked-linkify-it": "^3.1.11", + "md5": "^2.3.0", +- "plausible-tracker": "^0.3.9", + "svelte": "^4.2.19", + "twemoji": "^14.0.2", + "zod": "^3.23.8" +@@ -3697,14 +3696,6 @@ + "url": "https://github.com/sponsors/jonschlinkert" + } + }, +- "node_modules/plausible-tracker": { +- "version": "0.3.9", +- "resolved": "https://registry.npmjs.org/plausible-tracker/-/plausible-tracker-0.3.9.tgz", +- "integrity": "sha512-hMhneYm3GCPyQon88SZrVJx+LlqhM1kZFQbuAgXPoh/Az2YvO1B6bitT9qlhpiTdJlsT5lsr3gPmzoVjb5CDXA==", +- "engines": { +- "node": ">=10" +- } +- }, + "node_modules/playwright": { + "version": "1.46.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.46.1.tgz", +diff --git a/package.json b/package.json +index 6d569ad9..61e8d892 100644 +--- a/package.json ++++ b/package.json +@@ -73,7 +73,6 @@ + "marked-katex-extension": "^5.1.1", + "marked-linkify-it": "^3.1.11", + "md5": "^2.3.0", +- "plausible-tracker": "^0.3.9", + "svelte": "^4.2.19", + "twemoji": "^14.0.2", + "zod": "^3.23.8" +diff --git a/src/App.svelte b/src/App.svelte +index 8161c390..4281ba61 100644 +--- a/src/App.svelte ++++ b/src/App.svelte +@@ -1,6 +1,4 @@ + +-- +2.46.0 + diff --git a/pkgs/by-name/ra/radicle-explorer/package.nix b/pkgs/by-name/ra/radicle-explorer/package.nix new file mode 100644 index 000000000000..21c37268662b --- /dev/null +++ b/pkgs/by-name/ra/radicle-explorer/package.nix @@ -0,0 +1,130 @@ +{ + radicle-httpd, + fetchFromGitHub, + fetchgit, + lib, + buildNpmPackage, + writeText, + jq, + runCommand, +}: + +let + # radicle-explorer bundles these freely available Emoji assets, but does not + # redistribute them. + twemojiAssets = fetchFromGitHub { + owner = "twitter"; + repo = "twemoji"; + rev = "v14.0.2"; + hash = "sha256-YoOnZ5uVukzi/6bLi22Y8U5TpplPzB7ji42l+/ys5xI="; + meta.license = [ lib.licenses.cc-by-40 ]; + }; + + mkPassthru = self: args: { + # radicle-explorer is configured through static build time configuration. + # + # Using this function you can override the this configuration, for example, + # to configure alternative preferred peers (which are shown in the UI by + # default). + # + # Example usage: + # + # ```nix + # radicle-explorer.withConfig { + # preferredSeeds = [{ + # hostname = "seed.example.com"; + # port = 443; + # scheme = "https"; + # }]; + # } + # ``` + withConfig = + config: + let + overrides = writeText "config-overrides.json" (builtins.toJSON config); + newConfig = runCommand "config.json" { } '' + ${jq}/bin/jq -s '.[0] * .[1]' ${(self args).src}/config/default.json ${overrides} > $out + ''; + in + lib.fix ( + final: + (self args).overrideAttrs (prev: { + preBuild = '' + ${prev.preBuild or ""} + cp ${newConfig} config/local.json + ''; + + passthru = prev.passthru // mkPassthru final args; + }) + ); + + # By default, radicle-explorer includes a dependency that sends requests + # to a web analytics tracking service. Using this attribute yields a + # version of radicle-explorer with this dependency removed. + withoutTrackers = self { + patches = [ ./0001-remove-dependency-on-plausible.patch ]; + npmDepsHash = "sha256:1hbrzfjkfc0q8qk03yi6qb9zqm57h7hnkn7fl0yxkrzbrljaljaz"; + }; + }; +in +lib.fix ( + self: + lib.makeOverridable ( + { + npmDepsHash ? "sha256:0kw6rvqm0s21j1rss35idvgcrzzczfy6qi3323y385djw4ygk5xs", + patches ? [ ], + }@args: + buildNpmPackage { + pname = "radicle-explorer"; + version = radicle-httpd.version; + inherit patches npmDepsHash; + + # radicle-explorer uses the radicle-httpd API, and they are developed in the + # same repo. For this reason we pin the sources to each other, but due to + # radicle-httpd using a more limited sparse checkout we need to carry a + # separate hash. + src = fetchgit { + inherit (radicle-httpd.src) url rev; + hash = "sha256:09m13238h6j7g02r6332ihgyyzbjx90pgz14rz29pgv7936h6il8"; + }; + + postPatch = '' + patchShebangs --build ./scripts + mkdir -p "public/twemoji" + cp -t public/twemoji -r -- ${twemojiAssets}/assets/svg/* + : >scripts/install-twemoji-assets + ''; + + dontConfigure = true; + doCheck = false; + + installPhase = '' + runHook preInstall + mkdir -p "$out" + cp -r -t "$out" build/* + runHook postInstall + ''; + + passthru = mkPassthru self args; + + meta = { + description = "Web frontend for Radicle"; + longDescription = '' + Radicle Explorer is a web-frontend for Radicle which supports browsing + repositories, issues and patches on publicly available Radicle seeds. + + This package builds the web interface, ready to be served by any web + server. + ''; + + homepage = "https://radicle.xyz"; + license = lib.licenses.gpl3; + + maintainers = with lib.maintainers; [ + tazjin + lorenzleutgeb + ]; + }; + } + ) +) { } diff --git a/pkgs/by-name/ra/radicle-httpd/package.nix b/pkgs/by-name/ra/radicle-httpd/package.nix index d5f5f9171563..a42bc9a8a110 100644 --- a/pkgs/by-name/ra/radicle-httpd/package.nix +++ b/pkgs/by-name/ra/radicle-httpd/package.nix @@ -16,12 +16,14 @@ rustPlatform.buildRustPackage rec { version = "0.17.0"; env.RADICLE_VERSION = version; + # You must update the radicle-explorer source hash when changing this. src = fetchgit { url = "https://seed.radicle.xyz/z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git"; rev = "refs/namespaces/z6MkkfM3tPXNPrPevKr3uSiQtHPuwnNhu2yUVjgd2jXVsVz5/refs/tags/v${version}"; hash = "sha256-nstyb1rSll3Sl0DlA9JAAwvr6JN8okJ03WoQnE4dXEk="; sparseCheckout = [ "radicle-httpd" ]; }; + sourceRoot = "${src.name}/radicle-httpd"; cargoHash = "sha256-M4tDtUXS99/Zb1Z71CTdW9gMgRR30rbwA6wK7nlwblQ="; From 778d506a690c9f20a34b781b6d4f1f695a34e4c8 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 19 Sep 2024 08:16:31 +0000 Subject: [PATCH 35/36] docfd: 8.0.2 -> 8.0.3 --- pkgs/by-name/do/docfd/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/do/docfd/package.nix b/pkgs/by-name/do/docfd/package.nix index ee782a052f06..11ddaace86fe 100644 --- a/pkgs/by-name/do/docfd/package.nix +++ b/pkgs/by-name/do/docfd/package.nix @@ -21,7 +21,7 @@ let in buildDunePackage' rec { pname = "docfd"; - version = "8.0.2"; + version = "8.0.3"; minimalOCamlVersion = "5.1"; @@ -29,7 +29,7 @@ buildDunePackage' rec { owner = "darrenldl"; repo = "docfd"; rev = version; - hash = "sha256-A4feBRZs9EFpfgbGGcaKlwAz59RbKuPZAVJytgYVUAc="; + hash = "sha256-890/3iBruaQtWwlcvwuz4ujp7+P+5y1/2Axx4Iuik8Q="; }; nativeBuildInputs = [ From a597aac695658848ae043c8beb68651fc1089d05 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 19 Sep 2024 10:13:58 +0000 Subject: [PATCH 36/36] discord-ptb: 0.0.103 -> 0.0.105 --- .../networking/instant-messengers/discord/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/discord/default.nix b/pkgs/applications/networking/instant-messengers/discord/default.nix index 891bc2423b98..b62be88b132c 100644 --- a/pkgs/applications/networking/instant-messengers/discord/default.nix +++ b/pkgs/applications/networking/instant-messengers/discord/default.nix @@ -3,7 +3,7 @@ let versions = if stdenv.isLinux then { stable = "0.0.67"; - ptb = "0.0.103"; + ptb = "0.0.105"; canary = "0.0.483"; development = "0.0.28"; } else { @@ -21,7 +21,7 @@ let }; ptb = fetchurl { url = "https://dl-ptb.discordapp.net/apps/linux/${version}/discord-ptb-${version}.tar.gz"; - hash = "sha256-BYzISVHSlKqVN0Egkw5su1wJnrGjQYbxYV840bDCakM="; + hash = "sha256-u/4wWssZxKlHrRW/Vd9pqUfqN2VQGYv1SDktpRsOayM="; }; canary = fetchurl { url = "https://dl-canary.discordapp.net/apps/linux/${version}/discord-canary-${version}.tar.gz";