mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-27 09:23:01 +00:00
Merge staging-next into staging
This commit is contained in:
commit
dcea8212b5
@ -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
|
||||
|
12
doc/README.md
Normal file
12
doc/README.md
Normal file
@ -0,0 +1,12 @@
|
||||
|
||||
# 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/).
|
||||
|
||||
[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).
|
@ -17,9 +17,11 @@
|
||||
|
||||
<section xml:id="sec-citrix-selfservice">
|
||||
<title>Citrix Selfservice</title>
|
||||
|
||||
<para>
|
||||
The <link xlink:href="https://support.citrix.com/article/CTX200337">selfservice</link> is an application managing Citrix desktops and applications. Please note that this feature only works with at least <package>citrix_workspace_20_06_0</package> and later versions.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
In order to set this up, you first have to <link xlink:href="https://its.uiowa.edu/support/article/102186">download the <literal>.cr</literal> file from the Netscaler Gateway</link>. After that you can configure the <command>selfservice</command> like this:
|
||||
<screen>
|
||||
|
@ -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 ("<C-tab>" . company-complete)
|
||||
:diminish company-mode
|
||||
:commands (company-mode global-company-mode)
|
||||
:defer 1
|
||||
|
@ -180,17 +180,12 @@ args.stdenv.mkDerivation (args // {
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Arguments should be listed in the order they are used, with the
|
||||
exception of <varname>lib</varname>, which always goes first.
|
||||
Arguments should be listed in the order they are used, with the exception of <varname>lib</varname>, which always goes first.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Prefer using the top-level <varname>lib</varname> over its alias
|
||||
<literal>stdenv.lib</literal>. <varname>lib</varname> is unrelated to
|
||||
<varname>stdenv</varname>, and so <literal>stdenv.lib</literal> 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 <varname>lib</varname> over its alias <literal>stdenv.lib</literal>. <varname>lib</varname> is unrelated to <varname>stdenv</varname>, and so <literal>stdenv.lib</literal> should only be used as a convenience alias when developing to avoid having to modify the function inputs just to test something out.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
@ -689,8 +684,7 @@ args.stdenv.mkDerivation (args // {
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
If it’s a <emphasis>theme</emphasis> for a <emphasis>desktop environment</emphasis>,
|
||||
a <emphasis>window manager</emphasis> or a <emphasis>display manager</emphasis>:
|
||||
If it’s a <emphasis>theme</emphasis> for a <emphasis>desktop environment</emphasis>, a <emphasis>window manager</emphasis> or a <emphasis>display manager</emphasis>:
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
|
@ -1677,8 +1677,7 @@ recursiveUpdate
|
||||
<xi:include href="./locations.xml" xpointer="lib.attrsets.recurseIntoAttrs" />
|
||||
|
||||
<para>
|
||||
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.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@ -1749,5 +1748,4 @@ cartesianProductOfSets { a = [ 1 2 ]; b = [ 10 20 ]; }
|
||||
]]></programlisting>
|
||||
</example>
|
||||
</section>
|
||||
|
||||
</section>
|
||||
|
@ -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";
|
||||
}
|
||||
```
|
||||
|
@ -26,7 +26,6 @@
|
||||
<para>
|
||||
A number of attributes can be used to work with a derivation with multiple outputs. The attribute <varname>outputs</varname> 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 <varname>meta.outputsToInstall</varname> is used to determine the default set of outputs to install when using the derivation name unqualified.
|
||||
</para>
|
||||
|
||||
</section>
|
||||
<section xml:id="sec-multiple-outputs-installing">
|
||||
<title>Installing a split package</title>
|
||||
|
@ -1839,10 +1839,7 @@ addEnvHooks "$hostOffset" myBashFunction
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
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.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@ -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 <varname>buildInputs</varname> and <varname>nativeBuildInputs</varname>.
|
||||
</para>
|
||||
<para>
|
||||
You can also specify a <varname>runtimeDependencies</varname> variable which lists dependencies to be unconditionally added to <glossterm>rpath</glossterm> of all executables.
|
||||
This is useful for programs that use <citerefentry>
|
||||
You can also specify a <varname>runtimeDependencies</varname> variable which lists dependencies to be unconditionally added to <glossterm>rpath</glossterm> of all executables. This is useful for programs that use <citerefentry>
|
||||
<refentrytitle>dlopen</refentrytitle>
|
||||
<manvolnum>3</manvolnum> </citerefentry> to load libraries at runtime.
|
||||
</para>
|
||||
|
@ -28,8 +28,7 @@
|
||||
</para>
|
||||
|
||||
<para>
|
||||
NOTE: DO NOT USE THIS in nixpkgs.
|
||||
Further overlays can be added by calling the <literal>pkgs.extend</literal> or <literal>pkgs.appendOverlays</literal>, 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 <literal>pkgs.extend</literal> or <literal>pkgs.appendOverlays</literal>, although it is often preferable to avoid these functions, because they recompute the Nixpkgs fixpoint, which is somewhat expensive to do.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
@ -140,36 +139,31 @@ self: super:
|
||||
</section>
|
||||
<section xml:id="sec-overlays-alternatives">
|
||||
<title>Using overlays to configure alternatives</title>
|
||||
|
||||
<para>
|
||||
Certain software packages have different implementations of the
|
||||
same interface. Other distributions have functionality to switch
|
||||
between these. For example, Debian provides <link
|
||||
xlink:href="https://wiki.debian.org/DebianAlternatives">DebianAlternatives</link>.
|
||||
Nixpkgs has what we call <literal>alternatives</literal>, which
|
||||
are configured through overlays.
|
||||
Certain software packages have different implementations of the same interface. Other distributions have functionality to switch between these. For example, Debian provides <link
|
||||
xlink:href="https://wiki.debian.org/DebianAlternatives">DebianAlternatives</link>. Nixpkgs has what we call <literal>alternatives</literal>, which are configured through overlays.
|
||||
</para>
|
||||
|
||||
<section xml:id="sec-overlays-alternatives-blas-lapack">
|
||||
<title>BLAS/LAPACK</title>
|
||||
|
||||
<para>
|
||||
In Nixpkgs, we have multiple implementations of the BLAS/LAPACK
|
||||
numerical linear algebra interfaces. They are:
|
||||
In Nixpkgs, we have multiple implementations of the BLAS/LAPACK numerical linear algebra interfaces. They are:
|
||||
</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<link xlink:href="https://www.openblas.net/">OpenBLAS</link>
|
||||
</para>
|
||||
<para>
|
||||
The Nixpkgs attribute is <literal>openblas</literal> for
|
||||
ILP64 (integer width = 64 bits) and
|
||||
<literal>openblasCompat</literal> for LP64 (integer width =
|
||||
32 bits). <literal>openblasCompat</literal> is the default.
|
||||
The Nixpkgs attribute is <literal>openblas</literal> for ILP64 (integer width = 64 bits) and <literal>openblasCompat</literal> for LP64 (integer width = 32 bits). <literal>openblasCompat</literal> is the default.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<link xlink:href="http://www.netlib.org/lapack/">LAPACK
|
||||
reference</link> (also provides BLAS)
|
||||
<link xlink:href="http://www.netlib.org/lapack/">LAPACK reference</link> (also provides BLAS)
|
||||
</para>
|
||||
<para>
|
||||
The Nixpkgs attribute is <literal>lapack-reference</literal>.
|
||||
@ -178,8 +172,7 @@ self: super:
|
||||
<listitem>
|
||||
<para>
|
||||
<link
|
||||
xlink:href="https://software.intel.com/en-us/mkl">Intel
|
||||
MKL</link> (only works on the x86_64 architecture, unfree)
|
||||
xlink:href="https://software.intel.com/en-us/mkl">Intel MKL</link> (only works on the x86_64 architecture, unfree)
|
||||
</para>
|
||||
<para>
|
||||
The Nixpkgs attribute is <literal>mkl</literal>.
|
||||
@ -191,46 +184,26 @@ self: super:
|
||||
xlink:href="https://github.com/flame/blis">BLIS</link>
|
||||
</para>
|
||||
<para>
|
||||
BLIS, available through the attribute
|
||||
<literal>blis</literal>, is a framework for linear algebra kernels. In
|
||||
addition, it implements the BLAS interface.
|
||||
BLIS, available through the attribute <literal>blis</literal>, is a framework for linear algebra kernels. In addition, it implements the BLAS interface.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<link
|
||||
xlink:href="https://developer.amd.com/amd-aocl/blas-library/">AMD
|
||||
BLIS/LIBFLAME</link> (optimized for modern AMD x86_64 CPUs)
|
||||
xlink:href="https://developer.amd.com/amd-aocl/blas-library/">AMD BLIS/LIBFLAME</link> (optimized for modern AMD x86_64 CPUs)
|
||||
</para>
|
||||
<para>
|
||||
The AMD fork of the BLIS library, with attribute
|
||||
<literal>amd-blis</literal>, 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
|
||||
<literal>amd-libflame</literal>, provides a LAPACK implementation.
|
||||
The AMD fork of the BLIS library, with attribute <literal>amd-blis</literal>, 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 <literal>amd-libflame</literal>, provides a LAPACK implementation.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>
|
||||
Introduced in <link
|
||||
xlink:href="https://github.com/NixOS/nixpkgs/pull/83888">PR
|
||||
#83888</link>, we are able to override the <literal>blas</literal>
|
||||
and <literal>lapack</literal> packages to use different implementations,
|
||||
through the <literal>blasProvider</literal> and
|
||||
<literal>lapackProvider</literal> argument. This can be used
|
||||
to select a different provider. BLAS providers will have
|
||||
symlinks in <literal>$out/lib/libblas.so.3</literal> and
|
||||
<literal>$out/lib/libcblas.so.3</literal> to their respective
|
||||
BLAS libraries. Likewise, LAPACK providers will have symlinks
|
||||
in <literal>$out/lib/liblapack.so.3</literal> and
|
||||
<literal>$out/lib/liblapacke.so.3</literal> 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:
|
||||
xlink:href="https://github.com/NixOS/nixpkgs/pull/83888">PR #83888</link>, we are able to override the <literal>blas</literal> and <literal>lapack</literal> packages to use different implementations, through the <literal>blasProvider</literal> and <literal>lapackProvider</literal> argument. This can be used to select a different provider. BLAS providers will have symlinks in <literal>$out/lib/libblas.so.3</literal> and <literal>$out/lib/libcblas.so.3</literal> to their respective BLAS libraries. Likewise, LAPACK providers will have symlinks in <literal>$out/lib/liblapack.so.3</literal> and <literal>$out/lib/liblapacke.so.3</literal> 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:
|
||||
</para>
|
||||
<programlisting>
|
||||
|
||||
<programlisting>
|
||||
self: super:
|
||||
|
||||
{
|
||||
@ -243,46 +216,24 @@ self: super:
|
||||
};
|
||||
}
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
This overlay uses Intel’s MKL library for both BLAS and LAPACK
|
||||
interfaces. Note that the same can be accomplished at runtime
|
||||
using <literal>LD_LIBRARY_PATH</literal> of
|
||||
<literal>libblas.so.3</literal> and
|
||||
<literal>liblapack.so.3</literal>. 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 <literal>LD_LIBRARY_PATH</literal> of <literal>libblas.so.3</literal> and <literal>liblapack.so.3</literal>. For instance:
|
||||
</para>
|
||||
|
||||
<screen>
|
||||
<prompt>$ </prompt>LD_LIBRARY_PATH=$(nix-build -A mkl)/lib:$LD_LIBRARY_PATH nix-shell -p octave --run octave
|
||||
</screen>
|
||||
|
||||
<para>
|
||||
Intel MKL requires an <literal>openmp</literal> implementation
|
||||
when running with multiple processors. By default,
|
||||
<literal>mkl</literal> will use Intel’s <literal>iomp</literal>
|
||||
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 <literal>LD_PRELOAD</literal>. Note that
|
||||
<literal>mkl</literal> is only available on
|
||||
<literal>x86_64-linux</literal> and
|
||||
<literal>x86_64-darwin</literal>. Moreover, Hydra is not
|
||||
building and distributing pre-compiled binaries using it.
|
||||
Intel MKL requires an <literal>openmp</literal> implementation when running with multiple processors. By default, <literal>mkl</literal> will use Intel’s <literal>iomp</literal> 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 <literal>LD_PRELOAD</literal>. Note that <literal>mkl</literal> is only available on <literal>x86_64-linux</literal> and <literal>x86_64-darwin</literal>. Moreover, Hydra is not building and distributing pre-compiled binaries using it.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For BLAS/LAPACK switching to work correctly, all packages must
|
||||
depend on <literal>blas</literal> or <literal>lapack</literal>.
|
||||
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, <literal>LP64</literal> (integer size = 32 bits)
|
||||
and <literal>ILP64</literal> (integer size = 64 bits). Some
|
||||
software needs special flags or patches to work with
|
||||
<literal>ILP64</literal>. You can check if
|
||||
<literal>ILP64</literal> is used in Nixpkgs with
|
||||
<varname>blas.isILP64</varname> and
|
||||
<varname>lapack.isILP64</varname>. Some software does NOT work
|
||||
with <literal>ILP64</literal>, and derivations need to specify
|
||||
an assertion to prevent this. You can prevent
|
||||
<literal>ILP64</literal> from being used with the following:
|
||||
For BLAS/LAPACK switching to work correctly, all packages must depend on <literal>blas</literal> or <literal>lapack</literal>. 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, <literal>LP64</literal> (integer size = 32 bits) and <literal>ILP64</literal> (integer size = 64 bits). Some software needs special flags or patches to work with <literal>ILP64</literal>. You can check if <literal>ILP64</literal> is used in Nixpkgs with <varname>blas.isILP64</varname> and <varname>lapack.isILP64</varname>. Some software does NOT work with <literal>ILP64</literal>, and derivations need to specify an assertion to prevent this. You can prevent <literal>ILP64</literal> from being used with the following:
|
||||
</para>
|
||||
<programlisting>
|
||||
|
||||
<programlisting>
|
||||
{ stdenv, blas, lapack, ... }:
|
||||
|
||||
assert (!blas.isILP64) && (!lapack.isILP64);
|
||||
@ -292,34 +243,31 @@ stdenv.mkDerivation {
|
||||
}
|
||||
</programlisting>
|
||||
</section>
|
||||
|
||||
<section xml:id="sec-overlays-alternatives-mpi">
|
||||
<title>Switching the MPI implementation</title>
|
||||
|
||||
<para>
|
||||
All programs that are built with
|
||||
<link xlink:href="https://en.wikipedia.org/wiki/Message_Passing_Interface">MPI</link>
|
||||
support use the generic attribute <varname>mpi</varname>
|
||||
as an input. At the moment Nixpkgs natively provides two different
|
||||
MPI implementations:
|
||||
All programs that are built with <link xlink:href="https://en.wikipedia.org/wiki/Message_Passing_Interface">MPI</link> support use the generic attribute <varname>mpi</varname> as an input. At the moment Nixpkgs natively provides two different MPI implementations:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<link xlink:href="https://www.open-mpi.org/">Open MPI</link>
|
||||
(default), attribute name <varname>openmpi</varname>
|
||||
<link xlink:href="https://www.open-mpi.org/">Open MPI</link> (default), attribute name <varname>openmpi</varname>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<link xlink:href="https://www.mpich.org/">MPICH</link>,
|
||||
attribute name <varname>mpich</varname>
|
||||
<link xlink:href="https://www.mpich.org/">MPICH</link>, attribute name <varname>mpich</varname>
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
To provide MPI enabled applications that use <literal>MPICH</literal>, instead
|
||||
of the default <literal>Open MPI</literal>, simply use the following overlay:
|
||||
To provide MPI enabled applications that use <literal>MPICH</literal>, instead of the default <literal>Open MPI</literal>, simply use the following overlay:
|
||||
</para>
|
||||
<programlisting>
|
||||
|
||||
<programlisting>
|
||||
self: super:
|
||||
|
||||
{
|
||||
|
@ -0,0 +1,34 @@
|
||||
{
|
||||
"properties": {},
|
||||
"rules": [
|
||||
{
|
||||
"matches": [
|
||||
{
|
||||
"device.name": "~alsa_card.*"
|
||||
}
|
||||
],
|
||||
"actions": {
|
||||
"update-props": {
|
||||
"api.alsa.use-acp": true,
|
||||
"api.acp.auto-profile": false,
|
||||
"api.acp.auto-port": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"matches": [
|
||||
{
|
||||
"node.name": "~alsa_input.*"
|
||||
},
|
||||
{
|
||||
"node.name": "~alsa_output.*"
|
||||
}
|
||||
],
|
||||
"actions": {
|
||||
"update-props": {
|
||||
"node.pause-on-idle": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
{
|
||||
"properties": {},
|
||||
"rules": [
|
||||
{
|
||||
"matches": [
|
||||
{
|
||||
"device.name": "~bluez_card.*"
|
||||
}
|
||||
],
|
||||
"actions": {
|
||||
"update-props": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"matches": [
|
||||
{
|
||||
"node.name": "~bluez_input.*"
|
||||
},
|
||||
{
|
||||
"node.name": "~bluez_output.*"
|
||||
}
|
||||
],
|
||||
"actions": {
|
||||
"update-props": {
|
||||
"node.pause-on-idle": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
26
nixos/modules/services/desktops/pipewire/client-rt.conf.json
Normal file
26
nixos/modules/services/desktops/pipewire/client-rt.conf.json
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"context.properties": {
|
||||
"log.level": 0
|
||||
},
|
||||
"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
|
||||
},
|
||||
"filter.properties": {},
|
||||
"stream.properties": {}
|
||||
}
|
19
nixos/modules/services/desktops/pipewire/client.conf.json
Normal file
19
nixos/modules/services/desktops/pipewire/client.conf.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"context.properties": {
|
||||
"log.level": 0
|
||||
},
|
||||
"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
|
||||
},
|
||||
"filter.properties": {},
|
||||
"stream.properties": {}
|
||||
}
|
21
nixos/modules/services/desktops/pipewire/jack.conf.json
Normal file
21
nixos/modules/services/desktops/pipewire/jack.conf.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"context.properties": {
|
||||
"log.level": 0
|
||||
},
|
||||
"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": {}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
{
|
||||
"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-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
|
||||
},
|
||||
"session.modules": {
|
||||
"default": [
|
||||
"flatpak",
|
||||
"portal",
|
||||
"v4l2",
|
||||
"suspend-node",
|
||||
"policy-node"
|
||||
],
|
||||
"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"
|
||||
]
|
||||
}
|
||||
}
|
@ -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 {
|
||||
config = {
|
||||
media-session = mkOption {
|
||||
type = types.attrs;
|
||||
description = ''
|
||||
Configuration for the media session core.
|
||||
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 = {
|
||||
# media-session config file
|
||||
properties = {
|
||||
# Properties to configure the session and some
|
||||
# modules
|
||||
#mem.mlock-all = false;
|
||||
#context.profile.modules = "default,rtkit";
|
||||
default = {};
|
||||
};
|
||||
|
||||
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"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
alsaMonitorConfig = mkOption {
|
||||
alsa-monitor = mkOption {
|
||||
type = types.attrs;
|
||||
description = ''
|
||||
Configuration for the alsa monitor.
|
||||
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 = {
|
||||
# alsa-monitor config file
|
||||
properties = {
|
||||
#alsa.jack-device = true
|
||||
default = {};
|
||||
};
|
||||
|
||||
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;
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
bluezMonitorConfig = mkOption {
|
||||
bluez-monitor = mkOption {
|
||||
type = types.attrs;
|
||||
description = ''
|
||||
Configuration for the bluez5 monitor.
|
||||
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 = {
|
||||
# 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" ];
|
||||
default = {};
|
||||
};
|
||||
|
||||
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;
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
v4l2MonitorConfig = mkOption {
|
||||
v4l2-monitor = mkOption {
|
||||
type = types.attrs;
|
||||
description = ''
|
||||
Configuration for the V4L2 monitor.
|
||||
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 = {
|
||||
# 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;
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
};
|
||||
@ -325,16 +112,17 @@ in {
|
||||
###### implementation
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
services.pipewire.sessionManagerExecutable = "${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 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 = ""; };
|
||||
};
|
||||
|
@ -0,0 +1,28 @@
|
||||
{
|
||||
"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"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"stream.properties": {}
|
||||
}
|
55
nixos/modules/services/desktops/pipewire/pipewire.conf.json
Normal file
55
nixos/modules/services/desktops/pipewire/pipewire.conf.json
Normal file
@ -0,0 +1,55 @@
|
||||
{
|
||||
"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": {
|
||||
"flags": [
|
||||
"ifexists",
|
||||
"nofail"
|
||||
]
|
||||
},
|
||||
"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": {}
|
||||
}
|
@ -18,11 +18,53 @@ let
|
||||
ln -s "${cfg.package.jack}/lib" "$out/lib/pipewire"
|
||||
'';
|
||||
|
||||
prioritizeNativeProtocol = {
|
||||
"context.modules" = {
|
||||
# Most other modules depend on this, so put it first
|
||||
"libpipewire-module-protocol-native" = {
|
||||
_priority = -100;
|
||||
_content = null;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
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"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# 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 (builtins.fromJSON (builtins.readFile ./pipewire.conf.json)) fixDaemonModulePriorities;
|
||||
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,131 +106,53 @@ in {
|
||||
'';
|
||||
};
|
||||
|
||||
config = mkOption {
|
||||
config = {
|
||||
client = mkOption {
|
||||
type = types.attrs;
|
||||
default = {};
|
||||
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
|
||||
|
||||
## 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;
|
||||
};
|
||||
|
||||
spa-libs = {
|
||||
## add-spa-lib <factory-name regex> <library-name>
|
||||
#
|
||||
# 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";
|
||||
};
|
||||
|
||||
modules = {
|
||||
## <module-name> = { [args = "<key>=<value> ..."]
|
||||
# [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";
|
||||
};
|
||||
|
||||
objects = {
|
||||
## create-object [-nofail] <factory-name> [<key>=<value> ...]
|
||||
#
|
||||
# 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 <program-name>
|
||||
#
|
||||
# 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}\""; };
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
sessionManagerExecutable = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
example = literalExample ''${pkgs.pipewire.mediaSession}/bin/pipewire-media-session'';
|
||||
description = ''
|
||||
Path to the session manager executable.
|
||||
Configuration for pipewire clients. For details see
|
||||
https://gitlab.freedesktop.org/pipewire/pipewire/-/blob/${cfg.package.version}/src/daemon/client.conf.in
|
||||
'';
|
||||
};
|
||||
|
||||
sessionManagerArguments = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [];
|
||||
example = literalExample ''["-p" "bluez5.msbc-support=true"]'';
|
||||
client-rt = mkOption {
|
||||
type = types.attrs;
|
||||
default = {};
|
||||
description = ''
|
||||
Arguments passed to the pipewire session manager.
|
||||
Configuration for realtime pipewire clients. For details see
|
||||
https://gitlab.freedesktop.org/pipewire/pipewire/-/blob/${cfg.package.version}/src/daemon/client-rt.conf.in
|
||||
'';
|
||||
};
|
||||
|
||||
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
|
||||
'';
|
||||
};
|
||||
|
||||
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
|
||||
'';
|
||||
};
|
||||
|
||||
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
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
alsa = {
|
||||
enable = mkEnableOption "ALSA support";
|
||||
support32Bit = mkEnableOption "32-bit ALSA support on 64-bit systems";
|
||||
@ -253,13 +217,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";
|
||||
};
|
||||
}
|
||||
|
@ -0,0 +1,30 @@
|
||||
{
|
||||
"properties": {},
|
||||
"rules": [
|
||||
{
|
||||
"matches": [
|
||||
{
|
||||
"device.name": "~v4l2_device.*"
|
||||
}
|
||||
],
|
||||
"actions": {
|
||||
"update-props": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"matches": [
|
||||
{
|
||||
"node.name": "~v4l2_input.*"
|
||||
},
|
||||
{
|
||||
"node.name": "~v4l2_output.*"
|
||||
}
|
||||
],
|
||||
"actions": {
|
||||
"update-props": {
|
||||
"node.pause-on-idle": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -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 = ''
|
||||
|
@ -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 ];
|
||||
|
@ -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)
|
||||
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)
|
||||
cve_list = re.findall(r'CVE-[^: ]+', content)
|
||||
print('\n' + '\n'.join(textwrap.wrap(fixes, width=72)))
|
||||
if 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("\nCVEs:\n" + '\n'.join(textwrap.wrap(cve_string, width=72)))
|
||||
break # We only care about the most recent stable channel update
|
||||
|
@ -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",
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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',
|
@ -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',
|
@ -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.23";
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
@ -60,18 +61,20 @@ let
|
||||
owner = "pipewire";
|
||||
repo = "pipewire";
|
||||
rev = version;
|
||||
hash = "sha256:2YJzPTMPIoQQeNja3F53SD4gtpdSlbD/i77hBWiQfuQ=";
|
||||
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
|
||||
./0080-pipewire-config-dir.patch
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
@ -93,6 +96,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
|
||||
@ -106,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}"
|
||||
@ -122,10 +127,23 @@ let
|
||||
doCheck = true;
|
||||
|
||||
postInstall = ''
|
||||
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"
|
||||
moveToOutput "bin/pipewire-media-session" "$mediaSession"
|
||||
'';
|
||||
|
||||
passthru.tests = {
|
||||
@ -135,6 +153,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"
|
||||
|
@ -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}
|
||||
|
||||
|
@ -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 = ''
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
33
pkgs/development/tools/pactorio/default.nix
Normal file
33
pkgs/development/tools/pactorio/default.nix
Normal file
@ -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 ];
|
||||
};
|
||||
}
|
@ -1,9 +1,10 @@
|
||||
# Baseed on previous attempts:
|
||||
# Based on previous attempts:
|
||||
# - <https://github.com/msteen/nixos-vsliveshare/blob/master/pkgs/vsliveshare/default.nix>
|
||||
# - <https://github.com/NixOS/nixpkgs/issues/41189>
|
||||
{ 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
|
||||
postInstall = ''
|
||||
cd $out/share/vscode/extensions/ms-vsliveshare.vsliveshare
|
||||
else
|
||||
echo "Could not find extension directory 'ms-vsliveshare.vsliveshare'." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
bash -s <<ENDSUBSHELL
|
||||
shopt -s extglob
|
||||
@ -98,34 +104,24 @@ in ((vscode-utils.override { stdenv = gccStdenv; }).buildVscodeMarketplaceExtens
|
||||
|
||||
# The required executables are already copied over,
|
||||
# and the other runtimes won't be used and thus are just a waste of space.
|
||||
rm -r dotnet_modules/exes dotnet_modules/runtimes/!(linux-x64)
|
||||
rm -r dotnet_modules/exes dotnet_modules/runtimes/!(linux-x64|unix)
|
||||
|
||||
# Not all executables and libraries are executable, so make sure that they are.
|
||||
find . -type f ! -executable -exec file {} + | grep -w ELF | cut -d ':' -f1 | xargs -rd'\n' chmod +x
|
||||
|
||||
# Not all scripts are executed by passing them to a shell, so they need to be executable as well.
|
||||
find . -type f -name '*.sh' ! -executable -exec chmod +x {} +
|
||||
jq <package.json '.executables.linux[]' -r | xargs chmod +x
|
||||
|
||||
# Lock the extension downloader.
|
||||
touch install-linux.Lock externalDeps-linux.Lock
|
||||
ENDSUBSHELL
|
||||
'';
|
||||
|
||||
rpath = makeLibraryPath libs;
|
||||
|
||||
postFixup = ''
|
||||
# We cannot use `wrapProgram`, because it will generate a relative path,
|
||||
# which will break when copying over the files.
|
||||
mv dotnet_modules/vsls-agent{,-wrapped}
|
||||
makeWrapper $PWD/dotnet_modules/vsls-agent{-wrapped,} \
|
||||
--prefix LD_LIBRARY_PATH : "$rpath" \
|
||||
--prefix LD_LIBRARY_PATH : "${makeLibraryPath libs}" \
|
||||
--set LD_PRELOAD $PWD/dotnet_modules/noop-syslog.so \
|
||||
--set DOTNET_ROOT ${dotnet-sdk_3}
|
||||
|
||||
for bn in check-reqs.sh install.sh uninstall.sh; do
|
||||
wrapProgram "$PWD/node_modules/@vsliveshare/vscode-launcher-linux/$bn" \
|
||||
--prefix PATH : "${makeBinPath [desktop-file-utils xprop]}"
|
||||
done
|
||||
'';
|
||||
|
||||
meta = {
|
||||
|
@ -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;
|
||||
|
||||
|
@ -31,9 +31,8 @@ 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'"
|
||||
substituteInPlace cmd/fsck-cmd.py --replace "'par2'" "'${par2cmdline}/bin/par2'"
|
||||
'';
|
||||
|
||||
dontAddPrefix = true;
|
||||
|
@ -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
|
||||
|
@ -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 { };
|
||||
|
||||
@ -12774,6 +12774,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 {};
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user