Merge master into staging-next

This commit is contained in:
github-actions[bot] 2021-06-11 18:05:07 +00:00 committed by GitHub
commit 69f9534853
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 457 additions and 338 deletions

View File

@ -7,7 +7,7 @@
The nixpkgs repository has several utility functions to manipulate Nix expressions.
</para>
<xi:include href="functions/library.xml" />
<xi:include href="functions/generators.xml" />
<xi:include href="functions/generators.section.xml" />
<xi:include href="functions/debug.section.xml" />
<xi:include href="functions/prefer-remote-fetch.section.xml" />
<xi:include href="functions/nix-gitignore.section.xml" />

View File

@ -0,0 +1,56 @@
# Generators {#sec-generators}
Generators are functions that create file formats from nix data structures, e.g. for configuration files. There are generators available for: `INI`, `JSON` and `YAML`
All generators follow a similar call interface: `generatorName configFunctions data`, where `configFunctions` is an attrset of user-defined functions that format nested parts of the content. They each have common defaults, so often they do not need to be set manually. An example is `mkSectionName ? (name: libStr.escape [ "[" "]" ] name)` from the `INI` generator. It receives the name of a section and sanitizes it. The default `mkSectionName` escapes `[` and `]` with a backslash.
Generators can be fine-tuned to produce exactly the file format required by your application/service. One example is an INI-file format which uses `: ` as separator, the strings `"yes"`/`"no"` as boolean values and requires all string values to be quoted:
```nix
with lib;
let
customToINI = generators.toINI {
# specifies how to format a key/value pair
mkKeyValue = generators.mkKeyValueDefault {
# specifies the generated string for a subset of nix values
mkValueString = v:
if v == true then ''"yes"''
else if v == false then ''"no"''
else if isString v then ''"${v}"''
# and delegats all other values to the default generator
else generators.mkValueStringDefault {} v;
} ":";
};
# the INI file can now be given as plain old nix values
in customToINI {
main = {
pushinfo = true;
autopush = false;
host = "localhost";
port = 42;
};
mergetool = {
merge = "diff3";
};
}
```
This will produce the following INI file as nix string:
```INI
[main]
autopush:"no"
host:"localhost"
port:42
pushinfo:"yes"
str\:ange:"very::strange"
[mergetool]
merge:"diff3"
```
::: note
Nix store paths can be converted to strings by enclosing a derivation attribute like so: `"${drv}"`.
:::
Detailed documentation for each generator can be found in `lib/generators.nix`.

View File

@ -1,74 +0,0 @@
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
xml:id="sec-generators">
<title>Generators</title>
<para>
Generators are functions that create file formats from nix data structures, e.g. for configuration files. There are generators available for: <literal>INI</literal>, <literal>JSON</literal> and <literal>YAML</literal>
</para>
<para>
All generators follow a similar call interface: <code>generatorName configFunctions data</code>, where <literal>configFunctions</literal> is an attrset of user-defined functions that format nested parts of the content. They each have common defaults, so often they do not need to be set manually. An example is <code>mkSectionName ? (name: libStr.escape [ "[" "]" ] name)</code> from the <literal>INI</literal> generator. It receives the name of a section and sanitizes it. The default <literal>mkSectionName</literal> escapes <literal>[</literal> and <literal>]</literal> with a backslash.
</para>
<para>
Generators can be fine-tuned to produce exactly the file format required by your application/service. One example is an INI-file format which uses <literal>: </literal> as separator, the strings <literal>"yes"</literal>/<literal>"no"</literal> as boolean values and requires all string values to be quoted:
</para>
<programlisting>
with lib;
let
customToINI = generators.toINI {
# specifies how to format a key/value pair
mkKeyValue = generators.mkKeyValueDefault {
# specifies the generated string for a subset of nix values
mkValueString = v:
if v == true then ''"yes"''
else if v == false then ''"no"''
else if isString v then ''"${v}"''
# and delegats all other values to the default generator
else generators.mkValueStringDefault {} v;
} ":";
};
# the INI file can now be given as plain old nix values
in customToINI {
main = {
pushinfo = true;
autopush = false;
host = "localhost";
port = 42;
};
mergetool = {
merge = "diff3";
};
}
</programlisting>
<para>
This will produce the following INI file as nix string:
</para>
<programlisting>
[main]
autopush:"no"
host:"localhost"
port:42
pushinfo:"yes"
str\:ange:"very::strange"
[mergetool]
merge:"diff3"
</programlisting>
<note>
<para>
Nix store paths can be converted to strings by enclosing a derivation attribute like so: <code>"${drv}"</code>.
</para>
</note>
<para>
Detailed documentation for each generator can be found in <literal>lib/generators.nix</literal>.
</para>
</section>

View File

