From 8f0bd879da6142aed53c544b9354c090206e07be Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Tue, 9 Feb 2021 21:26:43 +0000 Subject: [PATCH 01/20] qemu: re-enable stack protection 5e259952953 ("qemu: 2.6.1 -> 2.7.0") added this, because the QEMU build failed without it. That's no longer the case, so we can bring back stack protection. --- pkgs/applications/virtualization/qemu/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/applications/virtualization/qemu/default.nix b/pkgs/applications/virtualization/qemu/default.nix index d83c6d350e2..d7213457ad2 100644 --- a/pkgs/applications/virtualization/qemu/default.nix +++ b/pkgs/applications/virtualization/qemu/default.nix @@ -101,8 +101,6 @@ stdenv.mkDerivation rec { }) ]; - hardeningDisable = [ "stackprotector" ]; - preConfigure = '' unset CPP # intereferes with dependency calculation # this script isn't marked as executable b/c it's indirectly used by meson. Needed to patch its shebang From 442c07837607ed3095090719d3b9e5377e3f7046 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6gler?= Date: Sun, 21 Feb 2021 14:06:05 +0100 Subject: [PATCH 02/20] bup: Fix par2 path patching Because of Python 3 compatibility change in bup 0.30.1 the substitution fails. --- pkgs/tools/backup/bup/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/backup/bup/default.nix b/pkgs/tools/backup/bup/default.nix index 3b81295ccf2..22f41c2b0c1 100644 --- a/pkgs/tools/backup/bup/default.nix +++ b/pkgs/tools/backup/bup/default.nix @@ -33,7 +33,7 @@ stdenv.mkDerivation { substituteInPlace Makefile --replace "-Werror" "" substituteInPlace Makefile --replace "./format-subst.pl" "${perl}/bin/perl ./format-subst.pl" '' + optionalString par2Support '' - substituteInPlace cmd/fsck-cmd.py --replace "['par2'" "['${par2cmdline}/bin/par2'" + substituteInPlace cmd/fsck-cmd.py --replace "'par2'" "'${par2cmdline}/bin/par2'" ''; dontAddPrefix = true; From df17229e0278bdf3e184071408687d1736b0625b Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Mon, 22 Feb 2021 10:22:15 +0000 Subject: [PATCH 03/20] pulseaudio-ctl: 1.68 -> 1.69 --- pkgs/applications/audio/pulseaudio-ctl/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/audio/pulseaudio-ctl/default.nix b/pkgs/applications/audio/pulseaudio-ctl/default.nix index 843c131ea65..9d1d6df1da5 100644 --- a/pkgs/applications/audio/pulseaudio-ctl/default.nix +++ b/pkgs/applications/audio/pulseaudio-ctl/default.nix @@ -7,13 +7,13 @@ let in stdenv.mkDerivation rec { name = "${pname}-${version}"; - version = "1.68"; + version = "1.69"; src = fetchFromGitHub { owner = "graysky2"; repo = pname; rev = "v${version}"; - sha256 = "0wrzfanwy18wyawpg8rfvfgjh3lwngqwmfpi4ww3530rfmi84cf0"; + sha256 = "sha256-5WRhVIQlSwWuyvkzrnNW0rdVet9ZzM47gISJpznM8mU="; }; postPatch = '' From 5e652b35db88328593e7f224a9bd44fb4fef975e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6gler?= Date: Mon, 22 Feb 2021 23:18:24 +0100 Subject: [PATCH 04/20] Update pkgs/tools/backup/bup/default.nix Co-authored-by: Sandro --- pkgs/tools/backup/bup/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/tools/backup/bup/default.nix b/pkgs/tools/backup/bup/default.nix index 22f41c2b0c1..3908b4984c4 100644 --- a/pkgs/tools/backup/bup/default.nix +++ b/pkgs/tools/backup/bup/default.nix @@ -31,7 +31,6 @@ stdenv.mkDerivation { postPatch = '' patchShebangs . substituteInPlace Makefile --replace "-Werror" "" - substituteInPlace Makefile --replace "./format-subst.pl" "${perl}/bin/perl ./format-subst.pl" '' + optionalString par2Support '' substituteInPlace cmd/fsck-cmd.py --replace "'par2'" "'${par2cmdline}/bin/par2'" ''; From bc9964b5bf0fef7c9359f007cae57313be862e25 Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Tue, 23 Feb 2021 14:41:17 +0000 Subject: [PATCH 05/20] coolreader: 3.2.51 -> 3.2.53 --- pkgs/applications/misc/coolreader/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/misc/coolreader/default.nix b/pkgs/applications/misc/coolreader/default.nix index 5b310373eee..d043823a068 100644 --- a/pkgs/applications/misc/coolreader/default.nix +++ b/pkgs/applications/misc/coolreader/default.nix @@ -3,13 +3,13 @@ mkDerivation rec { pname = "coolreader"; - version = "3.2.51"; + version = "3.2.53"; src = fetchFromGitHub { owner = "buggins"; repo = pname; rev = "cr${version}"; - sha256 = "sha256-rRWZHkuSNhAHwxKjpRgcNXO9vs/MDAgEuhRs8mRPjP4="; + sha256 = "sha256-5it70cwRV56OMZI4dny5uwxWgoF42tjcEC4g3MC548s="; }; nativeBuildInputs = [ cmake pkg-config ]; From 184494bc5a7206f8cf2cce004a3b36cfa995f427 Mon Sep 17 00:00:00 2001 From: figsoda Date: Thu, 25 Feb 2021 15:30:58 -0500 Subject: [PATCH 06/20] pactorio: init at 0.5.1 --- pkgs/development/tools/pactorio/default.nix | 33 +++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 35 insertions(+) create mode 100644 pkgs/development/tools/pactorio/default.nix diff --git a/pkgs/development/tools/pactorio/default.nix b/pkgs/development/tools/pactorio/default.nix new file mode 100644 index 00000000000..d29e1244378 --- /dev/null +++ b/pkgs/development/tools/pactorio/default.nix @@ -0,0 +1,33 @@ +{ fetchFromGitHub, installShellFiles, lib, rustPlatform }: + +rustPlatform.buildRustPackage rec { + pname = "pactorio"; + version = "0.5.1"; + + src = fetchFromGitHub { + owner = "figsoda"; + repo = pname; + rev = "v${version}"; + sha256 = "07h9hywz0pc29411myhxjq6pks4p6q6czbqjv7fxf3xkb1mg9grq"; + }; + + cargoSha256 = "1m7bvi6i52xqvssjx5fr2dz25ny7hkmb8w8p23pczpdmpd2y0r7r"; + + nativeBuildInputs = [ installShellFiles ]; + + preFixup = '' + completions=($releaseDir/build/pactorio-*/out/completions) + installShellCompletion ''${completions[0]}/pactorio.{bash,fish} + installShellCompletion --zsh ''${completions[0]}/_pactorio + ''; + + GEN_COMPLETIONS = "1"; + + meta = with lib; { + description = "Mod package for factorio"; + homepage = "https://github.com/figsoda/pactorio"; + changelog = "https://github.com/figsoda/pactorio/blob/v${version}/CHANGELOG.md"; + license = licenses.mpl20; + maintainers = with maintainers; [ figsoda ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c0dc67cc07e..fd4e251c301 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12616,6 +12616,8 @@ in libiberty_static = libiberty.override { staticBuild = true; }; }; + pactorio = callPackage ../development/tools/pactorio { }; + pahole = callPackage ../development/tools/misc/pahole {}; panopticon = callPackage ../development/tools/analysis/panopticon {}; From 9734c688a4a33a1652768cc7c8127890b7f2d9bb Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Thu, 4 Mar 2021 14:38:58 +0000 Subject: [PATCH 07/20] dolt: 0.22.13 -> 0.23.9 --- pkgs/servers/sql/dolt/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/servers/sql/dolt/default.nix b/pkgs/servers/sql/dolt/default.nix index 20608f796fc..ce57219468f 100644 --- a/pkgs/servers/sql/dolt/default.nix +++ b/pkgs/servers/sql/dolt/default.nix @@ -2,18 +2,18 @@ buildGoModule rec { pname = "dolt"; - version = "0.22.13"; + version = "0.23.9"; src = fetchFromGitHub { owner = "liquidata-inc"; repo = "dolt"; rev = "v${version}"; - sha256 = "sha256-9/fpdxD3xj2hCId9koNhZLgA8SeucTue2iC/4Ues7bM="; + sha256 = "sha256-fVU3eOhog34fLnfNQ6mWB7yUEkinm74SgpxYXB9MV/g="; }; modRoot = "./go"; subPackages = [ "cmd/dolt" "cmd/git-dolt" "cmd/git-dolt-smudge" ]; - vendorSha256 = "sha256-dDJDiCWG4+YZzTsEbhv4KzuwrkBGYUxJzknBbrWGiCE="; + vendorSha256 = "sha256-Poumvh7DccY8qCZ5ehFFaqEsL945BxNXFfevJvRawUA="; doCheck = false; From 82185d395328be56744042dafb5b0dffb3687a07 Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Thu, 4 Mar 2021 16:24:21 +0000 Subject: [PATCH 08/20] golangci-lint: 1.37.1 -> 1.38.0 --- pkgs/development/tools/golangci-lint/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/tools/golangci-lint/default.nix b/pkgs/development/tools/golangci-lint/default.nix index 49928b1a08b..4336ba76a20 100644 --- a/pkgs/development/tools/golangci-lint/default.nix +++ b/pkgs/development/tools/golangci-lint/default.nix @@ -2,16 +2,16 @@ buildGoModule rec { pname = "golangci-lint"; - version = "1.37.1"; + version = "1.38.0"; src = fetchFromGitHub { owner = "golangci"; repo = "golangci-lint"; rev = "v${version}"; - sha256 = "sha256-x0VLNQeTVN9aPO06Yi1DTb8bTjq+9VemJaX1R+8s/Bg="; + sha256 = "sha256-hJGyK+hrP6CuSkODNsN8d2IhteKe/fXTF9GxbF7TQOk="; }; - vendorSha256 = "sha256-uduT4RL6p6/jdT8JeTx+FY9bz0P2eUSaFNDIzi7jcqg="; + vendorSha256 = "sha256-zTWipGoWFndBSH8V+QxWmGv+8RoFa+OGT4BhAq/yIbE="; doCheck = false; From 0a4a486096bc2a6efb1bc0d11543f208eda23dc3 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Thu, 4 Mar 2021 17:52:32 +0100 Subject: [PATCH 09/20] doc/README.md: init --- doc/Makefile | 2 +- doc/README.md | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 doc/README.md diff --git a/doc/Makefile b/doc/Makefile index 4f520779f5b..7affbb0bb51 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,4 +1,4 @@ -MD_TARGETS=$(addsuffix .xml, $(basename $(shell find . -type f -regex '.*\.md$$'))) +MD_TARGETS=$(addsuffix .xml, $(basename $(shell find . -type f -regex '.*\.md$$' -not -name README.md))) .PHONY: all all: validate format out/html/index.html out/epub/manual.epub diff --git a/doc/README.md b/doc/README.md new file mode 100644 index 00000000000..cb52608bde5 --- /dev/null +++ b/doc/README.md @@ -0,0 +1,8 @@ + +# Nixpkgs/doc + +This directory houses the sources files for the Nixpkgs manual. + +You can find the [rendered documentation for Nixpkgs `unstable` on nixos.org](https://nixos.org/manual/nixpkgs/unstable/). + +If you want to contribute to the documentation, [here's how to do it](https://nixos.org/manual/nixpkgs/unstable/#chap-contributing). From 7d551ead60f90b8c879bea7ce421f54482406dbb Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Thu, 4 Mar 2021 17:54:35 +0100 Subject: [PATCH 10/20] doc: Format --- doc/builders/packages/citrix.xml | 2 + doc/contributing/coding-conventions.xml | 12 +- doc/functions/library/attrsets.xml | 6 +- doc/stdenv/multiple-output.xml | 1 - doc/stdenv/stdenv.xml | 12 +- doc/using/configuration.xml | 2 +- doc/using/overlays.xml | 258 ++++++++++-------------- 7 files changed, 115 insertions(+), 178 deletions(-) diff --git a/doc/builders/packages/citrix.xml b/doc/builders/packages/citrix.xml index 803eb2e4fc4..7a16b79f232 100644 --- a/doc/builders/packages/citrix.xml +++ b/doc/builders/packages/citrix.xml @@ -17,9 +17,11 @@
Citrix Selfservice + The selfservice is an application managing Citrix desktops and applications. Please note that this feature only works with at least citrix_workspace_20_06_0 and later versions. + In order to set this up, you first have to download the .cr file from the Netscaler Gateway. After that you can configure the selfservice like this: diff --git a/doc/contributing/coding-conventions.xml b/doc/contributing/coding-conventions.xml index 9005a9ebafd..9f00942918c 100644 --- a/doc/contributing/coding-conventions.xml +++ b/doc/contributing/coding-conventions.xml @@ -180,17 +180,12 @@ args.stdenv.mkDerivation (args // { - Arguments should be listed in the order they are used, with the - exception of lib, which always goes first. + Arguments should be listed in the order they are used, with the exception of lib, which always goes first. - Prefer using the top-level lib over its alias - stdenv.lib. lib is unrelated to - stdenv, and so stdenv.lib should only - be used as a convenience alias when developing to avoid having to modify - the function inputs just to test something out. + Prefer using the top-level lib over its alias stdenv.lib. lib is unrelated to stdenv, and so stdenv.lib should only be used as a convenience alias when developing to avoid having to modify the function inputs just to test something out. @@ -689,8 +684,7 @@ args.stdenv.mkDerivation (args // { - If it’s a theme for a desktop environment, - a window manager or a display manager: + If it’s a theme for a desktop environment, a window manager or a display manager: diff --git a/doc/functions/library/attrsets.xml b/doc/functions/library/attrsets.xml index 7ef0d16624c..9a4e640935f 100644 --- a/doc/functions/library/attrsets.xml +++ b/doc/functions/library/attrsets.xml @@ -1677,8 +1677,7 @@ recursiveUpdate - Make various Nix tools consider the contents of the resulting - attribute set when looking for what to build, find, etc. + Make various Nix tools consider the contents of the resulting attribute set when looking for what to build, find, etc. @@ -1720,7 +1719,7 @@ recursiveUpdate - Return the cartesian product of attribute set value combinations. + Return the cartesian product of attribute set value combinations. @@ -1749,5 +1748,4 @@ cartesianProductOfSets { a = [ 1 2 ]; b = [ 10 20 ]; } ]]>
- diff --git a/doc/stdenv/multiple-output.xml b/doc/stdenv/multiple-output.xml index f710a9959ad..5f2d2b8cfb9 100644 --- a/doc/stdenv/multiple-output.xml +++ b/doc/stdenv/multiple-output.xml @@ -26,7 +26,6 @@ A number of attributes can be used to work with a derivation with multiple outputs. The attribute outputs is a list of strings, which are the names of the outputs. For each of these names, an identically named attribute is created, corresponding to that output. The attribute meta.outputsToInstall is used to determine the default set of outputs to install when using the derivation name unqualified. -
Installing a split package diff --git a/doc/stdenv/stdenv.xml b/doc/stdenv/stdenv.xml index 21485425f26..b2004270e9b 100644 --- a/doc/stdenv/stdenv.xml +++ b/doc/stdenv/stdenv.xml @@ -1136,9 +1136,9 @@ preBuild = '' Variables controlling the install phase - + - dontInstall + dontInstall @@ -1839,10 +1839,7 @@ addEnvHooks "$hostOffset" myBashFunction - This setup hook moves any systemd user units installed in the lib - subdirectory into share. In addition, a link is provided from share to - lib for compatibility. This is needed for systemd to find user services - when installed into the user profile. + This setup hook moves any systemd user units installed in the lib subdirectory into share. In addition, a link is provided from share to lib for compatibility. This is needed for systemd to find user services when installed into the user profile. @@ -2022,8 +2019,7 @@ addEnvHooks "$hostOffset" myBashFunction This is a special setup hook which helps in packaging proprietary software in that it automatically tries to find missing shared library dependencies of ELF files based on the given buildInputs and nativeBuildInputs. - You can also specify a runtimeDependencies variable which lists dependencies to be unconditionally added to rpath of all executables. - This is useful for programs that use + You can also specify a runtimeDependencies variable which lists dependencies to be unconditionally added to rpath of all executables. This is useful for programs that use dlopen 3 to load libraries at runtime. diff --git a/doc/using/configuration.xml b/doc/using/configuration.xml index 8e63e0072c8..3ef39733458 100644 --- a/doc/using/configuration.xml +++ b/doc/using/configuration.xml @@ -170,7 +170,7 @@ - Note that allowlistedLicenses only applies to unfree licenses unless allowUnfree is enabled. It is not a generic allowlist for all types of licenses. blocklistedLicenses applies to all licenses. + Note that allowlistedLicenses only applies to unfree licenses unless allowUnfree is enabled. It is not a generic allowlist for all types of licenses. blocklistedLicenses applies to all licenses. diff --git a/doc/using/overlays.xml b/doc/using/overlays.xml index 8bda235d43d..1def8b06955 100644 --- a/doc/using/overlays.xml +++ b/doc/using/overlays.xml @@ -28,8 +28,7 @@ - NOTE: DO NOT USE THIS in nixpkgs. - Further overlays can be added by calling the pkgs.extend or pkgs.appendOverlays, although it is often preferable to avoid these functions, because they recompute the Nixpkgs fixpoint, which is somewhat expensive to do. + NOTE: DO NOT USE THIS in nixpkgs. Further overlays can be added by calling the pkgs.extend or pkgs.appendOverlays, although it is often preferable to avoid these functions, because they recompute the Nixpkgs fixpoint, which is somewhat expensive to do.
@@ -139,98 +138,72 @@ self: super:
- Using overlays to configure alternatives + Using overlays to configure alternatives + + + Certain software packages have different implementations of the same interface. Other distributions have functionality to switch between these. For example, Debian provides DebianAlternatives. Nixpkgs has what we call alternatives, which are configured through overlays. + + +
+ BLAS/LAPACK + - Certain software packages have different implementations of the - same interface. Other distributions have functionality to switch - between these. For example, Debian provides DebianAlternatives. - Nixpkgs has what we call alternatives, which - are configured through overlays. + In Nixpkgs, we have multiple implementations of the BLAS/LAPACK numerical linear algebra interfaces. They are: -
- BLAS/LAPACK + + + - In Nixpkgs, we have multiple implementations of the BLAS/LAPACK - numerical linear algebra interfaces. They are: + OpenBLAS - - - - OpenBLAS - - - The Nixpkgs attribute is openblas for - ILP64 (integer width = 64 bits) and - openblasCompat for LP64 (integer width = - 32 bits). openblasCompat is the default. - - - - - LAPACK - reference (also provides BLAS) - - - The Nixpkgs attribute is lapack-reference. - - - - - Intel - MKL (only works on the x86_64 architecture, unfree) - - - The Nixpkgs attribute is mkl. - - - - - + The Nixpkgs attribute is openblas for ILP64 (integer width = 64 bits) and openblasCompat for LP64 (integer width = 32 bits). openblasCompat is the default. + + + + + LAPACK reference (also provides BLAS) + + + The Nixpkgs attribute is lapack-reference. + + + + + Intel MKL (only works on the x86_64 architecture, unfree) + + + The Nixpkgs attribute is mkl. + + + + + BLIS - - - BLIS, available through the attribute - blis, is a framework for linear algebra kernels. In - addition, it implements the BLAS interface. - - - - - AMD - BLIS/LIBFLAME (optimized for modern AMD x86_64 CPUs) - - - The AMD fork of the BLIS library, with attribute - amd-blis, extends BLIS with optimizations for - modern AMD CPUs. The changes are usually submitted to - the upstream BLIS project after some time. However, AMD BLIS - typically provides some performance improvements on AMD Zen CPUs. - The complementary AMD LIBFLAME library, with attribute - amd-libflame, provides a LAPACK implementation. - - - - - Introduced in PR - #83888, we are able to override the blas - and lapack packages to use different implementations, - through the blasProvider and - lapackProvider argument. This can be used - to select a different provider. BLAS providers will have - symlinks in $out/lib/libblas.so.3 and - $out/lib/libcblas.so.3 to their respective - BLAS libraries. Likewise, LAPACK providers will have symlinks - in $out/lib/liblapack.so.3 and - $out/lib/liblapacke.so.3 to their respective - LAPACK libraries. For example, Intel MKL is both a BLAS and - LAPACK provider. An overlay can be created to use Intel MKL - that looks like: - + + BLIS, available through the attribute blis, is a framework for linear algebra kernels. In addition, it implements the BLAS interface. + + + + + AMD BLIS/LIBFLAME (optimized for modern AMD x86_64 CPUs) + + + The AMD fork of the BLIS library, with attribute amd-blis, extends BLIS with optimizations for modern AMD CPUs. The changes are usually submitted to the upstream BLIS project after some time. However, AMD BLIS typically provides some performance improvements on AMD Zen CPUs. The complementary AMD LIBFLAME library, with attribute amd-libflame, provides a LAPACK implementation. + + + + + + Introduced in PR #83888, we are able to override the blas and lapack packages to use different implementations, through the blasProvider and lapackProvider argument. This can be used to select a different provider. BLAS providers will have symlinks in $out/lib/libblas.so.3 and $out/lib/libcblas.so.3 to their respective BLAS libraries. Likewise, LAPACK providers will have symlinks in $out/lib/liblapack.so.3 and $out/lib/liblapacke.so.3 to their respective LAPACK libraries. For example, Intel MKL is both a BLAS and LAPACK provider. An overlay can be created to use Intel MKL that looks like: + + + self: super: { @@ -243,46 +216,24 @@ self: super: }; } - - This overlay uses Intel’s MKL library for both BLAS and LAPACK - interfaces. Note that the same can be accomplished at runtime - using LD_LIBRARY_PATH of - libblas.so.3 and - liblapack.so.3. For instance: - + + + This overlay uses Intel’s MKL library for both BLAS and LAPACK interfaces. Note that the same can be accomplished at runtime using LD_LIBRARY_PATH of libblas.so.3 and liblapack.so.3. For instance: + + $ LD_LIBRARY_PATH=$(nix-build -A mkl)/lib:$LD_LIBRARY_PATH nix-shell -p octave --run octave - - Intel MKL requires an openmp implementation - when running with multiple processors. By default, - mkl will use Intel’s iomp - implementation if no other is specified, but this is a - runtime-only dependency and binary compatible with the LLVM - implementation. To use that one instead, Intel recommends users - set it with LD_PRELOAD. Note that - mkl is only available on - x86_64-linux and - x86_64-darwin. Moreover, Hydra is not - building and distributing pre-compiled binaries using it. - - - For BLAS/LAPACK switching to work correctly, all packages must - depend on blas or lapack. - This ensures that only one BLAS/LAPACK library is used at one - time. There are two versions versions of BLAS/LAPACK currently - in the wild, LP64 (integer size = 32 bits) - and ILP64 (integer size = 64 bits). Some - software needs special flags or patches to work with - ILP64. You can check if - ILP64 is used in Nixpkgs with - blas.isILP64 and - lapack.isILP64. Some software does NOT work - with ILP64, and derivations need to specify - an assertion to prevent this. You can prevent - ILP64 from being used with the following: - - + + + Intel MKL requires an openmp implementation when running with multiple processors. By default, mkl will use Intel’s iomp implementation if no other is specified, but this is a runtime-only dependency and binary compatible with the LLVM implementation. To use that one instead, Intel recommends users set it with LD_PRELOAD. Note that mkl is only available on x86_64-linux and x86_64-darwin. Moreover, Hydra is not building and distributing pre-compiled binaries using it. + + + + For BLAS/LAPACK switching to work correctly, all packages must depend on blas or lapack. This ensures that only one BLAS/LAPACK library is used at one time. There are two versions versions of BLAS/LAPACK currently in the wild, LP64 (integer size = 32 bits) and ILP64 (integer size = 64 bits). Some software needs special flags or patches to work with ILP64. You can check if ILP64 is used in Nixpkgs with blas.isILP64 and lapack.isILP64. Some software does NOT work with ILP64, and derivations need to specify an assertion to prevent this. You can prevent ILP64 from being used with the following: + + + { stdenv, blas, lapack, ... }: assert (!blas.isILP64) && (!lapack.isILP64); @@ -291,41 +242,38 @@ stdenv.mkDerivation { ... } -
-
- Switching the MPI implementation - - All programs that are built with - MPI - support use the generic attribute mpi - as an input. At the moment Nixpkgs natively provides two different - MPI implementations: - - - - Open MPI - (default), attribute name openmpi - - - - - MPICH, - attribute name mpich - - - - - - To provide MPI enabled applications that use MPICH, instead - of the default Open MPI, simply use the following overlay: - - +
+ +
+ Switching the MPI implementation + + + All programs that are built with MPI support use the generic attribute mpi as an input. At the moment Nixpkgs natively provides two different MPI implementations: + + + + Open MPI (default), attribute name openmpi + + + + + MPICH, attribute name mpich + + + + + + + To provide MPI enabled applications that use MPICH, instead of the default Open MPI, simply use the following overlay: + + + self: super: { mpi = self.mpich; } -
+
From 78bfbdd77aa9e42302ed71072cf0b3110f350f46 Mon Sep 17 00:00:00 2001 From: Jan Solanti Date: Thu, 25 Feb 2021 16:22:40 +0200 Subject: [PATCH 11/20] pipewire: 0.3.21 -> 0.3.22 --- .../desktops/pipewire/alsa-monitor.conf.json | 48 +++ .../desktops/pipewire/bluez-monitor.conf.json | 38 +++ .../desktops/pipewire/client-rt.conf.json | 22 ++ .../desktops/pipewire/client.conf.json | 15 + .../services/desktops/pipewire/jack.conf.json | 19 ++ .../desktops/pipewire/media-session.conf.json | 53 +++ .../pipewire/pipewire-media-session.nix | 319 +++--------------- .../pipewire/pipewire-pulse.conf.json | 27 ++ .../desktops/pipewire/pipewire.conf.json | 54 +++ .../services/desktops/pipewire/pipewire.nix | 180 +++++----- .../desktops/pipewire/v4l2-monitor.conf.json | 38 +++ .../libraries/pipewire/default.nix | 112 +++++- .../0005-fix-some-warnings.patch | 23 ++ .../libraries/pipewire/test-paths.nix | 1 + 14 files changed, 577 insertions(+), 372 deletions(-) create mode 100644 nixos/modules/services/desktops/pipewire/alsa-monitor.conf.json create mode 100644 nixos/modules/services/desktops/pipewire/bluez-monitor.conf.json create mode 100644 nixos/modules/services/desktops/pipewire/client-rt.conf.json create mode 100644 nixos/modules/services/desktops/pipewire/client.conf.json create mode 100644 nixos/modules/services/desktops/pipewire/jack.conf.json create mode 100644 nixos/modules/services/desktops/pipewire/media-session.conf.json create mode 100644 nixos/modules/services/desktops/pipewire/pipewire-pulse.conf.json create mode 100644 nixos/modules/services/desktops/pipewire/pipewire.conf.json create mode 100644 nixos/modules/services/desktops/pipewire/v4l2-monitor.conf.json create mode 100644 pkgs/development/libraries/pipewire/patches-0.3.22/0005-fix-some-warnings.patch diff --git a/nixos/modules/services/desktops/pipewire/alsa-monitor.conf.json b/nixos/modules/services/desktops/pipewire/alsa-monitor.conf.json new file mode 100644 index 00000000000..5e8e1de6986 --- /dev/null +++ b/nixos/modules/services/desktops/pipewire/alsa-monitor.conf.json @@ -0,0 +1,48 @@ +{ + "properties": {}, + "rules": [ + { + "actions": { + "update-props": { + "api": { + "acp": { + "auto-port": false, + "auto-profile": false + }, + "alsa": { + "use-acp": true + } + } + } + }, + "matches": [ + { + "device": { + "name": "~alsa_card.*" + } + } + ] + }, + { + "actions": { + "update-props": { + "node": { + "pause-on-idle": false + } + } + }, + "matches": [ + { + "node": { + "name": "~alsa_input.*" + } + }, + { + "node": { + "name": "~alsa_output.*" + } + } + ] + } + ] +} diff --git a/nixos/modules/services/desktops/pipewire/bluez-monitor.conf.json b/nixos/modules/services/desktops/pipewire/bluez-monitor.conf.json new file mode 100644 index 00000000000..d8f74f32943 --- /dev/null +++ b/nixos/modules/services/desktops/pipewire/bluez-monitor.conf.json @@ -0,0 +1,38 @@ +{ + "properties": {}, + "rules": [ + { + "actions": { + "update-props": {} + }, + "matches": [ + { + "device": { + "name": "~bluez_card.*" + } + } + ] + }, + { + "actions": { + "update-props": { + "node": { + "pause-on-idle": false + } + } + }, + "matches": [ + { + "node": { + "name": "~bluez_input.*" + } + }, + { + "node": { + "name": "~bluez_output.*" + } + } + ] + } + ] +} diff --git a/nixos/modules/services/desktops/pipewire/client-rt.conf.json b/nixos/modules/services/desktops/pipewire/client-rt.conf.json new file mode 100644 index 00000000000..701b1916599 --- /dev/null +++ b/nixos/modules/services/desktops/pipewire/client-rt.conf.json @@ -0,0 +1,22 @@ +{ + "context.properties": {}, + "context.spa-libs": { + "audio.convert.*": "audioconvert/libspa-audioconvert", + "support.*": "support/libspa-support" + }, + "context.modules": { + "libpipewire-module-rtkit": { + "args": {}, + "flags": [ + "ifexists", + "nofail" + ] + }, + "libpipewire-module-protocol-native": null, + "libpipewire-module-client-node": null, + "libpipewire-module-client-device": null, + "libpipewire-module-adapter": null, + "libpipewire-module-metadata": null, + "libpipewire-module-session-manager": null + } +} diff --git a/nixos/modules/services/desktops/pipewire/client.conf.json b/nixos/modules/services/desktops/pipewire/client.conf.json new file mode 100644 index 00000000000..24c10309329 --- /dev/null +++ b/nixos/modules/services/desktops/pipewire/client.conf.json @@ -0,0 +1,15 @@ +{ + "context.properties": {}, + "context.spa-libs": { + "audio.convert.*": "audioconvert/libspa-audioconvert", + "support.*": "support/libspa-support" + }, + "context.modules": { + "libpipewire-module-protocol-native": null, + "libpipewire-module-client-node": null, + "libpipewire-module-client-device": null, + "libpipewire-module-adapter": null, + "libpipewire-module-metadata": null, + "libpipewire-module-session-manager": null + } +} diff --git a/nixos/modules/services/desktops/pipewire/jack.conf.json b/nixos/modules/services/desktops/pipewire/jack.conf.json new file mode 100644 index 00000000000..0219269f615 --- /dev/null +++ b/nixos/modules/services/desktops/pipewire/jack.conf.json @@ -0,0 +1,19 @@ +{ + "context.properties": {}, + "context.spa-libs": { + "support.*": "support/libspa-support" + }, + "context.modules": { + "libpipewire-module-rtkit": { + "args": {}, + "flags": [ + "ifexists", + "nofail" + ] + }, + "libpipewire-module-protocol-native": null, + "libpipewire-module-client-node": null, + "libpipewire-module-metadata": null + }, + "jack.properties": {} +} diff --git a/nixos/modules/services/desktops/pipewire/media-session.conf.json b/nixos/modules/services/desktops/pipewire/media-session.conf.json new file mode 100644 index 00000000000..a8fc2d93fb0 --- /dev/null +++ b/nixos/modules/services/desktops/pipewire/media-session.conf.json @@ -0,0 +1,53 @@ +{ + "context.modules": { + "libpipewire-module-protocol-native": null, + "libpipewire-module-adapter": null, + "libpipewire-module-client-device": null, + "libpipewire-module-client-node": null, + "libpipewire-module-metadata": null, + "libpipewire-module-rtkit": { + "args": {}, + "flags": [ + "ifexists", + "nofail" + ] + }, + "libpipewire-module-session-manager": null + }, + "context.properties": {}, + "context.spa-libs": { + "api.alsa.*": "alsa/libspa-alsa", + "api.bluez5.*": "bluez5/libspa-bluez5", + "api.libcamera.*": "libcamera/libspa-libcamera", + "api.v4l2.*": "v4l2/libspa-v4l2" + }, + "session.modules": { + "default": [ + "flatpak", + "portal", + "v4l2", + "suspend-node", + "policy-node" + ], + "with-alsa": [ + "with-audio" + ], + "with-audio": [ + "metadata", + "default-nodes", + "default-profile", + "default-routes", + "alsa-seq", + "alsa-monitor" + ], + "with-jack": [ + "with-audio" + ], + "with-pulseaudio": [ + "with-audio", + "bluez5", + "restore-stream", + "streams-follow-default" + ] + } +} diff --git a/nixos/modules/services/desktops/pipewire/pipewire-media-session.nix b/nixos/modules/services/desktops/pipewire/pipewire-media-session.nix index 81f4762e1e6..b324bfa1b74 100644 --- a/nixos/modules/services/desktops/pipewire/pipewire-media-session.nix +++ b/nixos/modules/services/desktops/pipewire/pipewire-media-session.nix @@ -9,18 +9,36 @@ let && pkgs.stdenv.isx86_64 && pkgs.pkgsi686Linux.pipewire != null; + prioritizeNativeProtocol = { + "context.modules" = { + "libpipewire-module-protocol-native" = { + _priority = -100; + _content = null; + }; + }; + }; + + # Use upstream config files passed through spa-json-dump as the base + # Patched here as necessary for them to work with this module + defaults = { + alsa-monitor = (builtins.fromJSON (builtins.readFile ./alsa-monitor.conf.json)); + bluez-monitor = (builtins.fromJSON (builtins.readFile ./bluez-monitor.conf.json)); + media-session = recursiveUpdate (builtins.fromJSON (builtins.readFile ./media-session.conf.json)) prioritizeNativeProtocol; + v4l2-monitor = (builtins.fromJSON (builtins.readFile ./v4l2-monitor.conf.json)); + }; # Helpers for generating the pipewire JSON config file mkSPAValueString = v: if builtins.isList v then "[${lib.concatMapStringsSep " " mkSPAValueString v}]" else if lib.types.attrs.check v then "{${lib.concatStringsSep " " (mkSPAKeyValue v)}}" + else if builtins.isString v then "\"${lib.generators.mkValueStringDefault { } v}\"" else lib.generators.mkValueStringDefault { } v; mkSPAKeyValue = attrs: map (def: def.content) ( lib.sortProperties ( lib.mapAttrsToList - (k: v: lib.mkOrder (v._priority or 1000) "${lib.escape [ "=" ] k} = ${mkSPAValueString (v._content or v)}") + (k: v: lib.mkOrder (v._priority or 1000) "${lib.escape [ "=" ":" ] k} = ${mkSPAValueString (v._content or v)}") attrs ) ); @@ -51,272 +69,41 @@ in { ''; }; - config = mkOption { - type = types.attrs; - description = '' - Configuration for the media session core. - ''; - default = { - # media-session config file - properties = { - # Properties to configure the session and some - # modules - #mem.mlock-all = false; - #context.profile.modules = "default,rtkit"; - }; - - spa-libs = { - # Mapping from factory name to library. - "api.bluez5.*" = "bluez5/libspa-bluez5"; - "api.alsa.*" = "alsa/libspa-alsa"; - "api.v4l2.*" = "v4l2/libspa-v4l2"; - "api.libcamera.*" = "libcamera/libspa-libcamera"; - }; - - modules = { - # These are the modules that are enabled when a file with - # the key name is found in the media-session.d config directory. - # the default bundle is always enabled. - - default = [ - "flatpak" # manages flatpak access - "portal" # manage portal permissions - "v4l2" # video for linux udev detection - #"libcamera" # libcamera udev detection - "suspend-node" # suspend inactive nodes - "policy-node" # configure and link nodes - #"metadata" # export metadata API - #"default-nodes" # restore default nodes - #"default-profile" # restore default profiles - #"default-routes" # restore default route - #"streams-follow-default" # move streams when default changes - #"alsa-seq" # alsa seq midi support - #"alsa-monitor" # alsa udev detection - #"bluez5" # bluetooth support - #"restore-stream" # restore stream settings - ]; - "with-audio" = [ - "metadata" - "default-nodes" - "default-profile" - "default-routes" - "alsa-seq" - "alsa-monitor" - ]; - "with-alsa" = [ - "with-audio" - ]; - "with-jack" = [ - "with-audio" - ]; - "with-pulseaudio" = [ - "with-audio" - "bluez5" - "restore-stream" - "streams-follow-default" - ]; - }; + config = { + media-session = mkOption { + type = types.attrs; + description = '' + Configuration for the media session core. For details see + https://gitlab.freedesktop.org/pipewire/pipewire/-/blob/${cfg.package.version}/src/daemon/media-session.d/media-session.conf + ''; + default = {}; }; - }; - alsaMonitorConfig = mkOption { - type = types.attrs; - description = '' - Configuration for the alsa monitor. - ''; - default = { - # alsa-monitor config file - properties = { - #alsa.jack-device = true - }; - - rules = [ - # an array of matches/actions to evaluate - { - # rules for matching a device or node. It is an array of - # properties that all need to match the regexp. If any of the - # matches work, the actions are executed for the object. - matches = [ - { - # this matches all cards - device.name = "~alsa_card.*"; - } - ]; - actions = { - # actions can update properties on the matched object. - update-props = { - api.alsa.use-acp = true; - #api.alsa.use-ucm = true; - #api.alsa.soft-mixer = false; - #api.alsa.ignore-dB = false; - #device.profile-set = "profileset-name"; - #device.profile = "default profile name"; - api.acp.auto-profile = false; - api.acp.auto-port = false; - #device.nick = "My Device"; - }; - }; - } - { - matches = [ - { - # matches all sinks - node.name = "~alsa_input.*"; - } - { - # matches all sources - node.name = "~alsa_output.*"; - } - ]; - actions = { - update-props = { - #node.nick = "My Node"; - #node.nick = null; - #priority.driver = 100; - #priority.session = 100; - #node.pause-on-idle = false; - #resample.quality = 4; - #channelmix.normalize = false; - #channelmix.mix-lfe = false; - #audio.channels = 2; - #audio.format = "S16LE"; - #audio.rate = 44100; - #audio.position = "FL,FR"; - #api.alsa.period-size = 1024; - #api.alsa.headroom = 0; - #api.alsa.disable-mmap = false; - #api.alsa.disable-batch = false; - }; - }; - } - ]; + alsa-monitor = mkOption { + type = types.attrs; + description = '' + Configuration for the alsa monitor. For details see + https://gitlab.freedesktop.org/pipewire/pipewire/-/blob/${cfg.package.version}/src/daemon/media-session.d/alsa-monitor.conf + ''; + default = {}; }; - }; - bluezMonitorConfig = mkOption { - type = types.attrs; - description = '' - Configuration for the bluez5 monitor. - ''; - default = { - # bluez-monitor config file - properties = { - # msbc is not expected to work on all headset + adapter combinations. - #bluez5.msbc-support = true; - #bluez5.sbc-xq-support = true; - - # Enabled headset roles (default: [ hsp_hs hfp_ag ]), this - # property only applies to native backend. Currently some headsets - # (Sony WH-1000XM3) are not working with both hsp_ag and hfp_ag - # enabled, disable either hsp_ag or hfp_ag to work around it. - # - # Supported headset roles: hsp_hs (HSP Headset), - # hsp_ag (HSP Audio Gateway), - # hfp_ag (HFP Audio Gateway) - #bluez5.headset-roles = [ "hsp_hs" "hsp_ag" "hfp_ag" ]; - - # Enabled A2DP codecs (default: all) - #bluez5.codecs = [ "sbc" "aac" "ldac" "aptx" "aptx_hd" ]; - }; - - rules = [ - # an array of matches/actions to evaluate - { - # rules for matching a device or node. It is an array of - # properties that all need to match the regexp. If any of the - # matches work, the actions are executed for the object. - matches = [ - { - # this matches all cards - device.name = "~bluez_card.*"; - } - ]; - actions = { - # actions can update properties on the matched object. - update-props = { - #device.nick = "My Device"; - }; - }; - } - { - matches = [ - { - # matches all sinks - node.name = "~bluez_input.*"; - } - { - # matches all sources - node.name = "~bluez_output.*"; - } - ]; - actions = { - update-props = { - #node.nick = "My Node" - #node.nick = null; - #priority.driver = 100; - #priority.session = 100; - #node.pause-on-idle = false; - #resample.quality = 4; - #channelmix.normalize = false; - #channelmix.mix-lfe = false; - }; - }; - } - ]; + bluez-monitor = mkOption { + type = types.attrs; + description = '' + Configuration for the bluez5 monitor. For details see + https://gitlab.freedesktop.org/pipewire/pipewire/-/blob/${cfg.package.version}/src/daemon/media-session.d/bluez-monitor.conf + ''; + default = {}; }; - }; - v4l2MonitorConfig = mkOption { - type = types.attrs; - description = '' - Configuration for the V4L2 monitor. - ''; - default = { - # v4l2-monitor config file - properties = { - }; - - rules = [ - # an array of matches/actions to evaluate - { - # rules for matching a device or node. It is an array of - # properties that all need to match the regexp. If any of the - # matches work, the actions are executed for the object. - matches = [ - { - # this matches all devices - device.name = "~v4l2_device.*"; - } - ]; - actions = { - # actions can update properties on the matched object. - update-props = { - #device.nick = "My Device"; - }; - }; - } - { - matches = [ - { - # matches all sinks - node.name = "~v4l2_input.*"; - } - { - # matches all sources - node.name = "~v4l2_output.*"; - } - ]; - actions = { - update-props = { - #node.nick = "My Node"; - #node.nick = null; - #priority.driver = 100; - #priority.session = 100; - #node.pause-on-idle = true; - }; - }; - } - ]; + v4l2-monitor = mkOption { + type = types.attrs; + description = '' + Configuration for the V4L2 monitor. For details see + https://gitlab.freedesktop.org/pipewire/pipewire/-/blob/${cfg.package.version}/src/daemon/media-session.d/v4l2-monitor.conf + ''; + default = {}; }; }; }; @@ -325,16 +112,16 @@ in { ###### implementation config = mkIf cfg.enable { environment.systemPackages = [ cfg.package ]; - services.pipewire.sessionManagerExecutable = "${cfg.package}/bin/pipewire-media-session"; + services.pipewire.sessionManagerExecutable = builtins.unsafeDiscardStringContext "${cfg.package}/bin/pipewire-media-session"; - environment.etc."pipewire/media-session.d/media-session.conf" = { text = toSPAJSON cfg.config; }; - environment.etc."pipewire/media-session.d/v4l2-monitor.conf" = { text = toSPAJSON cfg.v4l2MonitorConfig; }; + environment.etc."pipewire/media-session.d/media-session.conf" = { text = toSPAJSON (recursiveUpdate defaults.media-session cfg.config.media-session); }; + environment.etc."pipewire/media-session.d/v4l2-monitor.conf" = { text = toSPAJSON (recursiveUpdate defaults.v4l2-monitor cfg.config.v4l2-monitor); }; environment.etc."pipewire/media-session.d/with-alsa" = mkIf config.services.pipewire.alsa.enable { text = ""; }; - environment.etc."pipewire/media-session.d/alsa-monitor.conf" = mkIf config.services.pipewire.alsa.enable { text = toSPAJSON cfg.alsaMonitorConfig; }; + environment.etc."pipewire/media-session.d/alsa-monitor.conf" = mkIf config.services.pipewire.alsa.enable { text = toSPAJSON (recursiveUpdate defaults.alsa-monitor cfg.config.alsa-monitor); }; environment.etc."pipewire/media-session.d/with-pulseaudio" = mkIf config.services.pipewire.pulse.enable { text = ""; }; - environment.etc."pipewire/media-session.d/bluez-monitor.conf" = mkIf config.services.pipewire.pulse.enable { text = toSPAJSON cfg.bluezMonitorConfig; }; + environment.etc."pipewire/media-session.d/bluez-monitor.conf" = mkIf config.services.pipewire.pulse.enable { text = toSPAJSON (recursiveUpdate defaults.bluez-monitor cfg.config.bluez-monitor); }; environment.etc."pipewire/media-session.d/with-jack" = mkIf config.services.pipewire.jack.enable { text = ""; }; }; diff --git a/nixos/modules/services/desktops/pipewire/pipewire-pulse.conf.json b/nixos/modules/services/desktops/pipewire/pipewire-pulse.conf.json new file mode 100644 index 00000000000..5fe6ec2b064 --- /dev/null +++ b/nixos/modules/services/desktops/pipewire/pipewire-pulse.conf.json @@ -0,0 +1,27 @@ +{ + "context.properties": {}, + "context.spa-libs": { + "audio.convert.*": "audioconvert/libspa-audioconvert", + "support.*": "support/libspa-support" + }, + "context.modules": { + "libpipewire-module-rtkit": { + "args": {}, + "flags": [ + "ifexists", + "nofail" + ] + }, + "libpipewire-module-protocol-native": null, + "libpipewire-module-client-node": null, + "libpipewire-module-adapter": null, + "libpipewire-module-metadata": null, + "libpipewire-module-protocol-pulse": { + "args": { + "server.address": [ + "unix:native" + ] + } + } + } +} diff --git a/nixos/modules/services/desktops/pipewire/pipewire.conf.json b/nixos/modules/services/desktops/pipewire/pipewire.conf.json new file mode 100644 index 00000000000..b8e23e04c8a --- /dev/null +++ b/nixos/modules/services/desktops/pipewire/pipewire.conf.json @@ -0,0 +1,54 @@ +{ + "context.properties": { + "link.max-buffers": 16, + "core.daemon": true, + "core.name": "pipewire-0" + }, + "context.spa-libs": { + "audio.convert.*": "audioconvert/libspa-audioconvert", + "api.alsa.*": "alsa/libspa-alsa", + "api.v4l2.*": "v4l2/libspa-v4l2", + "api.libcamera.*": "libcamera/libspa-libcamera", + "api.bluez5.*": "bluez5/libspa-bluez5", + "api.vulkan.*": "vulkan/libspa-vulkan", + "api.jack.*": "jack/libspa-jack", + "support.*": "support/libspa-support" + }, + "context.modules": { + "libpipewire-module-rtkit": { + "args": {}, + "flags": [ + "ifexists", + "nofail" + ] + }, + "libpipewire-module-protocol-native": null, + "libpipewire-module-profiler": null, + "libpipewire-module-metadata": null, + "libpipewire-module-spa-device-factory": null, + "libpipewire-module-spa-node-factory": null, + "libpipewire-module-client-node": null, + "libpipewire-module-client-device": null, + "libpipewire-module-portal": null, + "libpipewire-module-access": { + "args": {} + }, + "libpipewire-module-adapter": null, + "libpipewire-module-link-factory": null, + "libpipewire-module-session-manager": null + }, + "context.objects": { + "spa-node-factory": { + "args": { + "factory.name": "support.node.driver", + "node.name": "Dummy-Driver", + "priority.driver": 8000 + } + } + }, + "context.exec": { + "/nix/store/1q65a09arb7r4sdfz657p473kn3lqknk-pipewire-0.3.22/bin/pipewire-media-session": { + "args": "" + } + } +} diff --git a/nixos/modules/services/desktops/pipewire/pipewire.nix b/nixos/modules/services/desktops/pipewire/pipewire.nix index 044120de7c7..77aa7043ee4 100644 --- a/nixos/modules/services/desktops/pipewire/pipewire.nix +++ b/nixos/modules/services/desktops/pipewire/pipewire.nix @@ -18,11 +18,40 @@ let ln -s "${cfg.package.jack}/lib" "$out/lib/pipewire" ''; + prioritizeNativeProtocol = { + "context.modules" = { + "libpipewire-module-protocol-native" = { + _priority = -100; + _content = null; + }; + }; + }; + + sessionManagerInvocation = { + "context.exec" = { + "${cfg.sessionManagerExecutable}" = { + args = "${lib.concatStringsSep " " cfg.sessionManagerArguments}"; + }; + }; + }; + + # Use upstream config files passed through spa-json-dump as the base + # Patched here as necessary for them to work with this module + defaults = { + client = recursiveUpdate (builtins.fromJSON (builtins.readFile ./client.conf.json)) prioritizeNativeProtocol; + client-rt = recursiveUpdate (builtins.fromJSON (builtins.readFile ./client-rt.conf.json)) prioritizeNativeProtocol; + jack = recursiveUpdate (builtins.fromJSON (builtins.readFile ./jack.conf.json)) prioritizeNativeProtocol; + # Remove session manager invocation from the upstream generated file, it points to the wrong path + pipewire = recursiveUpdate ((removeAttrs (builtins.fromJSON (builtins.readFile ./pipewire.conf.json)) ["context.exec"]) // sessionManagerInvocation) prioritizeNativeProtocol; + pipewire-pulse = recursiveUpdate (builtins.fromJSON (builtins.readFile ./pipewire-pulse.conf.json)) prioritizeNativeProtocol; + }; + # Helpers for generating the pipewire JSON config file mkSPAValueString = v: if builtins.isList v then "[${lib.concatMapStringsSep " " mkSPAValueString v}]" else if lib.types.attrs.check v then "{${lib.concatStringsSep " " (mkSPAKeyValue v)}}" + else if builtins.isString v then "\"${lib.generators.mkValueStringDefault { } v}\"" else lib.generators.mkValueStringDefault { } v; mkSPAKeyValue = attrs: map (def: def.content) ( @@ -64,110 +93,50 @@ in { ''; }; - config = mkOption { - type = types.attrs; - description = '' - Configuration for the pipewire daemon. - ''; - default = { - properties = { - ## set-prop is used to configure properties in the system - # - # "library.name.system" = "support/libspa-support"; - # "context.data-loop.library.name.system" = "support/libspa-support"; - "link.max-buffers" = 16; # version < 3 clients can't handle more than 16 - #"mem.allow-mlock" = false; - #"mem.mlock-all" = true; - ## https://gitlab.freedesktop.org/pipewire/pipewire/-/blob/master/src/pipewire/pipewire.h#L93 - #"log.level" = 2; # 5 is trace, which is verbose as hell, default is 2 which is warnings, 4 is debug output, 3 is info + config = { + client = mkOption { + type = types.attrs; + default = {}; + description = '' + Configuration for pipewire clients. For details see + https://gitlab.freedesktop.org/pipewire/pipewire/-/blob/${cfg.package.version}/src/daemon/client.conf.in + ''; + }; - ## Properties for the DSP configuration - # - #"default.clock.rate" = 48000; - #"default.clock.quantum" = 1024; - #"default.clock.min-quantum" = 32; - #"default.clock.max-quantum" = 8192; - #"default.video.width" = 640; - #"default.video.height" = 480; - #"default.video.rate.num" = 25; - #"default.video.rate.denom" = 1; - }; + client-rt = mkOption { + type = types.attrs; + default = {}; + description = '' + Configuration for realtime pipewire clients. For details see + https://gitlab.freedesktop.org/pipewire/pipewire/-/blob/${cfg.package.version}/src/daemon/client-rt.conf.in + ''; + }; - spa-libs = { - ## add-spa-lib - # - # used to find spa factory names. It maps an spa factory name - # regular expression to a library name that should contain - # that factory. - # - "audio.convert*" = "audioconvert/libspa-audioconvert"; - "api.alsa.*" = "alsa/libspa-alsa"; - "api.v4l2.*" = "v4l2/libspa-v4l2"; - "api.libcamera.*" = "libcamera/libspa-libcamera"; - "api.bluez5.*" = "bluez5/libspa-bluez5"; - "api.vulkan.*" = "vulkan/libspa-vulkan"; - "api.jack.*" = "jack/libspa-jack"; - "support.*" = "support/libspa-support"; - # "videotestsrc" = "videotestsrc/libspa-videotestsrc"; - # "audiotestsrc" = "audiotestsrc/libspa-audiotestsrc"; - }; + jack = mkOption { + type = types.attrs; + default = {}; + description = '' + Configuration for the pipewire daemon's jack module. For details see + https://gitlab.freedesktop.org/pipewire/pipewire/-/blob/${cfg.package.version}/src/daemon/jack.conf.in + ''; + }; - modules = { - ## = { [args = "= ..."] - # [flags = ifexists] } - # [flags = [ifexists]|[nofail]} - # - # Loads a module with the given parameters. - # If ifexists is given, the module is ignoed when it is not found. - # If nofail is given, module initialization failures are ignored. - # - libpipewire-module-rtkit = { - args = { - #rt.prio = 20; - #rt.time.soft = 200000; - #rt.time.hard = 200000; - #nice.level = -11; - }; - flags = "ifexists|nofail"; - }; - libpipewire-module-protocol-native = { _priority = -100; _content = "null"; }; - libpipewire-module-profiler = "null"; - libpipewire-module-metadata = "null"; - libpipewire-module-spa-device-factory = "null"; - libpipewire-module-spa-node-factory = "null"; - libpipewire-module-client-node = "null"; - libpipewire-module-client-device = "null"; - libpipewire-module-portal = "null"; - libpipewire-module-access = { - args.access = { - allowed = ["${builtins.unsafeDiscardStringContext cfg.sessionManagerExecutable}"]; - rejected = []; - restricted = []; - force = "flatpak"; - }; - }; - libpipewire-module-adapter = "null"; - libpipewire-module-link-factory = "null"; - libpipewire-module-session-manager = "null"; - }; + pipewire = mkOption { + type = types.attrs; + default = {}; + description = '' + Configuration for the pipewire daemon. For details see + https://gitlab.freedesktop.org/pipewire/pipewire/-/blob/${cfg.package.version}/src/daemon/pipewire.conf.in + ''; + }; - objects = { - ## create-object [-nofail] [= ...] - # - # Creates an object from a PipeWire factory with the given parameters. - # If -nofail is given, errors are ignored (and no object is created) - # - }; - - - exec = { - ## exec - # - # Execute the given program. This is usually used to start the - # session manager. run the session manager with -h for options - # - "${builtins.unsafeDiscardStringContext cfg.sessionManagerExecutable}" = { args = "\"${lib.concatStringsSep " " cfg.sessionManagerArguments}\""; }; - }; + pipewire-pulse = mkOption { + type = types.attrs; + default = {}; + description = '' + Configuration for the pipewire-pulse daemon. For details see + https://gitlab.freedesktop.org/pipewire/pipewire/-/blob/${cfg.package.version}/src/daemon/pipewire-pulse.conf.in + ''; }; }; @@ -253,13 +222,16 @@ in { source = "${cfg.package}/share/alsa/alsa.conf.d/99-pipewire-default.conf"; }; + environment.etc."pipewire/client.conf" = { text = toSPAJSON (recursiveUpdate defaults.client cfg.config.client); }; + environment.etc."pipewire/client-rt.conf" = { text = toSPAJSON (recursiveUpdate defaults.client-rt cfg.config.client-rt); }; + environment.etc."pipewire/jack.conf" = { text = toSPAJSON (recursiveUpdate defaults.jack cfg.config.jack); }; + environment.etc."pipewire/pipewire.conf" = { text = toSPAJSON (recursiveUpdate defaults.pipewire cfg.config.pipewire); }; + environment.etc."pipewire/pipewire-pulse.conf" = { text = toSPAJSON (recursiveUpdate defaults.pipewire-pulse cfg.config.pipewire-pulse); }; + environment.sessionVariables.LD_LIBRARY_PATH = lib.optional cfg.jack.enable "/run/current-system/sw/lib/pipewire"; # https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/464#note_723554 - systemd.user.services.pipewire.environment = { - "PIPEWIRE_LINK_PASSIVE" = "1"; - "PIPEWIRE_CONFIG_FILE" = pkgs.writeText "pipewire.conf" (toSPAJSON cfg.config); - }; + systemd.user.services.pipewire.environment."PIPEWIRE_LINK_PASSIVE" = "1"; }; } diff --git a/nixos/modules/services/desktops/pipewire/v4l2-monitor.conf.json b/nixos/modules/services/desktops/pipewire/v4l2-monitor.conf.json new file mode 100644 index 00000000000..ca404fabbfc --- /dev/null +++ b/nixos/modules/services/desktops/pipewire/v4l2-monitor.conf.json @@ -0,0 +1,38 @@ +{ + "properties": {}, + "rules": [ + { + "actions": { + "update-props": {} + }, + "matches": [ + { + "device": { + "name": "~v4l2_device.*" + } + } + ] + }, + { + "actions": { + "update-props": { + "node": { + "pause-on-idle": false + } + } + }, + "matches": [ + { + "node": { + "name": "~v4l2_input.*" + } + }, + { + "node": { + "name": "~v4l2_output.*" + } + } + ] + } + ] +} diff --git a/pkgs/development/libraries/pipewire/default.nix b/pkgs/development/libraries/pipewire/default.nix index fc566d91e91..8dd94f4ba13 100644 --- a/pkgs/development/libraries/pipewire/default.nix +++ b/pkgs/development/libraries/pipewire/default.nix @@ -17,6 +17,7 @@ , udev , libva , libsndfile +, SDL2 , vulkan-headers , vulkan-loader , ncurses @@ -42,7 +43,7 @@ let self = stdenv.mkDerivation rec { pname = "pipewire"; - version = "0.3.21"; + version = "0.3.22"; outputs = [ "out" @@ -60,7 +61,7 @@ let owner = "pipewire"; repo = "pipewire"; rev = version; - hash = "sha256:2YJzPTMPIoQQeNja3F53SD4gtpdSlbD/i77hBWiQfuQ="; + hash = "sha256:6SEOUivyehccVR5zt79Qw2rjN2KcO5x3TEejXVxRlvs="; }; patches = [ @@ -72,6 +73,94 @@ let ./pipewire-pulse-path.patch # Add flag to specify configuration directory (different from the installation directory). ./pipewire-config-dir.patch + + # Various quality of life improvements that didn't make it into 0.3.22 + (fetchpatch { + name = "0001-bluez5-include-a2dp-codec-profiles-in-route-profiles.patch"; + url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/df1dbee687c819095a6fddce3b24943f9ac47dbc.patch"; + sha256 = "sha256-MesteaIcfKMr53TdObEfqRyKEgalB1GEWpsTexawPgg="; + }) + (fetchpatch { + name = "0001-pulse-server-don-t-use-the-pending_sample-after-free.patch"; + url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/72acd752f68a35c40641262be1c69014170d0734.patch"; + sha256 = "sha256-F3+aVfOYH4SLTwWhdIKuNUo85NBoS+67vkUrcsaldSs="; + }) + ./patches-0.3.22/0005-fix-some-warnings.patch + (fetchpatch { + name = "0006-spa-escape-double-quotes.patch"; + url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/6a219092818a7a7e357441256d8070ae77ac2d3a.patch"; + sha256 = "sha256-NUjxOSthe3Jw2LUrO11QnTWTx0PQNBJkQSv3ux58jZw="; + }) + (fetchpatch { + name = "0009-bluez5-volumes-need-to-be-distributed-to-all-channel.patch"; + url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/8c5ca000ef7fddd9be9cd2211d880736e97b956d.patch"; + sha256 = "sha256-9NhbYSXlNOYmoPg8tj561QHisaD216fBG7ccNIfoZ64="; + }) + (fetchpatch { + name = "0010-bluez5-set-the-right-volumes-on-the-node.patch"; + url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/930b411075a5c1b0d9ddcfe7dd2dbfdc27baab90.patch"; + sha256 = "sha256-xsL92H8wSrBzoxLtraCVxPZdXWTwj+j+O2XlfhcJ7IQ="; + }) + (fetchpatch { + name = "0011-bluez5-backend-native-Check-volume-values.patch"; + url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/7a5a94470453e0cbd3a087b1be2aa8960ff43c07.patch"; + sha256 = "sha256-HKWcfkwMmmlEB7l+SETJDsUZ2eLggcodtbNOpqY/wWY="; + }) + (fetchpatch { + name = "0012-media-session-don-t-switch-to-pro-audio-by-default.patch"; + url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/84fc63e60168e2c2f43875423899b4ae3bd89a7b.patch"; + sha256 = "sha256-tZwgBMZS+HJd0lrRji3aevbP/yJfvWYK60KMpfiFrOY="; + }) + (fetchpatch { + name = "0013-audioconvert-keep-better-track-of-param-changes.patch"; + url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/44919c83fc51aa5e1a22c903e841897c1b4d274c.patch"; + sha256 = "sha256-DIZUfEjUCaK4yY3k7/KLHv1igTKz6Ek4QbWECs1sr9E="; + }) + (fetchpatch { + name = "0018-pulse-server-print-encoding-name-in-format_info.patch"; + url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/4b591df145afa316e8e047764f9b98fc10cbacd9.patch"; + sha256 = "sha256-Dr6w6tI4R+6wrl0rVk9Eifw3YleuisVmXzsv+H2jtXc="; + }) + (fetchpatch { + name = "0019-pulse-server-handle-unsupported-formats.patch"; + url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/fcf00b3d352d931446a384a768b999520662b599.patch"; + sha256 = "sha256-kQ3vRoojLVTOJi8V4eODkZC8agsla2PjKf6sJnm/1C4="; + }) + (fetchpatch { + name = "0021-jack-handle-client-init-error-with-EIO.patch"; + url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/715a3a642a4f1c1f624e0a9dc0394b1819b69f93.patch"; + sha256 = "sha256-DglHcH9pHSWuVxZuLt8J+gDmxOaQSoiThVE2wePfH1I="; + }) + (fetchpatch { + name = "0022-pw-cli-always-output-to-stdout.patch"; + url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/91875c1fd8ece6b1b94130c50304b715654f8681.patch"; + sha256 = "sha256-3Sf/Tr39bdBihq/CFborm7GcBWtSvqO3KtRtFBcHcmc="; + }) + (fetchpatch { + name = "0024-policy-node-don-t-crash-without-metadata.patch"; + url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/3673265ae20d7b59e89cad6c5238c232796731b2.patch"; + sha256 = "sha256-YRdh1gqBYqa+sbSfHuJZ+Xc6w4QTOOpt/fppFNxsj+8="; + }) + (fetchpatch { + name = "0025-bluez5-route-shouldn-t-list-a2dp-profiles-when-not-c.patch"; + url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/a5dc2493dfccfc168cef01162f38f90e986b8af4.patch"; + sha256 = "sha256-zu7zqHIMOcxLAhvelKNWDB+804x+ocCo5FAMUSSOnVo="; + }) + (fetchpatch { + name = "0027-jack-apply-PIPEWIRE_PROPS-after-reading-config.patch"; + url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/149319819aa5d4e39770c35a0c00f6c2963e2bf3.patch"; + sha256 = "sha256-SwKQJkg8NIL9D0GAL6hnEgi8kvuToo1bpDm52adtKxA="; + }) + (fetchpatch { + name = "0038-jack-add-config-option-to-shorten-and-filter-names.patch"; + url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/d54da879bf5f9fa9009e1ab27e8d52eae3141764.patch"; + sha256 = "sha256-iYOmZTWNODHYWpYGfRTQhBLV1HeFOUvHN3Ta0f1ZS8M="; + }) + (fetchpatch { + name = "0046-jack-fix-names-of-our-ports.patch"; + url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/e340a44a357e4550e169bc8825c6aa8b4ceb76db.patch"; + sha256 = "sha256-rfv2IzgYyNB1s51eRFhJzZCyso6PIEj2qg9fpPpOZ5Q="; + }) ]; nativeBuildInputs = [ @@ -93,6 +182,7 @@ let vulkan-headers vulkan-loader valgrind + SDL2 systemd ] ++ lib.optionals gstreamerSupport [ gst_all_1.gst-plugins-base gst_all_1.gstreamer ] ++ lib.optional ffmpegSupport ffmpeg @@ -122,10 +212,17 @@ let doCheck = true; postInstall = '' + mkdir -p $out/nix-support/etc/pipewire/media-session. + for f in etc/pipewire/*.conf; do $out/bin/spa-json-dump "$f" > "$out/nix-support/$f.json"; done + moveToOutput "share/systemd/user/pipewire-pulse.*" "$pulse" moveToOutput "lib/systemd/user/pipewire-pulse.*" "$pulse" moveToOutput "bin/pipewire-pulse" "$pulse" + + mkdir -p $mediaSession/nix-support/etc/pipewire/media-session.d + for f in etc/pipewire/media-session.d/*.conf; do $out/bin/spa-json-dump "$f" > "$mediaSession/nix-support/$f.json"; done moveToOutput "bin/pipewire-media-session" "$mediaSession" + moveToOutput "etc/pipewire/media-session.d/*.conf" "$mediaSession" ''; passthru.tests = { @@ -135,6 +232,17 @@ let test-paths = callPackage ./test-paths.nix { paths-out = [ "share/alsa/alsa.conf.d/50-pipewire.conf" + "nix-support/etc/pipewire/client.conf.json" + "nix-support/etc/pipewire/client-rt.conf.json" + "nix-support/etc/pipewire/jack.conf.json" + "nix-support/etc/pipewire/pipewire.conf.json" + "nix-support/etc/pipewire/pipewire-pulse.conf.json" + ]; + paths-out-media-session = [ + "nix-support/etc/pipewire/media-session.d/alsa-monitor.conf.json" + "nix-support/etc/pipewire/media-session.d/bluez-monitor.conf.json" + "nix-support/etc/pipewire/media-session.d/media-session.conf.json" + "nix-support/etc/pipewire/media-session.d/v4l2-monitor.conf.json" ]; paths-lib = [ "lib/alsa-lib/libasound_module_pcm_pipewire.so" diff --git a/pkgs/development/libraries/pipewire/patches-0.3.22/0005-fix-some-warnings.patch b/pkgs/development/libraries/pipewire/patches-0.3.22/0005-fix-some-warnings.patch new file mode 100644 index 00000000000..56987bf4d1d --- /dev/null +++ b/pkgs/development/libraries/pipewire/patches-0.3.22/0005-fix-some-warnings.patch @@ -0,0 +1,23 @@ +From 63a3811aa76802e9585e04cf12bf8de617442105 Mon Sep 17 00:00:00 2001 +From: Wim Taymans +Date: Thu, 18 Feb 2021 12:42:06 +0100 +Subject: [PATCH 05/30] fix some warnings + +--- + spa/plugins/bluez5/backend-native.c | 2 +- + src/examples/media-session/default-routes.c | 18 +++++++++++++----- + 2 files changed, 14 insertions(+), 6 deletions(-) + +diff --git a/spa/plugins/bluez5/backend-native.c b/spa/plugins/bluez5/backend-native.c +index 4df714088..b4d4e5edf 100644 +--- a/spa/plugins/bluez5/backend-native.c ++++ b/spa/plugins/bluez5/backend-native.c +@@ -437,7 +437,7 @@ static bool rfcomm_hfp_hf(struct spa_source *source, char* buf) + struct rfcomm *rfcomm = source->data; + struct spa_bt_backend *backend = rfcomm->backend; + unsigned int features; +- unsigned int gain; ++ unsigned int SPA_UNUSED gain; + unsigned int selected_codec; + char* token; + char separators[] = "\r\n:"; diff --git a/pkgs/development/libraries/pipewire/test-paths.nix b/pkgs/development/libraries/pipewire/test-paths.nix index 0ae69374194..11d00e7c2ca 100644 --- a/pkgs/development/libraries/pipewire/test-paths.nix +++ b/pkgs/development/libraries/pipewire/test-paths.nix @@ -14,6 +14,7 @@ let in runCommand "pipewire-test-paths" { } '' touch $out + ${check-output pipewire.mediaSession paths-out-media-session} ${check-output pipewire.lib paths-lib} ${check-output pipewire paths-out} From b012ecaae7a273a9b09adbf608f7bf44374b8869 Mon Sep 17 00:00:00 2001 From: Jan Solanti Date: Fri, 5 Mar 2021 00:41:02 +0200 Subject: [PATCH 12/20] pipewire: 0.3.22 -> 0.3.23 --- .../desktops/pipewire/alsa-monitor.conf.json | 48 +++---- .../desktops/pipewire/bluez-monitor.conf.json | 36 ++--- .../desktops/pipewire/client-rt.conf.json | 8 +- .../desktops/pipewire/client.conf.json | 8 +- .../services/desktops/pipewire/jack.conf.json | 4 +- .../desktops/pipewire/media-session.conf.json | 30 ++--- .../pipewire/pipewire-media-session.nix | 3 +- .../pipewire/pipewire-pulse.conf.json | 3 +- .../desktops/pipewire/pipewire.conf.json | 13 +- .../services/desktops/pipewire/pipewire.nix | 41 +++--- .../desktops/pipewire/v4l2-monitor.conf.json | 36 ++--- ...ch => 0040-alsa-profiles-use-libdir.patch} | 0 ...h.patch => 0050-pipewire-pulse-path.patch} | 10 +- .../0055-pipewire-media-session-path.patch | 27 ++++ ....patch => 0070-installed-tests-path.patch} | 0 ...r.patch => 0080-pipewire-config-dir.patch} | 0 .../libraries/pipewire/default.nix | 125 ++++-------------- .../0005-fix-some-warnings.patch | 23 ---- 18 files changed, 159 insertions(+), 256 deletions(-) rename pkgs/development/libraries/pipewire/{alsa-profiles-use-libdir.patch => 0040-alsa-profiles-use-libdir.patch} (100%) rename pkgs/development/libraries/pipewire/{pipewire-pulse-path.patch => 0050-pipewire-pulse-path.patch} (78%) create mode 100644 pkgs/development/libraries/pipewire/0055-pipewire-media-session-path.patch rename pkgs/development/libraries/pipewire/{installed-tests-path.patch => 0070-installed-tests-path.patch} (100%) rename pkgs/development/libraries/pipewire/{pipewire-config-dir.patch => 0080-pipewire-config-dir.patch} (100%) delete mode 100644 pkgs/development/libraries/pipewire/patches-0.3.22/0005-fix-some-warnings.patch diff --git a/nixos/modules/services/desktops/pipewire/alsa-monitor.conf.json b/nixos/modules/services/desktops/pipewire/alsa-monitor.conf.json index 5e8e1de6986..53fc9cc9634 100644 --- a/nixos/modules/services/desktops/pipewire/alsa-monitor.conf.json +++ b/nixos/modules/services/desktops/pipewire/alsa-monitor.conf.json @@ -2,47 +2,33 @@ "properties": {}, "rules": [ { - "actions": { - "update-props": { - "api": { - "acp": { - "auto-port": false, - "auto-profile": false - }, - "alsa": { - "use-acp": true - } - } - } - }, "matches": [ { - "device": { - "name": "~alsa_card.*" - } + "device.name": "~alsa_card.*" } - ] + ], + "actions": { + "update-props": { + "api.alsa.use-acp": true, + "api.acp.auto-profile": false, + "api.acp.auto-port": false + } + } }, { - "actions": { - "update-props": { - "node": { - "pause-on-idle": false - } - } - }, "matches": [ { - "node": { - "name": "~alsa_input.*" - } + "node.name": "~alsa_input.*" }, { - "node": { - "name": "~alsa_output.*" - } + "node.name": "~alsa_output.*" } - ] + ], + "actions": { + "update-props": { + "node.pause-on-idle": false + } + } } ] } diff --git a/nixos/modules/services/desktops/pipewire/bluez-monitor.conf.json b/nixos/modules/services/desktops/pipewire/bluez-monitor.conf.json index d8f74f32943..4d50cb9f1ad 100644 --- a/nixos/modules/services/desktops/pipewire/bluez-monitor.conf.json +++ b/nixos/modules/services/desktops/pipewire/bluez-monitor.conf.json @@ -2,37 +2,29 @@ "properties": {}, "rules": [ { + "matches": [ + { + "device.name": "~bluez_card.*" + } + ], "actions": { "update-props": {} - }, - "matches": [ - { - "device": { - "name": "~bluez_card.*" - } - } - ] + } }, { - "actions": { - "update-props": { - "node": { - "pause-on-idle": false - } - } - }, "matches": [ { - "node": { - "name": "~bluez_input.*" - } + "node.name": "~bluez_input.*" }, { - "node": { - "name": "~bluez_output.*" - } + "node.name": "~bluez_output.*" } - ] + ], + "actions": { + "update-props": { + "node.pause-on-idle": false + } + } } ] } diff --git a/nixos/modules/services/desktops/pipewire/client-rt.conf.json b/nixos/modules/services/desktops/pipewire/client-rt.conf.json index 701b1916599..d294927b4f6 100644 --- a/nixos/modules/services/desktops/pipewire/client-rt.conf.json +++ b/nixos/modules/services/desktops/pipewire/client-rt.conf.json @@ -1,5 +1,7 @@ { - "context.properties": {}, + "context.properties": { + "log.level": 0 + }, "context.spa-libs": { "audio.convert.*": "audioconvert/libspa-audioconvert", "support.*": "support/libspa-support" @@ -18,5 +20,7 @@ "libpipewire-module-adapter": null, "libpipewire-module-metadata": null, "libpipewire-module-session-manager": null - } + }, + "filter.properties": {}, + "stream.properties": {} } diff --git a/nixos/modules/services/desktops/pipewire/client.conf.json b/nixos/modules/services/desktops/pipewire/client.conf.json index 24c10309329..224938abbbc 100644 --- a/nixos/modules/services/desktops/pipewire/client.conf.json +++ b/nixos/modules/services/desktops/pipewire/client.conf.json @@ -1,5 +1,7 @@ { - "context.properties": {}, + "context.properties": { + "log.level": 0 + }, "context.spa-libs": { "audio.convert.*": "audioconvert/libspa-audioconvert", "support.*": "support/libspa-support" @@ -11,5 +13,7 @@ "libpipewire-module-adapter": null, "libpipewire-module-metadata": null, "libpipewire-module-session-manager": null - } + }, + "filter.properties": {}, + "stream.properties": {} } diff --git a/nixos/modules/services/desktops/pipewire/jack.conf.json b/nixos/modules/services/desktops/pipewire/jack.conf.json index 0219269f615..2de04036b31 100644 --- a/nixos/modules/services/desktops/pipewire/jack.conf.json +++ b/nixos/modules/services/desktops/pipewire/jack.conf.json @@ -1,5 +1,7 @@ { - "context.properties": {}, + "context.properties": { + "log.level": 0 + }, "context.spa-libs": { "support.*": "support/libspa-support" }, diff --git a/nixos/modules/services/desktops/pipewire/media-session.conf.json b/nixos/modules/services/desktops/pipewire/media-session.conf.json index a8fc2d93fb0..4b2505ff816 100644 --- a/nixos/modules/services/desktops/pipewire/media-session.conf.json +++ b/nixos/modules/services/desktops/pipewire/media-session.conf.json @@ -1,10 +1,12 @@ { + "context.properties": {}, + "context.spa-libs": { + "api.bluez5.*": "bluez5/libspa-bluez5", + "api.alsa.*": "alsa/libspa-alsa", + "api.v4l2.*": "v4l2/libspa-v4l2", + "api.libcamera.*": "libcamera/libspa-libcamera" + }, "context.modules": { - "libpipewire-module-protocol-native": null, - "libpipewire-module-adapter": null, - "libpipewire-module-client-device": null, - "libpipewire-module-client-node": null, - "libpipewire-module-metadata": null, "libpipewire-module-rtkit": { "args": {}, "flags": [ @@ -12,15 +14,13 @@ "nofail" ] }, + "libpipewire-module-protocol-native": null, + "libpipewire-module-client-node": null, + "libpipewire-module-client-device": null, + "libpipewire-module-adapter": null, + "libpipewire-module-metadata": null, "libpipewire-module-session-manager": null }, - "context.properties": {}, - "context.spa-libs": { - "api.alsa.*": "alsa/libspa-alsa", - "api.bluez5.*": "bluez5/libspa-bluez5", - "api.libcamera.*": "libcamera/libspa-libcamera", - "api.v4l2.*": "v4l2/libspa-v4l2" - }, "session.modules": { "default": [ "flatpak", @@ -29,9 +29,6 @@ "suspend-node", "policy-node" ], - "with-alsa": [ - "with-audio" - ], "with-audio": [ "metadata", "default-nodes", @@ -40,6 +37,9 @@ "alsa-seq", "alsa-monitor" ], + "with-alsa": [ + "with-audio" + ], "with-jack": [ "with-audio" ], diff --git a/nixos/modules/services/desktops/pipewire/pipewire-media-session.nix b/nixos/modules/services/desktops/pipewire/pipewire-media-session.nix index b324bfa1b74..b41ea349fb8 100644 --- a/nixos/modules/services/desktops/pipewire/pipewire-media-session.nix +++ b/nixos/modules/services/desktops/pipewire/pipewire-media-session.nix @@ -112,7 +112,8 @@ in { ###### implementation config = mkIf cfg.enable { environment.systemPackages = [ cfg.package ]; - services.pipewire.sessionManagerExecutable = builtins.unsafeDiscardStringContext "${cfg.package}/bin/pipewire-media-session"; + systemd.packages = [ cfg.package ]; + systemd.user.services.pipewire-media-session.wantedBy = [ "pipewire.service" ]; environment.etc."pipewire/media-session.d/media-session.conf" = { text = toSPAJSON (recursiveUpdate defaults.media-session cfg.config.media-session); }; environment.etc."pipewire/media-session.d/v4l2-monitor.conf" = { text = toSPAJSON (recursiveUpdate defaults.v4l2-monitor cfg.config.v4l2-monitor); }; diff --git a/nixos/modules/services/desktops/pipewire/pipewire-pulse.conf.json b/nixos/modules/services/desktops/pipewire/pipewire-pulse.conf.json index 5fe6ec2b064..da08bcea2c9 100644 --- a/nixos/modules/services/desktops/pipewire/pipewire-pulse.conf.json +++ b/nixos/modules/services/desktops/pipewire/pipewire-pulse.conf.json @@ -23,5 +23,6 @@ ] } } - } + }, + "stream.properties": {} } diff --git a/nixos/modules/services/desktops/pipewire/pipewire.conf.json b/nixos/modules/services/desktops/pipewire/pipewire.conf.json index b8e23e04c8a..59e2afca093 100644 --- a/nixos/modules/services/desktops/pipewire/pipewire.conf.json +++ b/nixos/modules/services/desktops/pipewire/pipewire.conf.json @@ -29,7 +29,12 @@ "libpipewire-module-spa-node-factory": null, "libpipewire-module-client-node": null, "libpipewire-module-client-device": null, - "libpipewire-module-portal": null, + "libpipewire-module-portal": { + "flags": [ + "ifexists", + "nofail" + ] + }, "libpipewire-module-access": { "args": {} }, @@ -46,9 +51,5 @@ } } }, - "context.exec": { - "/nix/store/1q65a09arb7r4sdfz657p473kn3lqknk-pipewire-0.3.22/bin/pipewire-media-session": { - "args": "" - } - } + "context.exec": {} } diff --git a/nixos/modules/services/desktops/pipewire/pipewire.nix b/nixos/modules/services/desktops/pipewire/pipewire.nix index 77aa7043ee4..2577e77c4a1 100644 --- a/nixos/modules/services/desktops/pipewire/pipewire.nix +++ b/nixos/modules/services/desktops/pipewire/pipewire.nix @@ -20,6 +20,7 @@ let prioritizeNativeProtocol = { "context.modules" = { + # Most other modules depend on this, so put it first "libpipewire-module-protocol-native" = { _priority = -100; _content = null; @@ -27,10 +28,22 @@ let }; }; - sessionManagerInvocation = { - "context.exec" = { - "${cfg.sessionManagerExecutable}" = { - args = "${lib.concatStringsSep " " cfg.sessionManagerArguments}"; + fixDaemonModulePriorities = { + "context.modules" = { + # Most other modules depend on thism so put it first + "libpipewire-module-protocol-native" = { + _priority = -100; + _content = null; + }; + # Needs to be before libpipewire-module-access + "libpipewire-module-portal" = { + _priority = -50; + _content = { + flags = [ + "ifexists" + "nofail" + ]; + }; }; }; }; @@ -42,7 +55,7 @@ let client-rt = recursiveUpdate (builtins.fromJSON (builtins.readFile ./client-rt.conf.json)) prioritizeNativeProtocol; jack = recursiveUpdate (builtins.fromJSON (builtins.readFile ./jack.conf.json)) prioritizeNativeProtocol; # Remove session manager invocation from the upstream generated file, it points to the wrong path - pipewire = recursiveUpdate ((removeAttrs (builtins.fromJSON (builtins.readFile ./pipewire.conf.json)) ["context.exec"]) // sessionManagerInvocation) prioritizeNativeProtocol; + pipewire = recursiveUpdate (builtins.fromJSON (builtins.readFile ./pipewire.conf.json)) fixDaemonModulePriorities; pipewire-pulse = recursiveUpdate (builtins.fromJSON (builtins.readFile ./pipewire-pulse.conf.json)) prioritizeNativeProtocol; }; @@ -140,24 +153,6 @@ in { }; }; - sessionManagerExecutable = mkOption { - type = types.str; - default = ""; - example = literalExample ''${pkgs.pipewire.mediaSession}/bin/pipewire-media-session''; - description = '' - Path to the session manager executable. - ''; - }; - - sessionManagerArguments = mkOption { - type = types.listOf types.str; - default = []; - example = literalExample ''["-p" "bluez5.msbc-support=true"]''; - description = '' - Arguments passed to the pipewire session manager. - ''; - }; - alsa = { enable = mkEnableOption "ALSA support"; support32Bit = mkEnableOption "32-bit ALSA support on 64-bit systems"; diff --git a/nixos/modules/services/desktops/pipewire/v4l2-monitor.conf.json b/nixos/modules/services/desktops/pipewire/v4l2-monitor.conf.json index ca404fabbfc..b08cba1b604 100644 --- a/nixos/modules/services/desktops/pipewire/v4l2-monitor.conf.json +++ b/nixos/modules/services/desktops/pipewire/v4l2-monitor.conf.json @@ -2,37 +2,29 @@ "properties": {}, "rules": [ { + "matches": [ + { + "device.name": "~v4l2_device.*" + } + ], "actions": { "update-props": {} - }, - "matches": [ - { - "device": { - "name": "~v4l2_device.*" - } - } - ] + } }, { - "actions": { - "update-props": { - "node": { - "pause-on-idle": false - } - } - }, "matches": [ { - "node": { - "name": "~v4l2_input.*" - } + "node.name": "~v4l2_input.*" }, { - "node": { - "name": "~v4l2_output.*" - } + "node.name": "~v4l2_output.*" } - ] + ], + "actions": { + "update-props": { + "node.pause-on-idle": false + } + } } ] } diff --git a/pkgs/development/libraries/pipewire/alsa-profiles-use-libdir.patch b/pkgs/development/libraries/pipewire/0040-alsa-profiles-use-libdir.patch similarity index 100% rename from pkgs/development/libraries/pipewire/alsa-profiles-use-libdir.patch rename to pkgs/development/libraries/pipewire/0040-alsa-profiles-use-libdir.patch diff --git a/pkgs/development/libraries/pipewire/pipewire-pulse-path.patch b/pkgs/development/libraries/pipewire/0050-pipewire-pulse-path.patch similarity index 78% rename from pkgs/development/libraries/pipewire/pipewire-pulse-path.patch rename to pkgs/development/libraries/pipewire/0050-pipewire-pulse-path.patch index 99782e1bb21..4a6b21dd431 100644 --- a/pkgs/development/libraries/pipewire/pipewire-pulse-path.patch +++ b/pkgs/development/libraries/pipewire/0050-pipewire-pulse-path.patch @@ -1,19 +1,19 @@ diff --git a/meson_options.txt b/meson_options.txt -index 050a4c31..c481e76c 100644 +index ce364d93..a6c8af72 100644 --- a/meson_options.txt +++ b/meson_options.txt -@@ -148,6 +148,9 @@ option('udev', +@@ -152,6 +152,9 @@ option('udev', option('udevrulesdir', type : 'string', description : 'Directory for udev rules (defaults to /lib/udev/rules.d)') +option('pipewire_pulse_prefix', + type : 'string', -+ description : 'Install directory for the pipewire-pulse daemon') ++ description: 'Install directory for the pipewire-pulse daemon') option('systemd-user-unit-dir', type : 'string', description : 'Directory for user systemd units (defaults to /usr/lib/systemd/user)') diff --git a/src/daemon/systemd/user/meson.build b/src/daemon/systemd/user/meson.build -index 46dfbbc8..0d975cec 100644 +index 0a5e5042..4a70b0b0 100644 --- a/src/daemon/systemd/user/meson.build +++ b/src/daemon/systemd/user/meson.build @@ -9,7 +9,7 @@ install_data( @@ -22,6 +22,6 @@ index 46dfbbc8..0d975cec 100644 systemd_config.set('PW_BINARY', join_paths(pipewire_bindir, 'pipewire')) -systemd_config.set('PW_PULSE_BINARY', join_paths(pipewire_bindir, 'pipewire-pulse')) +systemd_config.set('PW_PULSE_BINARY', join_paths(get_option('pipewire_pulse_prefix'), 'bin/pipewire-pulse')) + systemd_config.set('PW_MEDIA_SESSION_BINARY', join_paths(pipewire_bindir, 'pipewire-media-session')) configure_file(input : 'pipewire.service.in', - output : 'pipewire.service', diff --git a/pkgs/development/libraries/pipewire/0055-pipewire-media-session-path.patch b/pkgs/development/libraries/pipewire/0055-pipewire-media-session-path.patch new file mode 100644 index 00000000000..ce1085f37f7 --- /dev/null +++ b/pkgs/development/libraries/pipewire/0055-pipewire-media-session-path.patch @@ -0,0 +1,27 @@ +diff --git a/meson_options.txt b/meson_options.txt +index a6c8af72..8e5c3d73 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -10,6 +10,9 @@ option('media-session', + description: 'Build and install pipewire-media-session', + type: 'boolean', + value: true) ++option('media-session-prefix', ++ description: 'Install directory for pipewire-media-session and its support files', ++ type: 'string') + option('man', + description: 'Build manpages', + type: 'boolean', +diff --git a/src/daemon/systemd/user/meson.build b/src/daemon/systemd/user/meson.build +index 4a70b0b0..84c9a19e 100644 +--- a/src/daemon/systemd/user/meson.build ++++ b/src/daemon/systemd/user/meson.build +@@ -10,7 +10,7 @@ install_data( + systemd_config = configuration_data() + systemd_config.set('PW_BINARY', join_paths(pipewire_bindir, 'pipewire')) + systemd_config.set('PW_PULSE_BINARY', join_paths(get_option('pipewire_pulse_prefix'), 'bin/pipewire-pulse')) +-systemd_config.set('PW_MEDIA_SESSION_BINARY', join_paths(pipewire_bindir, 'pipewire-media-session')) ++systemd_config.set('PW_MEDIA_SESSION_BINARY', join_paths(get_option('media-session-prefix'), 'bin/pipewire-media-session')) + + configure_file(input : 'pipewire.service.in', + output : 'pipewire.service', diff --git a/pkgs/development/libraries/pipewire/installed-tests-path.patch b/pkgs/development/libraries/pipewire/0070-installed-tests-path.patch similarity index 100% rename from pkgs/development/libraries/pipewire/installed-tests-path.patch rename to pkgs/development/libraries/pipewire/0070-installed-tests-path.patch diff --git a/pkgs/development/libraries/pipewire/pipewire-config-dir.patch b/pkgs/development/libraries/pipewire/0080-pipewire-config-dir.patch similarity index 100% rename from pkgs/development/libraries/pipewire/pipewire-config-dir.patch rename to pkgs/development/libraries/pipewire/0080-pipewire-config-dir.patch diff --git a/pkgs/development/libraries/pipewire/default.nix b/pkgs/development/libraries/pipewire/default.nix index 8dd94f4ba13..5c5578abc8d 100644 --- a/pkgs/development/libraries/pipewire/default.nix +++ b/pkgs/development/libraries/pipewire/default.nix @@ -43,7 +43,7 @@ let self = stdenv.mkDerivation rec { pname = "pipewire"; - version = "0.3.22"; + version = "0.3.23"; outputs = [ "out" @@ -61,106 +61,20 @@ let owner = "pipewire"; repo = "pipewire"; rev = version; - hash = "sha256:6SEOUivyehccVR5zt79Qw2rjN2KcO5x3TEejXVxRlvs="; + hash = "sha256:1HMUrE1NBmrdBRMKX3LRlXaCEH3wqP2jGtW8Rp9oyQA="; }; patches = [ # Break up a dependency cycle between outputs. - ./alsa-profiles-use-libdir.patch - # Move installed tests into their own output. - ./installed-tests-path.patch + ./0040-alsa-profiles-use-libdir.patch # Change the path of the pipewire-pulse binary in the service definition. - ./pipewire-pulse-path.patch + ./0050-pipewire-pulse-path.patch + # Change the path of the pipewire-media-session binary in the service definition. + ./0055-pipewire-media-session-path.patch + # Move installed tests into their own output. + ./0070-installed-tests-path.patch # Add flag to specify configuration directory (different from the installation directory). - ./pipewire-config-dir.patch - - # Various quality of life improvements that didn't make it into 0.3.22 - (fetchpatch { - name = "0001-bluez5-include-a2dp-codec-profiles-in-route-profiles.patch"; - url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/df1dbee687c819095a6fddce3b24943f9ac47dbc.patch"; - sha256 = "sha256-MesteaIcfKMr53TdObEfqRyKEgalB1GEWpsTexawPgg="; - }) - (fetchpatch { - name = "0001-pulse-server-don-t-use-the-pending_sample-after-free.patch"; - url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/72acd752f68a35c40641262be1c69014170d0734.patch"; - sha256 = "sha256-F3+aVfOYH4SLTwWhdIKuNUo85NBoS+67vkUrcsaldSs="; - }) - ./patches-0.3.22/0005-fix-some-warnings.patch - (fetchpatch { - name = "0006-spa-escape-double-quotes.patch"; - url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/6a219092818a7a7e357441256d8070ae77ac2d3a.patch"; - sha256 = "sha256-NUjxOSthe3Jw2LUrO11QnTWTx0PQNBJkQSv3ux58jZw="; - }) - (fetchpatch { - name = "0009-bluez5-volumes-need-to-be-distributed-to-all-channel.patch"; - url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/8c5ca000ef7fddd9be9cd2211d880736e97b956d.patch"; - sha256 = "sha256-9NhbYSXlNOYmoPg8tj561QHisaD216fBG7ccNIfoZ64="; - }) - (fetchpatch { - name = "0010-bluez5-set-the-right-volumes-on-the-node.patch"; - url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/930b411075a5c1b0d9ddcfe7dd2dbfdc27baab90.patch"; - sha256 = "sha256-xsL92H8wSrBzoxLtraCVxPZdXWTwj+j+O2XlfhcJ7IQ="; - }) - (fetchpatch { - name = "0011-bluez5-backend-native-Check-volume-values.patch"; - url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/7a5a94470453e0cbd3a087b1be2aa8960ff43c07.patch"; - sha256 = "sha256-HKWcfkwMmmlEB7l+SETJDsUZ2eLggcodtbNOpqY/wWY="; - }) - (fetchpatch { - name = "0012-media-session-don-t-switch-to-pro-audio-by-default.patch"; - url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/84fc63e60168e2c2f43875423899b4ae3bd89a7b.patch"; - sha256 = "sha256-tZwgBMZS+HJd0lrRji3aevbP/yJfvWYK60KMpfiFrOY="; - }) - (fetchpatch { - name = "0013-audioconvert-keep-better-track-of-param-changes.patch"; - url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/44919c83fc51aa5e1a22c903e841897c1b4d274c.patch"; - sha256 = "sha256-DIZUfEjUCaK4yY3k7/KLHv1igTKz6Ek4QbWECs1sr9E="; - }) - (fetchpatch { - name = "0018-pulse-server-print-encoding-name-in-format_info.patch"; - url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/4b591df145afa316e8e047764f9b98fc10cbacd9.patch"; - sha256 = "sha256-Dr6w6tI4R+6wrl0rVk9Eifw3YleuisVmXzsv+H2jtXc="; - }) - (fetchpatch { - name = "0019-pulse-server-handle-unsupported-formats.patch"; - url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/fcf00b3d352d931446a384a768b999520662b599.patch"; - sha256 = "sha256-kQ3vRoojLVTOJi8V4eODkZC8agsla2PjKf6sJnm/1C4="; - }) - (fetchpatch { - name = "0021-jack-handle-client-init-error-with-EIO.patch"; - url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/715a3a642a4f1c1f624e0a9dc0394b1819b69f93.patch"; - sha256 = "sha256-DglHcH9pHSWuVxZuLt8J+gDmxOaQSoiThVE2wePfH1I="; - }) - (fetchpatch { - name = "0022-pw-cli-always-output-to-stdout.patch"; - url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/91875c1fd8ece6b1b94130c50304b715654f8681.patch"; - sha256 = "sha256-3Sf/Tr39bdBihq/CFborm7GcBWtSvqO3KtRtFBcHcmc="; - }) - (fetchpatch { - name = "0024-policy-node-don-t-crash-without-metadata.patch"; - url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/3673265ae20d7b59e89cad6c5238c232796731b2.patch"; - sha256 = "sha256-YRdh1gqBYqa+sbSfHuJZ+Xc6w4QTOOpt/fppFNxsj+8="; - }) - (fetchpatch { - name = "0025-bluez5-route-shouldn-t-list-a2dp-profiles-when-not-c.patch"; - url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/a5dc2493dfccfc168cef01162f38f90e986b8af4.patch"; - sha256 = "sha256-zu7zqHIMOcxLAhvelKNWDB+804x+ocCo5FAMUSSOnVo="; - }) - (fetchpatch { - name = "0027-jack-apply-PIPEWIRE_PROPS-after-reading-config.patch"; - url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/149319819aa5d4e39770c35a0c00f6c2963e2bf3.patch"; - sha256 = "sha256-SwKQJkg8NIL9D0GAL6hnEgi8kvuToo1bpDm52adtKxA="; - }) - (fetchpatch { - name = "0038-jack-add-config-option-to-shorten-and-filter-names.patch"; - url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/d54da879bf5f9fa9009e1ab27e8d52eae3141764.patch"; - sha256 = "sha256-iYOmZTWNODHYWpYGfRTQhBLV1HeFOUvHN3Ta0f1ZS8M="; - }) - (fetchpatch { - name = "0046-jack-fix-names-of-our-ports.patch"; - url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/e340a44a357e4550e169bc8825c6aa8b4ceb76db.patch"; - sha256 = "sha256-rfv2IzgYyNB1s51eRFhJzZCyso6PIEj2qg9fpPpOZ5Q="; - }) + ./0080-pipewire-config-dir.patch ]; nativeBuildInputs = [ @@ -196,6 +110,7 @@ let "-Dinstalled_tests=true" "-Dinstalled_test_prefix=${placeholder "installedTests"}" "-Dpipewire_pulse_prefix=${placeholder "pulse"}" + "-Dmedia-session-prefix=${placeholder "mediaSession"}" "-Dlibjack-path=${placeholder "jack"}/lib" "-Dgstreamer=${mesonBool gstreamerSupport}" "-Dffmpeg=${mesonBool ffmpegSupport}" @@ -212,17 +127,23 @@ let doCheck = true; postInstall = '' - mkdir -p $out/nix-support/etc/pipewire/media-session. - for f in etc/pipewire/*.conf; do $out/bin/spa-json-dump "$f" > "$out/nix-support/$f.json"; done + pushd . + cd $out + mkdir -p $out/nix-support/etc/pipewire + for f in etc/pipewire/*.conf; do bin/spa-json-dump "$f" > "$out/nix-support/$f.json"; done + + mkdir -p $mediaSession/nix-support/etc/pipewire/media-session.d + for f in etc/pipewire/media-session.d/*.conf; do bin/spa-json-dump "$f" > "$mediaSession/nix-support/$f.json"; done + popd + + moveToOutput "etc/pipewire/media-session.d/*.conf" "$mediaSession" + moveToOutput "share/systemd/user/pipewire-media-session.*" "$mediaSession" + moveToOutput "lib/systemd/user/pipewire-media-session.*" "$mediaSession" + moveToOutput "bin/pipewire-media-session" "$mediaSession" moveToOutput "share/systemd/user/pipewire-pulse.*" "$pulse" moveToOutput "lib/systemd/user/pipewire-pulse.*" "$pulse" moveToOutput "bin/pipewire-pulse" "$pulse" - - mkdir -p $mediaSession/nix-support/etc/pipewire/media-session.d - for f in etc/pipewire/media-session.d/*.conf; do $out/bin/spa-json-dump "$f" > "$mediaSession/nix-support/$f.json"; done - moveToOutput "bin/pipewire-media-session" "$mediaSession" - moveToOutput "etc/pipewire/media-session.d/*.conf" "$mediaSession" ''; passthru.tests = { diff --git a/pkgs/development/libraries/pipewire/patches-0.3.22/0005-fix-some-warnings.patch b/pkgs/development/libraries/pipewire/patches-0.3.22/0005-fix-some-warnings.patch deleted file mode 100644 index 56987bf4d1d..00000000000 --- a/pkgs/development/libraries/pipewire/patches-0.3.22/0005-fix-some-warnings.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 63a3811aa76802e9585e04cf12bf8de617442105 Mon Sep 17 00:00:00 2001 -From: Wim Taymans -Date: Thu, 18 Feb 2021 12:42:06 +0100 -Subject: [PATCH 05/30] fix some warnings - ---- - spa/plugins/bluez5/backend-native.c | 2 +- - src/examples/media-session/default-routes.c | 18 +++++++++++++----- - 2 files changed, 14 insertions(+), 6 deletions(-) - -diff --git a/spa/plugins/bluez5/backend-native.c b/spa/plugins/bluez5/backend-native.c -index 4df714088..b4d4e5edf 100644 ---- a/spa/plugins/bluez5/backend-native.c -+++ b/spa/plugins/bluez5/backend-native.c -@@ -437,7 +437,7 @@ static bool rfcomm_hfp_hf(struct spa_source *source, char* buf) - struct rfcomm *rfcomm = source->data; - struct spa_bt_backend *backend = rfcomm->backend; - unsigned int features; -- unsigned int gain; -+ unsigned int SPA_UNUSED gain; - unsigned int selected_codec; - char* token; - char separators[] = "\r\n:"; From b1c5aa5ef1950a062474481181f55e695d19a06d Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Sat, 6 Mar 2021 11:58:22 +0100 Subject: [PATCH 13/20] chromium: 89.0.4389.72 -> 89.0.4389.82 --- .../networking/browsers/chromium/upstream-info.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/networking/browsers/chromium/upstream-info.json b/pkgs/applications/networking/browsers/chromium/upstream-info.json index 5a67aed0896..9db51f24210 100644 --- a/pkgs/applications/networking/browsers/chromium/upstream-info.json +++ b/pkgs/applications/networking/browsers/chromium/upstream-info.json @@ -1,8 +1,8 @@ { "stable": { - "version": "89.0.4389.72", - "sha256": "0kxwq1m6zdsq3ns2agvk1hqkhwlv1693h41rlmvhy3nim9jhnsll", - "sha256bin64": "1h2dxgr660xy1rv52ck8ps6av0l5jdhj2k29lvs190ccpxaycglb", + "version": "89.0.4389.82", + "sha256": "0yg33d6zldz3j1jghhdci63fn46i10dkz3nb95jdrbv8gd018jfz", + "sha256bin64": "1sqzzillq38qyh85449ncz8bni93mjxb6r4z8y5h8k2w3j38jc0q", "deps": { "gn": { "version": "2021-01-07", From b53965f1d2135bd313c1411f14de614c31895ee3 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sat, 6 Mar 2021 12:35:33 +0100 Subject: [PATCH 14/20] doc/README.md: Add more links --- doc/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/README.md b/doc/README.md index cb52608bde5..5395d7ca8f6 100644 --- a/doc/README.md +++ b/doc/README.md @@ -5,4 +5,8 @@ This directory houses the sources files for the Nixpkgs manual. You can find the [rendered documentation for Nixpkgs `unstable` on nixos.org](https://nixos.org/manual/nixpkgs/unstable/). +[Docs for Nixpkgs stable](https://nixos.org/manual/nixpkgs/stable/) are also available. + If you want to contribute to the documentation, [here's how to do it](https://nixos.org/manual/nixpkgs/unstable/#chap-contributing). + +If you're only getting started with Nix, go to [nixos.org/learn](https://nixos.org/learn). From 52de3976b8a9782f550bc1eb6e3d4d0ab9c89896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 7 Mar 2021 11:40:18 +0100 Subject: [PATCH 15/20] doc: replace < with < in Markdown --- doc/builders/packages/emacs.section.md | 2 +- doc/languages-frameworks/qt.section.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/builders/packages/emacs.section.md b/doc/builders/packages/emacs.section.md index b4723a22bb1..93a819bc79b 100644 --- a/doc/builders/packages/emacs.section.md +++ b/doc/builders/packages/emacs.section.md @@ -36,7 +36,7 @@ You can install it like any other packages via `nix-env -iA myEmacs`. However, t ;; load some packages (use-package company - :bind ("<C-tab>" . company-complete) + :bind ("" . company-complete) :diminish company-mode :commands (company-mode global-company-mode) :defer 1 diff --git a/doc/languages-frameworks/qt.section.md b/doc/languages-frameworks/qt.section.md index b6525490c85..9747c1037ad 100644 --- a/doc/languages-frameworks/qt.section.md +++ b/doc/languages-frameworks/qt.section.md @@ -121,7 +121,7 @@ Use the `meta.broken` attribute to disable the package for unsupported Qt versio stdenv.mkDerivation { # ... - # Disable this library with Qt < 5.9.0 + # Disable this library with Qt < 5.9.0 meta.broken = lib.versionOlder qtbase.version "5.9.0"; } ``` From f956dd3ff5bbabbd5515376220255b8da464cc2c Mon Sep 17 00:00:00 2001 From: V Date: Sat, 6 Mar 2021 13:13:26 +0100 Subject: [PATCH 16/20] vscx/ms-vsliveshare-vsliveshare: 1.0.2902 -> 1.0.3912 --- .../ms-vsliveshare-vsliveshare/default.nix | 78 +++++++++---------- 1 file changed, 37 insertions(+), 41 deletions(-) diff --git a/pkgs/misc/vscode-extensions/ms-vsliveshare-vsliveshare/default.nix b/pkgs/misc/vscode-extensions/ms-vsliveshare-vsliveshare/default.nix index c49f798899f..e8e8ead9dbd 100644 --- a/pkgs/misc/vscode-extensions/ms-vsliveshare-vsliveshare/default.nix +++ b/pkgs/misc/vscode-extensions/ms-vsliveshare-vsliveshare/default.nix @@ -1,9 +1,10 @@ -# Baseed on previous attempts: +# Based on previous attempts: # - # - -{ lib, gccStdenv, vscode-utils, autoPatchelfHook, bash, file, makeWrapper, dotnet-sdk_3 -, curl, gcc, icu, libkrb5, libsecret, libunwind, libX11, lttng-ust, openssl, util-linux, zlib -, desktop-file-utils, xprop +{ lib, gccStdenv, vscode-utils +, jq, autoPatchelfHook, bash, makeWrapper +, dotnet-sdk_3, curl, gcc, icu, libkrb5, libsecret, libunwind, libX11, lttng-ust, openssl, util-linux, zlib +, desktop-file-utils, xprop, xsel }: with lib; @@ -37,11 +38,17 @@ in ((vscode-utils.override { stdenv = gccStdenv; }).buildVscodeMarketplaceExtens mktplcRef = { name = "vsliveshare"; publisher = "ms-vsliveshare"; - version = "1.0.2902"; - sha256 = "0fx2vi0wxamcwqcgcx7wpg8hi7f1c2pibrmd2qy2whilpsv3gzmb"; + version = "1.0.3912"; + sha256 = "1k5yy04q85jjr7hzrv0s7x1m2251kglb038wcvvbs568vpscghi8"; }; -}).overrideAttrs(attrs: { - buildInputs = attrs.buildInputs ++ libs ++ [ autoPatchelfHook bash file makeWrapper ]; +}).overrideAttrs({ nativeBuildInputs ? [], buildInputs ? [], ... }: { + nativeBuildInputs = nativeBuildInputs ++ [ + bash + jq + autoPatchelfHook + makeWrapper + ]; + buildInputs = buildInputs ++ libs; # Using a patch file won't work, because the file changes too often, causing the patch to fail on most updates. # Rather than patching the calls to functions, we modify the functions to return what we want, @@ -57,32 +64,31 @@ in ((vscode-utils.override { stdenv = gccStdenv; }).buildVscodeMarketplaceExtens # Fix extension attempting to write to 'modifiedInternalSettings.json'. # Move this write to the tmp directory indexed by the nix store basename. - sed -i \ - -E -e $'s/path\.resolve\(constants_1\.EXTENSION_ROOT_PATH, \'\.\/modifiedInternalSettings\.json\'\)/path.join\(os.tmpdir(), "'$ext_unique_id'" + "-modifiedInternalSettings.json"\)/g' \ - out/prod/extension-prod.js + substituteInPlace out/prod/extension-prod.js \ + --replace "path.resolve(constants_1.EXTENSION_ROOT_PATH, './modifiedInternalSettings.json')" \ + "path.join(os.tmpdir(), '$ext_unique_id-modifiedInternalSettings.json')" # Fix extension attempting to write to 'vsls-agent.lock'. # Move this write to the tmp directory indexed by the nix store basename. - sed -i \ - -E -e $'s/(Agent_1.getAgentPath\(\) \+ \'.lock\')/path.join\(os.tmpdir(), "'$ext_unique_id'" + "-vsls-agent.lock"\)/g' \ - out/prod/extension-prod.js + substituteInPlace out/prod/extension-prod.js \ + --replace "path + '.lock'" \ + "__webpack_require__('path').join(__webpack_require__('os').tmpdir(), '$ext_unique_id-vsls-agent.lock')" - # TODO: Under 'node_modules/@vsliveshare/vscode-launcher-linux' need to hardcode path to 'desktop-file-install' - # 'update-desktop-database' and 'xprop'. Might want to wrap the script instead. + # Hardcode executable paths + echo '#!/bin/sh' >node_modules/@vsliveshare/vscode-launcher-linux/check-reqs.sh + substituteInPlace node_modules/@vsliveshare/vscode-launcher-linux/install.sh \ + --replace desktop-file-install ${desktop-file-utils}/bin/desktop-file-install + substituteInPlace node_modules/@vsliveshare/vscode-launcher-linux/uninstall.sh \ + --replace update-desktop-database ${desktop-file-utils}/bin/update-desktop-database + substituteInPlace node_modules/@vsliveshare/vscode-launcher-linux/vsls-launcher \ + --replace /bin/bash ${bash}/bin/bash + substituteInPlace out/prod/extension-prod.js \ + --replace xprop ${xprop}/bin/xprop \ + --replace "'xsel'" "'${xsel}/bin/xsel'" ''; - # Support for the `postInstall` hook was added only in nixos-20.03, - # so for backwards compatibility reasons lets not use it yet. - installPhase = attrs.installPhase + '' - # Support both the new and old directory structure of vscode extensions. - if [[ -d $out/ms-vsliveshare.vsliveshare ]]; then - cd $out/ms-vsliveshare.vsliveshare - elif [[ -d $out/share/vscode/extensions/ms-vsliveshare.vsliveshare ]]; then - cd $out/share/vscode/extensions/ms-vsliveshare.vsliveshare - else - echo "Could not find extension directory 'ms-vsliveshare.vsliveshare'." >&2 - exit 1 - fi + postInstall = '' + cd $out/share/vscode/extensions/ms-vsliveshare.vsliveshare bash -s < Date: Sun, 7 Mar 2021 12:04:12 +0100 Subject: [PATCH 17/20] chromium: Make get-commit-message.py more robust Not all updates contain security fixes. --- .../browsers/chromium/get-commit-message.py | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pkgs/applications/networking/browsers/chromium/get-commit-message.py b/pkgs/applications/networking/browsers/chromium/get-commit-message.py index bbadb3153ee..1aafc6147fd 100755 --- a/pkgs/applications/networking/browsers/chromium/get-commit-message.py +++ b/pkgs/applications/networking/browsers/chromium/get-commit-message.py @@ -21,15 +21,15 @@ for entry in feed.entries: continue #print(url) # For debugging purposes version = re.search(r'\d+(\.\d+){3}', content).group(0) - fixes = re.search(r'This update includes .+ security fixes\.', content).group(0) - fixes = html_tags.sub('', fixes) - zero_days = re.search(r'Google is aware of reports that .+ in the wild\.', content) - if zero_days: - fixes += " " + zero_days.group(0) - cve_list = re.findall(r'CVE-[^: ]+', content) - cve_string = ' '.join(cve_list) - print('chromium: TODO -> ' + version + '\n') - print(url + '\n') - print('\n'.join(textwrap.wrap(fixes, width=72)) + '\n') - print("CVEs:\n" + '\n'.join(textwrap.wrap(cve_string, width=72))) + print('chromium: TODO -> ' + version) + print('\n' + url) + if fixes := re.search(r'This update includes .+ security fixes\.', content): + fixes = html_tags.sub('', fixes.group(0)) + zero_days = re.search(r'Google is aware of reports that .+ in the wild\.', content) + if zero_days: + fixes += " " + zero_days.group(0) + print('\n' + '\n'.join(textwrap.wrap(fixes, width=72))) + if cve_list := re.findall(r'CVE-[^: ]+', content): + cve_string = ' '.join(cve_list) + print("\nCVEs:\n" + '\n'.join(textwrap.wrap(cve_string, width=72))) break # We only care about the most recent stable channel update From 5dc759afec451ae04750706c5f84c75626de23d2 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Fri, 26 Feb 2021 17:35:36 +0100 Subject: [PATCH 18/20] ocamlPackages.rope: use Dune 2 --- pkgs/development/ocaml-modules/rope/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/ocaml-modules/rope/default.nix b/pkgs/development/ocaml-modules/rope/default.nix index 481342e98c7..f29219e30c2 100644 --- a/pkgs/development/ocaml-modules/rope/default.nix +++ b/pkgs/development/ocaml-modules/rope/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, dune, benchmark }: +{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, dune_2, benchmark }: let param = if lib.versionAtLeast ocaml.version "4.03" @@ -6,7 +6,7 @@ let param = version = "0.6.2"; url = "https://github.com/Chris00/ocaml-rope/releases/download/${version}/rope-${version}.tbz"; sha256 = "15cvfa0s1vjx7gjd07d3fkznilishqf4z4h2q5f20wm9ysjh2h2i"; - buildInputs = [ dune ]; + buildInputs = [ dune_2 ]; extra = { buildPhase = "dune build -p rope"; installPhase = '' From 60785fe4dbedc4fd2a4a4980c59357a27b57aabf Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Fri, 26 Feb 2021 17:35:41 +0100 Subject: [PATCH 19/20] ocamlPackages.dune: rename into dune_1 --- pkgs/build-support/ocaml/dune.nix | 4 ++-- pkgs/development/tools/ocaml/dune/{default.nix => 1.nix} | 0 pkgs/top-level/aliases.nix | 2 +- pkgs/top-level/all-packages.nix | 2 +- pkgs/top-level/ocaml-packages.nix | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) rename pkgs/development/tools/ocaml/dune/{default.nix => 1.nix} (100%) diff --git a/pkgs/build-support/ocaml/dune.nix b/pkgs/build-support/ocaml/dune.nix index f9f59b21510..56fe8a60484 100644 --- a/pkgs/build-support/ocaml/dune.nix +++ b/pkgs/build-support/ocaml/dune.nix @@ -1,8 +1,8 @@ -{ lib, stdenv, ocaml, findlib, dune, dune_2 }: +{ lib, stdenv, ocaml, findlib, dune_1, dune_2 }: { pname, version, buildInputs ? [], enableParallelBuilding ? true, ... }@args: -let Dune = if args.useDune2 or false then dune_2 else dune; in +let Dune = if args.useDune2 or false then dune_2 else dune_1; in if args ? minimumOCamlVersion && ! lib.versionAtLeast ocaml.version args.minimumOCamlVersion diff --git a/pkgs/development/tools/ocaml/dune/default.nix b/pkgs/development/tools/ocaml/dune/1.nix similarity index 100% rename from pkgs/development/tools/ocaml/dune/default.nix rename to pkgs/development/tools/ocaml/dune/1.nix diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index f767f22c1f6..cd6418e1e81 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -293,7 +293,7 @@ mapAliases ({ i-score = throw "i-score has been removed: abandoned upstream."; # added 2020-11-21 jamomacore = throw "jamomacore has been removed: abandoned upstream."; # added 2020-11-21 jasper = throw "jasper has been removed: abandoned upstream with many vulnerabilities"; - jbuilder = dune; # added 2018-09-09 + jbuilder = dune_1; # added 2018-09-09 jikes = throw "jikes was deprecated on 2019-10-07: abandoned by upstream"; joseki = apache-jena-fuseki; # added 2016-02-28 json_glib = json-glib; # added 2018-02-25 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f53245544e8..b726c4f87ba 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2220,7 +2220,7 @@ in duf = callPackage ../tools/misc/duf { }; - inherit (ocamlPackages) dune dune_2 dune-release; + inherit (ocamlPackages) dune_1 dune_2 dune-release; duperemove = callPackage ../tools/filesystems/duperemove { }; diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 51dd6c257b2..f31125ef82f 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -276,7 +276,7 @@ let dum = callPackage ../development/ocaml-modules/dum { }; - dune = callPackage ../development/tools/ocaml/dune { }; + dune_1 = callPackage ../development/tools/ocaml/dune/1.nix { }; dune_2 = if lib.versionAtLeast ocaml.version "4.08" From a104d2b18cf9021e014d06073c45a0c8d2f6bef6 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Fri, 26 Feb 2021 17:35:46 +0100 Subject: [PATCH 20/20] =?UTF-8?q?ocamlPackages.dune=5F1:=20disable=20for?= =?UTF-8?q?=20OCaml=20=E2=89=A5=204.12?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/development/tools/ocaml/dune/1.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/tools/ocaml/dune/1.nix b/pkgs/development/tools/ocaml/dune/1.nix index bbdbc45270d..a16b3ab23f2 100644 --- a/pkgs/development/tools/ocaml/dune/1.nix +++ b/pkgs/development/tools/ocaml/dune/1.nix @@ -1,6 +1,7 @@ { stdenv, lib, fetchurl, ocaml, findlib }: if !lib.versionAtLeast ocaml.version "4.02" +|| lib.versionAtLeast ocaml.version "4.12" then throw "dune is not available for OCaml ${ocaml.version}" else