Skip to content

Commit

Permalink
Merge staging-next into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jun 20, 2024
2 parents bf54c13 + 868f391 commit 667f4bf
Show file tree
Hide file tree
Showing 118 changed files with 8,894 additions and 6,191 deletions.
12 changes: 12 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4260,6 +4260,12 @@
github = "d4ilyrun";
githubId = 34611103;
};
d4rkstar = {
name = "Bruno Salzano";
email = "d4rkstar@gmail.com";
github = "d4rkstar";
githubId = 4957015;
};
dadada = {
name = "dadada";
email = "dadada@dadada.li";
Expand Down Expand Up @@ -13629,6 +13635,12 @@
githubId = 3856390;
email = "mschwaig+nixpkgs@eml.cc";
};
msciabarra = {
email = "msciabarra@apache.org";
github = "sciabarracom";
githubId = 30654959;
name = "Michele Sciabarra";
};
msiedlarek = {
email = "mikolaj@siedlarek.pl";
github = "msiedlarek";
Expand Down
3 changes: 3 additions & 0 deletions maintainers/scripts/pluginupdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,10 @@ def update_plugins(editor: Editor, args):
fetch_config = FetchConfig(args.proc, args.github_token)
update = editor.get_update(args.input_file, args.outfile, fetch_config)

start_time = time.time()
redirects = update()
duration = time.time() - start_time
print(f"The plugin update took {duration}s.")
editor.rewrite_input(fetch_config, args.input_file, editor.deprecated, redirects)

autocommit = not args.no_commit
Expand Down
28 changes: 14 additions & 14 deletions nixos/doc/manual/configuration/gpu-accel.chapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ $ export \
```

The second mechanism is to add the OpenCL driver package to
[](#opt-hardware.opengl.extraPackages).
[](#opt-hardware.graphics.extraPackages).
This links the ICD file under `/run/opengl-driver`, where it will be visible
to the ICD loader.

Expand All @@ -51,12 +51,12 @@ Platform Vendor Advanced Micro Devices, Inc.
Modern AMD [Graphics Core
Next](https://en.wikipedia.org/wiki/Graphics_Core_Next) (GCN) GPUs are
supported through the rocmPackages.clr.icd package. Adding this package to
[](#opt-hardware.opengl.extraPackages)
[](#opt-hardware.graphics.extraPackages)
enables OpenCL support:

```nix
{
hardware.opengl.extraPackages = [
hardware.graphics.extraPackages = [
rocmPackages.clr.icd
];
}
Expand All @@ -71,13 +71,13 @@ intel-compute-runtime package. The proprietary Intel OpenCL runtime, in
the intel-ocl package, is an alternative for Gen7 GPUs.

The intel-compute-runtime or intel-ocl package can be added to
[](#opt-hardware.opengl.extraPackages)
[](#opt-hardware.graphics.extraPackages)
to enable OpenCL support. For example, for Gen8 and later GPUs, the following
configuration can be used:

```nix
{
hardware.opengl.extraPackages = [
hardware.graphics.extraPackages = [
intel-compute-runtime
];
}
Expand All @@ -90,8 +90,8 @@ compute API for GPUs. It is used directly by games or indirectly though
compatibility layers like
[DXVK](https://github.com/doitsujin/dxvk/wiki).

By default, if [](#opt-hardware.opengl.driSupport)
is enabled, mesa is installed and provides Vulkan for supported hardware.
By default, if [](#opt-hardware.graphics.enable)
is enabled, Mesa is installed and provides Vulkan for supported hardware.

Similar to OpenCL, Vulkan drivers are loaded through the *Installable
Client Driver* (ICD) mechanism. ICD files for Vulkan are JSON files that
Expand All @@ -110,7 +110,7 @@ $ export \
```

The second mechanism is to add the Vulkan driver package to
[](#opt-hardware.opengl.extraPackages).
[](#opt-hardware.graphics.extraPackages).
This links the ICD file under `/run/opengl-driver`, where it will be
visible to the ICD loader.

Expand Down Expand Up @@ -140,18 +140,18 @@ Modern AMD [Graphics Core
Next](https://en.wikipedia.org/wiki/Graphics_Core_Next) (GCN) GPUs are
supported through either radv, which is part of mesa, or the amdvlk
package. Adding the amdvlk package to
[](#opt-hardware.opengl.extraPackages)
[](#opt-hardware.graphics.extraPackages)
makes amdvlk the default driver and hides radv and lavapipe from the device list.
A specific driver can be forced as follows:

```nix
{
hardware.opengl.extraPackages = [
hardware.graphics.extraPackages = [
pkgs.amdvlk
];
# To enable Vulkan support for 32-bit applications, also add:
hardware.opengl.extraPackages32 = [
hardware.graphics.extraPackages32 = [
pkgs.driversi686Linux.amdvlk
];
Expand All @@ -171,7 +171,7 @@ graphics hardware acceleration capabilities for video processing.

VA-API drivers are loaded by `libva`. The version in nixpkgs is built to search
the opengl driver path, so drivers can be installed in
[](#opt-hardware.opengl.extraPackages).
[](#opt-hardware.graphics.extraPackages).

VA-API can be tested using:

Expand All @@ -185,7 +185,7 @@ Modern Intel GPUs use the iHD driver, which can be installed with:

```nix
{
hardware.opengl.extraPackages = [
hardware.graphics.extraPackages = [
intel-media-driver
];
}
Expand All @@ -195,7 +195,7 @@ Older Intel GPUs use the i965 driver, which can be installed with:

```nix
{
hardware.opengl.extraPackages = [
hardware.graphics.extraPackages = [
intel-vaapi-driver
];
}
Expand Down
19 changes: 1 addition & 18 deletions nixos/doc/manual/configuration/x-windows.chapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Wine, you should also set the following:

```nix
{
hardware.opengl.driSupport32Bit = true;
hardware.graphics.enable32Bit = true;
}
```

Expand Down Expand Up @@ -183,23 +183,6 @@ If you have an older card, you may have to use one of the legacy drivers:
You may need to reboot after enabling this driver to prevent a clash
with other kernel modules.

## Proprietary AMD drivers {#sec-x11--graphics-cards-amd}

AMD provides a proprietary driver for its graphics cards that is not
enabled by default because it's not Free Software, is often broken in
nixpkgs and as of this writing doesn't offer more features or
performance. If you still want to use it anyway, you need to explicitly
set:

```nix
{
services.xserver.videoDrivers = [ "amdgpu-pro" ];
}
```

You will need to reboot after enabling this driver to prevent a clash
with other kernel modules.

## Touchpads {#sec-x11-touchpads}

Support for Synaptics touchpads (found in many laptops such as the Dell
Expand Down
2 changes: 2 additions & 0 deletions nixos/doc/manual/release-notes/rl-2405.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m

- [xdg-terminal-exec](https://github.com/Vladimir-csp/xdg-terminal-exec), the proposed Default Terminal Execution Specification.

- Convenience options for `amdgpu`, open source driver for Radeon cards, is now available under `hardware.amdgpu`.

- [ydotool](https://github.com/ReimuNotMoe/ydotool), a generic command-line automation tool now has a module. Available as [programs.ydotool](#opt-programs.ydotool.enable).

- [your_spotify](https://github.com/Yooooomi/your_spotify), a self hosted Spotify tracking dashboard. Available as [services.your_spotify](#opt-services.your_spotify.enable)
Expand Down
2 changes: 2 additions & 0 deletions nixos/doc/manual/release-notes/rl-2411.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## Highlights {#sec-release-24.11-highlights}

- Convenience options for `amdgpu`, open source driver for Radeon cards, is now available under `hardware.amdgpu`.

- [AMDVLK](https://github.com/GPUOpen-Drivers/AMDVLK), AMD's open source Vulkan driver, is now available to be configured as `hardware.amdgpu.amdvlk` option.
This also allows configuring runtime settings of AMDVLK and enabling experimental features.

Expand Down
126 changes: 126 additions & 0 deletions nixos/modules/hardware/graphics.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
{ config, lib, pkgs, ... }:
let
cfg = config.hardware.graphics;

driversEnv = pkgs.buildEnv {
name = "graphics-drivers";
paths = [ cfg.package ] ++ cfg.extraPackages;
};

driversEnv32 = pkgs.buildEnv {
name = "graphics-drivers-32bit";
paths = [ cfg.package32 ] ++ cfg.extraPackages32;
};
in
{
imports = [
(lib.mkRenamedOptionModule [ "services" "xserver" "vaapiDrivers" ] [ "hardware" "opengl" "extraPackages" ])
(lib.mkRemovedOptionModule [ "hardware" "opengl" "s3tcSupport" ] "S3TC support is now always enabled in Mesa.")
(lib.mkRemovedOptionModule [ "hardware" "opengl" "driSupport"] "The setting can be removed.")

(lib.mkRenamedOptionModule [ "hardware" "opengl" "enable"] [ "hardware" "graphics" "enable" ])
(lib.mkRenamedOptionModule [ "hardware" "opengl" "driSupport32Bit"] [ "hardware" "graphics" "enable32Bit" ])
(lib.mkRenamedOptionModule [ "hardware" "opengl" "package"] [ "hardware" "graphics" "package" ])
(lib.mkRenamedOptionModule [ "hardware" "opengl" "package32"] [ "hardware" "graphics" "package32" ])
(lib.mkRenamedOptionModule [ "hardware" "opengl" "extraPackages"] [ "hardware" "graphics" "extraPackages" ])
(lib.mkRenamedOptionModule [ "hardware" "opengl" "extraPackages32"] [ "hardware" "graphics" "extraPackages32" ])
];

options.hardware.graphics = {
enable = lib.mkOption {
description = ''
Whether to enable hardware accelerated graphics drivers.
This is required to allow most graphical applications and
environments to use hardware rendering, video encode/decode
acceleration, etc.
This option should be enabled by default by the corresponding modules,
so you do not usually have to set it yourself.
'';
type = lib.types.bool;
default = false;
};

enable32Bit = lib.mkOption {
description = ''
On 64-bit systems, whether to also install 32-bit drivers for
32-bit applications (such as Wine).
'';
type = lib.types.bool;
default = false;
};

package = lib.mkOption {
description = ''
The package that provides the default driver set.
'';
type = lib.types.package;
internal = true;
};

package32 = lib.mkOption {
description = ''
The package that provides the 32-bit driver set. Used when {option}`enable32Bit` is enabled.
set.
'';
type = lib.types.package;
internal = true;
};

extraPackages = lib.mkOption {
description = ''
Additional packages to add to the default graphics driver lookup path.
This can be used to add OpenCL drivers, VA-API/VDPAU drivers, etc.
::: {.note}
intel-media-driver supports hardware Broadwell (2014) or newer. Older hardware should use the mostly unmaintained intel-vaapi-driver driver.
:::
'';
type = lib.types.listOf lib.types.package;
default = [];
example = lib.literalExpression "with pkgs; [ intel-media-driver intel-ocl intel-vaapi-driver ]";
};

extraPackages32 = lib.mkOption {
description = ''
Additional packages to add to 32-bit graphics driver lookup path on 64-bit systems.
Used when {option}`enable32Bit` is set. This can be used to add OpenCL drivers, VA-API/VDPAU drivers, etc.
::: {.note}
intel-media-driver supports hardware Broadwell (2014) or newer. Older hardware should use the mostly unmaintained intel-vaapi-driver driver.
:::
'';
type = lib.types.listOf lib.types.package;
default = [];
example = lib.literalExpression "with pkgs.pkgsi686Linux; [ intel-media-driver intel-vaapi-driver ]";
};
};

config = lib.mkIf cfg.enable {
assertions = [
{
assertion = cfg.enable32Bit -> pkgs.stdenv.isx86_64;
message = "`hardware.graphics.enable32Bit` only makes sense on a 64-bit system.";
}
{
assertion = cfg.enable32Bit -> (config.boot.kernelPackages.kernel.features.ia32Emulation or false);
message = "`hardware.graphics.enable32Bit` requires a kernel that supports 32-bit emulation";
}
];

systemd.tmpfiles.settings.graphics-driver = {
"/run/opengl-driver"."L+".argument = toString driversEnv;
"/run/opengl-driver-32" =
if pkgs.stdenv.isi686 then
{ "L+".argument = "opengl-driver"; }
else if cfg.enable32Bit then
{ "L+".argument = toString driversEnv32; }
else
{ "r" = {}; };
};

hardware.graphics.package = lib.mkDefault pkgs.mesa.drivers;
hardware.graphics.package32 = lib.mkDefault pkgs.pkgsi686Linux.mesa.drivers;
};
}
Loading

0 comments on commit 667f4bf

Please sign in to comment.