@ -0,0 +1,35 @@
# Boot Problems {#sec-boot-problems}
If NixOS fails to boot, there are a number of kernel command line parameters that may help you to identify or fix the issue. You can add these parameters in the GRUB boot menu by pressing “e” to modify the selected boot entry and editing the line starting with `linux`. The following are some useful kernel command line parameters that are recognised by the NixOS boot scripts or by systemd:
`boot.shell_on_fail`
: Allows the user to start a root shell if something goes wrong in stage 1 of the boot process (the initial ramdisk). This is disabled by default because there is no authentication for the root shell.
`boot.debug1`
: Start an interactive shell in stage 1 before anything useful has been done. That is, no modules have been loaded and no file systems have been mounted, except for `/proc` and `/sys`.
`boot.debug1devices`
: Like `boot.debug1`, but runs stage1 until kernel modules are loaded and device nodes are created. This may help with e.g. making the keyboard work.
`boot.debug1mounts`
: Like `boot.debug1` or `boot.debug1devices`, but runs stage1 until all filesystems that are mounted during initrd are mounted (see [neededForBoot](#opt-fileSystems._name_.neededForBoot)). As a motivating example, this could be useful if you've forgotten to set [neededForBoot](options.html#opt-fileSystems._name_.neededForBoot) on a file system.
`boot.trace`
: Print every shell command executed by the stage 1 and 2 boot scripts.
`single`
: Boot into rescue mode (a.k.a. single user mode). This will cause systemd to start nothing but the unit `rescue.target`, which runs `sulogin` to prompt for the root password and start a root login shell. Exiting the shell causes the system to continue with the normal boot process.
`systemd.log_level=debug` `systemd.log_target=console`
: Make systemd very verbose and send log messages to the console instead of the journal. For more parameters recognised by systemd, see systemd(1).
Notice that for `boot.shell_on_fail`, `boot.debug1`, `boot.debug1devices`, and `boot.debug1mounts`, if you did **not** select "start the new shell as pid 1", and you `exit` from the new shell, boot will proceed normally from the point where it failed, as if you'd chosen "ignore the error and continue".
If no login prompts or X11 login screens appear (e.g. due to hanging dependencies), you can press Alt+ArrowUp. If youre lucky, this will start rescue mode (described above). (Also note that since most units have a 90-second timeout before systemd gives up on them, the `agetty` login prompts should appear eventually unless something is very wrong.)

View File

@ -1,126 +0,0 @@
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
version="5.0"
xml:id="sec-boot-problems">
<title>Boot Problems</title>
<para>
If NixOS fails to boot, there are a number of kernel command line parameters
that may help you to identify or fix the issue. You can add these parameters
in the GRUB boot menu by pressing “e” to modify the selected boot entry
and editing the line starting with <literal>linux</literal>. The following
are some useful kernel command line parameters that are recognised by the
NixOS boot scripts or by systemd:
<variablelist>
<varlistentry>
<term>
<literal>boot.shell_on_fail</literal>
</term>
<listitem>
<para>
Allows the user to start a root shell if something goes wrong in stage 1
of the boot process (the initial ramdisk). This is disabled by default
because there is no authentication for the root shell.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>boot.debug1</literal>
</term>
<listitem>
<para>
Start an interactive shell in stage 1 before anything useful has been
done. That is, no modules have been loaded and no file systems have been
mounted, except for <filename>/proc</filename> and
<filename>/sys</filename>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>boot.debug1devices</literal>
</term>
<listitem>
<para>
Like <literal>boot.debug1</literal>, but runs stage1 until kernel modules are loaded and device nodes are created.
This may help with e.g. making the keyboard work.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>boot.debug1mounts</literal>
</term>
<listitem>
<para>
Like <literal>boot.debug1</literal> or
<literal>boot.debug1devices</literal>, but runs stage1 until all
filesystems that are mounted during initrd are mounted (see
<option><link linkend="opt-fileSystems._name_.neededForBoot">neededForBoot</link></option>
). As a motivating example, this could be useful if you've forgotten to set
<option><link linkend="opt-fileSystems._name_.neededForBoot">neededForBoot</link></option>
on a file system.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>boot.trace</literal>
</term>
<listitem>
<para>
Print every shell command executed by the stage 1 and 2 boot scripts.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>single</literal>
</term>
<listitem>
<para>
Boot into rescue mode (a.k.a. single user mode). This will cause systemd
to start nothing but the unit <literal>rescue.target</literal>, which
runs <command>sulogin</command> to prompt for the root password and start
a root login shell. Exiting the shell causes the system to continue with
the normal boot process.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>systemd.log_level=debug systemd.log_target=console</literal>
</term>
<listitem>
<para>
Make systemd very verbose and send log messages to the console instead of
the journal.
</para>
</listitem>
</varlistentry>
</variablelist>
For more parameters recognised by systemd, see <citerefentry>
<refentrytitle>systemd</refentrytitle>
<manvolnum>1</manvolnum></citerefentry>.
</para>
<para>
Notice that for <literal>boot.shell_on_fail</literal>,
<literal>boot.debug1</literal>, <literal>boot.debug1devices</literal>, and
<literal>boot.debug1mounts</literal>, if you did <emphasis>not</emphasis>
select "start the new shell as pid 1", and you <literal>exit</literal> from
the new shell, boot will proceed normally from the point where it failed, as
if you'd chosen "ignore the error and continue".
</para>
<para>
If no login prompts or X11 login screens appear (e.g. due to hanging
dependencies), you can press Alt+ArrowUp. If youre lucky, this will start
rescue mode (described above). (Also note that since most units have a
90-second timeout before systemd gives up on them, the
<command>agetty</command> login prompts should appear eventually unless
something is very wrong.)
</para>
</section>

View File

@ -8,7 +8,7 @@
This chapter describes solutions to common problems you might encounter when
you manage your NixOS system.
</para>
<xi:include href="boot-problems.xml" />
<xi:include href="../from_md/administration/boot-problems.section.xml" />
<xi:include href="maintenance-mode.xml" />
<xi:include href="rollback.xml" />
<xi:include href="store-corruption.xml" />

View File

@ -191,9 +191,12 @@
<para>
GTK themes can be installed either to user profile or system-wide (via
<literal>environment.systemPackages</literal>). To make Qt 5 applications
look similar to GTK2 ones, you can install <literal>qt5.qtbase.gtk</literal>
package into your system environment. It should work for all Qt 5 library
versions.
look similar to GTK ones, you can use the following configuration:
<programlisting>
<xref linkend="opt-qt5.enable"/> = true;
<xref linkend="opt-qt5.platformTheme"/> = "gtk2";
<xref linkend="opt-qt5.style"/> = "gtk2";
</programlisting>
</para>
</simplesect>
<simplesect xml:id="custom-xkb-layouts">

View File

@ -0,0 +1,40 @@
# Warnings and Assertions {#sec-assertions}
When configuration problems are detectable in a module, it is a good idea to write an assertion or warning. Doing so provides clear feedback to the user and prevents errors after the build.
Although Nix has the `abort` and `builtins.trace` [functions](https://nixos.org/nix/manual/#ssec-builtins) to perform such tasks, they are not ideally suited for NixOS modules. Instead of these functions, you can declare your warnings and assertions using the NixOS module system.
## Warnings {#sec-assertions-warnings}
This is an example of using `warnings`.
```nix
{ config, lib, ... }:
{
config = lib.mkIf config.services.foo.enable {
warnings =
if config.services.foo.bar
then [ ''You have enabled the bar feature of the foo service.
This is known to cause some specific problems in certain situations.
'' ]
else [];
}
}
```
## Assertions {#sec-assertions-assetions}
This example, extracted from the [`syslogd` module](https://github.com/NixOS/nixpkgs/blob/release-17.09/nixos/modules/services/logging/syslogd.nix) shows how to use `assertions`. Since there can only be one active syslog daemon at a time, an assertion is useful to prevent such a broken system from being built.
```nix
{ config, lib, ... }:
{
config = lib.mkIf config.services.syslogd.enable {
assertions =
[ { assertion = !config.services.rsyslogd.enable;
message = "rsyslogd conflicts with syslogd";
}
];
}
}
```

View File

@ -1,74 +0,0 @@
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
version="5.0"
xml:id="sec-assertions">
<title>Warnings and Assertions</title>
<para>
When configuration problems are detectable in a module, it is a good idea to
write an assertion or warning. Doing so provides clear feedback to the user
and prevents errors after the build.
</para>
<para>
Although Nix has the <literal>abort</literal> and
<literal>builtins.trace</literal>
<link xlink:href="https://nixos.org/nix/manual/#ssec-builtins">functions</link>
to perform such tasks, they are not ideally suited for NixOS modules. Instead
of these functions, you can declare your warnings and assertions using the
NixOS module system.
</para>
<section xml:id="sec-assertions-warnings">
<title>Warnings</title>
<para>
This is an example of using <literal>warnings</literal>.
</para>
<programlisting>
<![CDATA[
{ config, lib, ... }:
{
config = lib.mkIf config.services.foo.enable {
warnings =
if config.services.foo.bar
then [ ''You have enabled the bar feature of the foo service.
This is known to cause some specific problems in certain situations.
'' ]
else [];
}
}
]]>
</programlisting>
</section>
<section xml:id="sec-assertions-assertions">
<title>Assertions</title>
<para>
This example, extracted from the
<link xlink:href="https://github.com/NixOS/nixpkgs/blob/release-17.09/nixos/modules/services/logging/syslogd.nix">
<literal>syslogd</literal> module </link> shows how to use
<literal>assertions</literal>. Since there can only be one active syslog
daemon at a time, an assertion is useful to prevent such a broken system
from being built.
</para>
<programlisting>
<![CDATA[
{ config, lib, ... }:
{
config = lib.mkIf config.services.syslogd.enable {
assertions =
[ { assertion = !config.services.rsyslogd.enable;
message = "rsyslogd conflicts with syslogd";
}
];
}
}
]]>
</programlisting>
</section>
</section>

View File

@ -182,7 +182,7 @@ in {
<xi:include href="option-declarations.xml" />
<xi:include href="option-types.xml" />
<xi:include href="option-def.xml" />
<xi:include href="assertions.xml" />
<xi:include href="../from_md/development/assertions.section.xml" />
<xi:include href="meta-attributes.xml" />
<xi:include href="importing-modules.xml" />
<xi:include href="replace-modules.xml" />

View File

@ -0,0 +1,127 @@
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-boot-problems">
<title>Boot Problems</title>
<para>
If NixOS fails to boot, there are a number of kernel command line
parameters that may help you to identify or fix the issue. You can
add these parameters in the GRUB boot menu by pressing
<quote>e</quote> to modify the selected boot entry and editing the
line starting with <literal>linux</literal>. The following are some
useful kernel command line parameters that are recognised by the
NixOS boot scripts or by systemd:
</para>
<variablelist>
<varlistentry>
<term>
<literal>boot.shell_on_fail</literal>
</term>
<listitem>
<para>
Allows the user to start a root shell if something goes wrong
in stage 1 of the boot process (the initial ramdisk). This is
disabled by default because there is no authentication for the
root shell.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>boot.debug1</literal>
</term>
<listitem>
<para>
Start an interactive shell in stage 1 before anything useful
has been done. That is, no modules have been loaded and no
file systems have been mounted, except for
<literal>/proc</literal> and <literal>/sys</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>boot.debug1devices</literal>
</term>
<listitem>
<para>
Like <literal>boot.debug1</literal>, but runs stage1 until
kernel modules are loaded and device nodes are created. This
may help with e.g. making the keyboard work.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>boot.debug1mounts</literal>
</term>
<listitem>
<para>
Like <literal>boot.debug1</literal> or
<literal>boot.debug1devices</literal>, but runs stage1 until
all filesystems that are mounted during initrd are mounted
(see
<link linkend="opt-fileSystems._name_.neededForBoot">neededForBoot</link>).
As a motivating example, this could be useful if youve
forgotten to set
<link xlink:href="options.html#opt-fileSystems._name_.neededForBoot">neededForBoot</link>
on a file system.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>boot.trace</literal>
</term>
<listitem>
<para>
Print every shell command executed by the stage 1 and 2 boot
scripts.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>single</literal>
</term>
<listitem>
<para>
Boot into rescue mode (a.k.a. single user mode). This will
cause systemd to start nothing but the unit
<literal>rescue.target</literal>, which runs
<literal>sulogin</literal> to prompt for the root password and
start a root login shell. Exiting the shell causes the system
to continue with the normal boot process.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>systemd.log_level=debug</literal>
<literal>systemd.log_target=console</literal>
</term>
<listitem>
<para>
Make systemd very verbose and send log messages to the console
instead of the journal. For more parameters recognised by
systemd, see systemd(1).
</para>
</listitem>
</varlistentry>
</variablelist>
<para>
Notice that for <literal>boot.shell_on_fail</literal>,
<literal>boot.debug1</literal>,
<literal>boot.debug1devices</literal>, and
<literal>boot.debug1mounts</literal>, if you did
<emphasis role="strong">not</emphasis> select <quote>start the new
shell as pid 1</quote>, and you <literal>exit</literal> from the new
shell, boot will proceed normally from the point where it failed, as
if youd chosen <quote>ignore the error and continue</quote>.
</para>
<para>
If no login prompts or X11 login screens appear (e.g. due to hanging
dependencies), you can press Alt+ArrowUp. If youre lucky, this will
start rescue mode (described above). (Also note that since most
units have a 90-second timeout before systemd gives up on them, the
<literal>agetty</literal> login prompts should appear eventually
unless something is very wrong.)
</para>
</section>

View File

@ -0,0 +1,58 @@
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-assertions">
<title>Warnings and Assertions</title>
<para>
When configuration problems are detectable in a module, it is a good
idea to write an assertion or warning. Doing so provides clear
feedback to the user and prevents errors after the build.
</para>
<para>
Although Nix has the <literal>abort</literal> and
<literal>builtins.trace</literal>
<link xlink:href="https://nixos.org/nix/manual/#ssec-builtins">functions</link>
to perform such tasks, they are not ideally suited for NixOS
modules. Instead of these functions, you can declare your warnings
and assertions using the NixOS module system.
</para>
<section xml:id="sec-assertions-warnings">
<title>Warnings</title>
<para>
This is an example of using <literal>warnings</literal>.
</para>
<programlisting language="bash">
{ config, lib, ... }:
{
config = lib.mkIf config.services.foo.enable {
warnings =
if config.services.foo.bar
then [ ''You have enabled the bar feature of the foo service.
This is known to cause some specific problems in certain situations.
'' ]
else [];
}
}
</programlisting>
</section>
<section xml:id="sec-assertions-assetions">
<title>Assertions</title>
<para>
This example, extracted from the
<link xlink:href="https://github.com/NixOS/nixpkgs/blob/release-17.09/nixos/modules/services/logging/syslogd.nix"><literal>syslogd</literal>
module</link> shows how to use <literal>assertions</literal>.
Since there can only be one active syslog daemon at a time, an
assertion is useful to prevent such a broken system from being
built.
</para>
<programlisting language="bash">
{ config, lib, ... }:
{
config = lib.mkIf config.services.syslogd.enable {
assertions =
[ { assertion = !config.services.rsyslogd.enable;
message = &quot;rsyslogd conflicts with syslogd&quot;;
}
];
}
}
</programlisting>
</section>
</section>

View File

@ -74,7 +74,18 @@
"args": {
"factory.name": "support.node.driver",
"node.name": "Dummy-Driver",
"priority.driver": 8000
"node.group": "pipewire.dummy",
"priority.driver": 20000
}
},
{
"factory": "spa-node-factory",
"args": {
"factory.name": "support.node.driver",
"node.name": "Freewheel-Driver",
"priority.driver": 19000,
"node.group": "pipewire.freewheel",
"node.freewheel": true
}
}
],

View File

@ -48,7 +48,6 @@ in
default = false;
description = ''
Run workers for builds.sr.ht.
Perform manually on machine: `cd ${scfg.statePath}/images; docker build -t qemu -f qemu/Dockerfile .`
'';
};
@ -161,6 +160,21 @@ in
partOf = [ "buildsrht.service" ];
description = "builds.sr.ht worker service";
path = [ pkgs.openssh pkgs.docker ];
preStart = let qemuPackage = pkgs.qemu_kvm;
in ''
if [[ "$(docker images -q qemu:latest 2> /dev/null)" == "" || "$(cat ${statePath}/docker-image-qemu 2> /dev/null || true)" != "${qemuPackage.version}" ]]; then
# Create and import qemu:latest image for docker
${
pkgs.dockerTools.streamLayeredImage {
name = "qemu";
tag = "latest";
contents = [ qemuPackage ];
}
} | docker load
# Mark down current package version
printf "%s" "${qemuPackage.version}" > ${statePath}/docker-image-qemu
fi
'';
serviceConfig = {
Type = "simple";
User = user;

View File

@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
'';
homepage = "https://www.stellar.org/";
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ chris-martin ];
maintainers = with maintainers; [ ];
license = licenses.asl20;
};
}

