mirror of
https://github.com/nix-community/home-manager
synced 2024-11-10 07:04:17 +00:00
nixgl: Improve option documentation
This commit is contained in:
parent
f54a6b0076
commit
830c928697
1 changed files with 23 additions and 6 deletions
|
@ -10,12 +10,28 @@ in {
|
|||
example = lib.literalExpression
|
||||
''"''${inputs.nixGL.packages.x86_64-linux.nixGLIntel}/bin/nixGLIntel"'';
|
||||
description = ''
|
||||
The nixGL command that `lib.nixGL.wrap` should wrap packages with.
|
||||
This can be used to provide libGL access to applications on non-NixOS systems.
|
||||
The [nixGL](https://github.com/nix-community/nixGL) command that `lib.nixGL.wrap` should prefix
|
||||
package binaries with. nixGL provides your system's version of libGL to applications, enabling
|
||||
them to access the GPU on non-NixOS systems.
|
||||
|
||||
Wrap individual packages like so: `(config.lib.nixGL.wrap <package>)`. The returned package
|
||||
can be used just like the original one, but will have access to libGL. If this option is empty (the default),
|
||||
then `lib.nixGL.wrap` is a no-op. This is useful on NixOS, where the wrappers are unnecessary.
|
||||
Wrap individual packages which require GPU access with the function like so: `(config.lib.nixGL.wrap <package>)`.
|
||||
The returned package can be used just like the original one, but will have access to libGL. For example:
|
||||
|
||||
```nix
|
||||
# If you're using a Home Manager module to configure the package,
|
||||
# pass it into the module's package argument:
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
package = (config.lib.nixGL.wrap pkgs.kitty);
|
||||
};
|
||||
|
||||
# Otherwise, pass it to any option where a package is expected:
|
||||
home.packages = [ (config.lib.nixGL.wrap pkgs.hello) ];
|
||||
```
|
||||
|
||||
If this option is empty (the default), then `lib.nixGL.wrap` is a no-op. This is useful for sharing your Home Manager
|
||||
configurations between NixOS and non-NixOS systems, since NixOS already provides libGL to applications without the
|
||||
need for nixGL.
|
||||
'';
|
||||
};
|
||||
|
||||
|
@ -35,7 +51,8 @@ in {
|
|||
# a new debug output to be produced. We won't be producing any debug info
|
||||
# for the original package.
|
||||
separateDebugInfo = false;
|
||||
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ pkgs.makeWrapper ];
|
||||
nativeBuildInputs = old.nativeBuildInputs or [ ]
|
||||
++ [ pkgs.makeWrapper ];
|
||||
buildCommand = ''
|
||||
set -eo pipefail
|
||||
|
||||
|
|
Loading…
Reference in a new issue