View File

@ -16,13 +16,13 @@ in
stdenv.mkDerivation rec {
pname = "imagemagick";
version = "6.9.12-12";
version = "6.9.12-14";
src = fetchFromGitHub {
owner = "ImageMagick";
repo = "ImageMagick6";
rev = version;
sha256 = "sha256-yqMYuayQjPlTqi3+CtwP5CdsAGud/fHR0I2LwUPIq00=";
sha256 = "sha256-RK6N4koHVAqol16QXLFWUgI6N5Rph2QCIHxmDFs3Jfk=";
};
outputs = [ "out" "dev" "doc" ]; # bin/ isn't really big

View File

@ -36,7 +36,7 @@ stdenv.mkDerivation {
'';
homepage = "https://github.com/ethereum/wiki/wiki/Serpent";
license = with licenses; [ wtfpl ];
maintainers = with maintainers; [ chris-martin ];
maintainers = with maintainers; [ ];
platforms = platforms.all;
};
}

View File

@ -1,30 +1,30 @@
diff --git a/meson.build b/meson.build
index a27569bd..fcf18344 100644
index b6b4553b..f21c29d8 100644
--- a/meson.build
+++ b/meson.build
@@ -36,7 +36,10 @@ pipewire_libexecdir = prefix / get_option('libexecdir')
pipewire_localedir = prefix / get_option('localedir')
@@ -37,7 +37,10 @@ pipewire_localedir = prefix / get_option('localedir')
pipewire_sysconfdir = prefix / get_option('sysconfdir')
-pipewire_configdir = pipewire_sysconfdir / 'pipewire'
+pipewire_configdir = get_option('pipewire_config_dir')
+if pipewire_configdir == ''
+ pipewire_configdir = pipewire_sysconfdir / 'pipewire'
pipewire_configdir = pipewire_sysconfdir / 'pipewire'
-pipewire_confdatadir = pipewire_datadir / 'pipewire'
+pipewire_confdatadir = get_option('pipewire_confdata_dir')
+if pipewire_confdatadir == ''
+ pipewire_confdatadir = pipewire_datadir / 'pipewire'
+endif
modules_install_dir = pipewire_libdir / pipewire_name
if host_machine.system() == 'linux'
diff --git a/meson_options.txt b/meson_options.txt
index 85beb86a..372e8faa 100644
index 9bc33fcd..e4bd2dc1 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -67,6 +67,9 @@ option('jack-devel',
@@ -61,6 +61,9 @@ option('jack-devel',
option('libjack-path',
description: 'Where to install the libjack.so library',
type: 'string')
+option('pipewire_config_dir',
+ type : 'string',
+ description : 'Directory for pipewire configuration (defaults to /etc/pipewire)')
+option('pipewire_confdata_dir',
+ type: 'string',
+ description: 'Directory for pipewire default configuration (defaults to /usr/share/pipewire)')
option('spa-plugins',
description: 'Enable spa plugins integration',
type: 'feature',

View File

@ -0,0 +1,28 @@
diff --git a/src/daemon/pipewire.conf.in b/src/daemon/pipewire.conf.in
index bbafa134..227d3e06 100644
--- a/src/daemon/pipewire.conf.in
+++ b/src/daemon/pipewire.conf.in
@@ -116,7 +116,7 @@ context.modules = [
# access.allowed to list an array of paths of allowed
# apps.
#access.allowed = [
- # @media_session_path@
+ # <media_session_path>
#]
# An array of rejected paths.
@@ -220,12 +220,12 @@ context.exec = [
# but it is better to start it as a systemd service.
# Run the session manager with -h for options.
#
- @comment@{ path = "@media_session_path@" args = "" }
+ @comment@{ path = "<media_session_path>" args = "" }
#
# You can optionally start the pulseaudio-server here as well
# but it is better to start it as a systemd service.
# It can be interesting to start another daemon here that listens
# on another address with the -a option (eg. -a tcp:4713).
#
- @comment@{ path = "@pipewire_path@" args = "-c pipewire-pulse.conf" }
+ @comment@{ path = "<pipewire_path>" args = "-c pipewire-pulse.conf" }
]

View File

@ -2,6 +2,7 @@
, lib
, fetchFromGitLab
, removeReferencesTo
, python3
, meson
, ninja
, systemd
@ -19,6 +20,7 @@
, SDL2
, vulkan-headers
, vulkan-loader
, webrtc-audio-processing
, ncurses
, makeFontsConf
, callPackage
@ -31,6 +33,8 @@
, nativeHfpSupport ? true
, ofonoSupport ? true
, hsphfpdSupport ? true
, pulseTunnelSupport ? true, libpulseaudio ? null
, zeroconfSupport ? true, avahi ? null
}:
let
@ -42,7 +46,7 @@ let
self = stdenv.mkDerivation rec {
pname = "pipewire";
version = "0.3.27";
version = "0.3.30";
outputs = [
"out"
@ -60,7 +64,7 @@ let
owner = "pipewire";
repo = "pipewire";
rev = version;
sha256 = "sha256-GfcMODQWtcahBvXnZ98/PKIm4pkqLaz09oOy7zQR4IA=";
sha256 = "sha256-DnaPvZoDaegjtJNKBmCJEAZe5FQBnSER79FPnxiWQUE=";
};
patches = [
@ -72,8 +76,10 @@ let
./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).
# Add option for changing the config install directory
./0080-pipewire-config-dir.patch
# Remove output paths from the comments in the config templates to break dependency cycles
./0090-pipewire-config-template-paths.patch
];
nativeBuildInputs = [
@ -82,6 +88,7 @@ let
meson
ninja
pkg-config
python3
];
buildInputs = [
@ -94,12 +101,15 @@ let
udev
vulkan-headers
vulkan-loader
webrtc-audio-processing
valgrind
SDL2
systemd
] ++ lib.optionals gstreamerSupport [ gst_all_1.gst-plugins-base gst_all_1.gstreamer ]
++ lib.optional ffmpegSupport ffmpeg
++ lib.optionals bluezSupport [ bluez libopenaptx ldacbt sbc fdk_aac ];
++ lib.optionals bluezSupport [ bluez libopenaptx ldacbt sbc fdk_aac ]
++ lib.optional pulseTunnelSupport libpulseaudio
++ lib.optional zeroconfSupport avahi;
mesonFlags = [
"-Ddocs=enabled"
@ -112,6 +122,8 @@ let
"-Dmedia-session-prefix=${placeholder "mediaSession"}"
"-Dlibjack-path=${placeholder "jack"}/lib"
"-Dlibcamera=disabled"
"-Dlibpulse=${mesonEnable pulseTunnelSupport}"
"-Davahi=${mesonEnable zeroconfSupport}"
"-Dgstreamer=${mesonEnable gstreamerSupport}"
"-Dffmpeg=${mesonEnable ffmpegSupport}"
"-Dbluez5=${mesonEnable bluezSupport}"
@ -119,24 +131,35 @@ let
"-Dbluez5-backend-hfp-native=${mesonEnable nativeHfpSupport}"
"-Dbluez5-backend-ofono=${mesonEnable ofonoSupport}"
"-Dbluez5-backend-hsphfpd=${mesonEnable hsphfpdSupport}"
"-Dpipewire_config_dir=/etc/pipewire"
"-Dsysconfdir=/etc"
"-Dpipewire_confdata_dir=${placeholder "lib"}/share/pipewire"
];
FONTCONFIG_FILE = fontsConf; # Fontconfig error: Cannot load default config file
doCheck = true;
postUnpack = ''
patchShebangs source/doc/strip-static.sh
patchShebangs source/spa/tests/gen-cpp-test.py
'';
postInstall = ''
pushd .
cd $out
pushd $lib/share
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
for f in pipewire/*.conf; do
echo "Generating JSON from $f"
$out/bin/spa-json-dump "$f" > "$out/nix-support/etc/$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
for f in pipewire/media-session.d/*.conf; do
echo "Generating JSON from $f"
$out/bin/spa-json-dump "$f" > "$mediaSession/nix-support/etc/$f.json"
done
popd
moveToOutput "etc/pipewire/media-session.d/*.conf" "$mediaSession"
moveToOutput "share/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"
@ -155,6 +178,7 @@ let
test-paths = callPackage ./test-paths.nix {
paths-out = [
"share/alsa/alsa.conf.d/50-pipewire.conf"
"nix-support/etc/pipewire/client-rt.conf.json"
"nix-support/etc/pipewire/client.conf.json"
"nix-support/etc/pipewire/jack.conf.json"
"nix-support/etc/pipewire/pipewire.conf.json"

View File

@ -44,6 +44,6 @@ buildPythonPackage rec {
homepage = "https://github.com/ludbb/secp256k1-py";
description = "Python FFI bindings for secp256k1";
license = with lib.licenses; [ mit ];
maintainers = with lib.maintainers; [ chris-martin ];
maintainers = with lib.maintainers; [ ];
};
}

View File

@ -24,7 +24,6 @@ fast=
rollback=
upgrade=
upgrade_all=
repair=
profile=/nix/var/nix/profiles/system
buildHost=
targetHost=
@ -60,10 +59,6 @@ while [ "$#" -gt 0 ]; do
upgrade=1
upgrade_all=1
;;
--repair)
repair=1
extraBuildFlags+=("$i")
;;
--max-jobs|-j|--cores|-I|--builders)
j="$1"; shift 1
extraBuildFlags+=("$i" "$j")
@ -176,6 +171,7 @@ nixBuild() {
else
local instArgs=()
local buildArgs=()
local drv=
while [ "$#" -gt 0 ]; do
local i="$1"; shift 1
@ -202,7 +198,7 @@ nixBuild() {
esac
done
local drv="$(nix-instantiate "${instArgs[@]}" "${extraBuildFlags[@]}")"
drv="$(nix-instantiate "${instArgs[@]}" "${extraBuildFlags[@]}")"
if [ -a "$drv" ]; then
NIX_SSHOPTS=$SSHOPTS nix-copy-closure --to "$buildHost" "$drv"
buildHostCmd nix-store -r "$drv" "${buildArgs[@]}"
@ -222,6 +218,8 @@ nixFlakeBuild() {
shift 1
local evalArgs=()
local buildArgs=()
local drv=
while [ "$#" -gt 0 ]; do
local i="$1"; shift 1
case "$i" in
@ -243,7 +241,7 @@ nixFlakeBuild() {
esac
done
local drv="$(nix "${flakeFlags[@]}" eval --raw "${attr}.drvPath" "${evalArgs[@]}" "${extraBuildArgs[@]}")"
drv="$(nix "${flakeFlags[@]}" eval --raw "${attr}.drvPath" "${evalArgs[@]}" "${extraBuildFlags[@]}")"
if [ -a "$drv" ]; then
NIX_SSHOPTS=$SSHOPTS nix "${flakeFlags[@]}" copy --derivation --to "ssh://$buildHost" "$drv"
buildHostCmd nix-store -r "$drv" "${buildArgs[@]}"
@ -310,7 +308,7 @@ fi
if [[ -z $_NIXOS_REBUILD_REEXEC && -n $canRun && -z $fast && -z $flake ]]; then
if p=$(nix-build --no-out-link --expr 'with import <nixpkgs/nixos> {}; config.system.build.nixos-rebuild' "${extraBuildFlags[@]}"); then
export _NIXOS_REBUILD_REEXEC=1
exec $p/bin/nixos-rebuild "${origArgs[@]}"
exec "$p/bin/nixos-rebuild" "${origArgs[@]}"
exit 1
fi
fi
@ -393,14 +391,12 @@ prebuiltNix() {
fi
}
remotePATH=
if [[ -n $buildNix && -z $flake ]]; then
echo "building Nix..." >&2
nixDrv=
if ! nixDrv="$(nix-instantiate '<nixpkgs/nixos>' --add-root $tmpDir/nix.drv --indirect -A config.nix.package.out "${extraBuildFlags[@]}")"; then
if ! nixDrv="$(nix-instantiate '<nixpkgs>' --add-root $tmpDir/nix.drv --indirect -A nix "${extraBuildFlags[@]}")"; then
if ! nixStorePath="$(nix-instantiate --eval '<nixpkgs/nixos/modules/installer/tools/nix-fallback-paths.nix>' -A $(nixSystem) | sed -e 's/^"//' -e 's/"$//')"; then
if ! nixDrv="$(nix-instantiate '<nixpkgs/nixos>' --add-root "$tmpDir/nix.drv" --indirect -A config.nix.package.out "${extraBuildFlags[@]}")"; then
if ! nixDrv="$(nix-instantiate '<nixpkgs>' --add-root "$tmpDir/nix.drv" --indirect -A nix "${extraBuildFlags[@]}")"; then
if ! nixStorePath="$(nix-instantiate --eval '<nixpkgs/nixos/modules/installer/tools/nix-fallback-paths.nix>' -A "$(nixSystem)" | sed -e 's/^"//' -e 's/"$//')"; then
nixStorePath="$(prebuiltNix "$(uname -m)")"
fi
if ! nix-store -r $nixStorePath --add-root $tmpDir/nix --indirect \
@ -408,11 +404,11 @@ if [[ -n $buildNix && -z $flake ]]; then
echo "warning: don't know how to get latest Nix" >&2
fi
# Older version of nix-store -r don't support --add-root.
[ -e $tmpDir/nix ] || ln -sf $nixStorePath $tmpDir/nix
[ -e "$tmpDir/nix" ] || ln -sf "$nixStorePath" "$tmpDir/nix"
if [ -n "$buildHost" ]; then
remoteNixStorePath="$(prebuiltNix "$(buildHostCmd uname -m)")"
remoteNix="$remoteNixStorePath/bin"
if ! buildHostCmd nix-store -r $remoteNixStorePath \
if ! buildHostCmd nix-store -r "$remoteNixStorePath" \
--option extra-binary-caches https://cache.nixos.org/ >/dev/null; then
remoteNix=
echo "warning: don't know how to get latest Nix" >&2
@ -421,7 +417,7 @@ if [[ -n $buildNix && -z $flake ]]; then
fi
fi
if [ -a "$nixDrv" ]; then
nix-store -r "$nixDrv"'!'"out" --add-root $tmpDir/nix --indirect >/dev/null
nix-store -r "$nixDrv"'!'"out" --add-root "$tmpDir/nix" --indirect >/dev/null
if [ -n "$buildHost" ]; then
nix-copy-closure --to "$buildHost" "$nixDrv"
# The nix build produces multiple outputs, we add them all to the remote path
@ -438,7 +434,7 @@ fi
# nixos-version shows something useful).
if [[ -n $canRun && -z $flake ]]; then
if nixpkgs=$(nix-instantiate --find-file nixpkgs "${extraBuildFlags[@]}"); then
suffix=$($SHELL $nixpkgs/nixos/modules/installer/tools/get-version-suffix "${extraBuildFlags[@]}" || true)
suffix=$($SHELL "$nixpkgs/nixos/modules/installer/tools/get-version-suffix" "${extraBuildFlags[@]}" || true)
if [ -n "$suffix" ]; then
echo -n "$suffix" > "$nixpkgs/.version-suffix" || true
fi
@ -511,7 +507,7 @@ fi
# If we're not just building, then make the new configuration the boot
# default and/or activate it now.
if [ "$action" = switch -o "$action" = boot -o "$action" = test -o "$action" = dry-activate ]; then
if ! targetHostCmd $pathToConfig/bin/switch-to-configuration "$action"; then
if ! targetHostCmd "$pathToConfig/bin/switch-to-configuration" "$action"; then
echo "warning: error(s) occurred while switching to the new configuration" >&2
exit 1
fi

View File

@ -6,8 +6,8 @@
callPackage ./generic.nix args {
src = fetchhg {
url = "https://hg.nginx.org/nginx-quic";
rev = "12f18e0bca09"; # branch=quic
sha256 = "1lr6zlny26kamczgk8ddscmy5fp5mzxqcppwhjhvq1a029a0r4b7";
rev = "1fec68e322d0"; # branch=quic
sha256 = "0nr1mjic215yc6liyv1kfwhfdija3q2sw3qdwibds5vkg330vmw8";
};
preConfigure = ''

View File

@ -4,13 +4,13 @@
stdenv.mkDerivation rec {
pname = "zsh-autosuggestions";
version = "0.6.4";
version = "0.7.0";
src = fetchFromGitHub {
owner = "zsh-users";
repo = "zsh-autosuggestions";
rev = "v${version}";
sha256 = "0h52p2waggzfshvy1wvhj4hf06fmzd44bv6j18k3l9rcx6aixzn6";
sha256 = "1g3pij5qn2j7v7jjac2a63lxd97mcsgw6xq6k5p7835q9fjiid98";
};
buildInputs = [ zsh ];

View File

@ -30,7 +30,7 @@ in stdenv.mkDerivation {
description = "Bitcoin client query library";
homepage = "https://github.com/libbitcoin/libbitcoin-client";
platforms = platforms.linux ++ platforms.darwin;
maintainers = with maintainers; [ chris-martin ];
maintainers = with maintainers; [ ];
# AGPL with a lesser clause
license = licenses.agpl3;

View File

@ -31,7 +31,7 @@ in stdenv.mkDerivation {
description = "Bitcoin command line tool";
homepage = "https://github.com/libbitcoin/libbitcoin-explorer";
platforms = platforms.linux ++ platforms.darwin;
maintainers = with maintainers; [ chris-martin asymmetric ];
maintainers = with maintainers; [ asymmetric ];
# AGPL with a lesser clause
license = licenses.agpl3;

View File

@ -31,7 +31,7 @@ in stdenv.mkDerivation {
description = "C++ library for building bitcoin applications";
homepage = "https://libbitcoin.org/";
platforms = platforms.linux ++ platforms.darwin;
maintainers = with maintainers; [ chris-martin ];
maintainers = with maintainers; [ ];
# AGPL with a lesser clause
license = licenses.agpl3;

View File

@ -51,7 +51,7 @@ stdenv.mkDerivation {
'';
homepage = "https://github.com/bitcoin-core/secp256k1";
license = with licenses; [ mit ];
maintainers = with maintainers; [ chris-martin ];
maintainers = with maintainers; [ ];
platforms = with platforms; unix;
};
}

View File

@ -3,16 +3,17 @@
rustPlatform.buildRustPackage rec {
pname = "tectonic";
version = "0.4.1";
version = "0.5.2";
src = fetchFromGitHub {
owner = "tectonic-typesetting";
repo = "tectonic";
rev = "tectonic@${version}";
sha256 = "sha256-XQ3KRM12X80JPFMnQs//8ZJEv+AV1sr3BH0Nw/PH0HQ=";
fetchSubmodules = true;
sha256 = "sha256-JQ78N+cfk1D6xZixoUvYiLP6ZwovBn/ro1CZoutBwp8=";
};
cargoSha256 = "sha256-930tFAKMCmTFS9faIWLSVtWN/gAA9UAUMuRo61XISYA=";
cargoSha256 = "sha256-disJme0UM6U+yWjGsPya0xDvW6iQsipqMkEALeJ99xU=";
nativeBuildInputs = [ pkg-config ];