mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-28 03:56:48 +03:00

After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.
Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.
A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.
This commit was automatically created and can be verified using
nix-build https://github.com/infinisil/treewide-nixpkgs-reformat-script/archive/a08b3a4d199c6124ac5b36a889d9099b4383463f.tar.gz \
--argstr baseRev b32a094368
result/bin/apply-formatting $NIXPKGS_PATH
62 lines
1.6 KiB
Nix
62 lines
1.6 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
|
|
let
|
|
cfg = config.hardware.amdgpu.amdvlk;
|
|
in
|
|
{
|
|
options.hardware.amdgpu.amdvlk = {
|
|
enable = lib.mkEnableOption "AMDVLK Vulkan driver";
|
|
|
|
package = lib.mkPackageOption pkgs "amdvlk" { };
|
|
|
|
supportExperimental.enable = lib.mkEnableOption "Experimental features support";
|
|
|
|
support32Bit.enable = lib.mkEnableOption "32-bit driver support";
|
|
support32Bit.package = lib.mkPackageOption pkgs [ "driversi686Linux" "amdvlk" ] { };
|
|
|
|
settings = lib.mkOption {
|
|
type = with lib.types; attrsOf (either str int);
|
|
default = { };
|
|
example = {
|
|
AllowVkPipelineCachingToDisk = 1;
|
|
ShaderCacheMode = 1;
|
|
IFH = 0;
|
|
EnableVmAlwaysValid = 1;
|
|
IdleAfterSubmitGpuMask = 1;
|
|
};
|
|
description = ''
|
|
Runtime settings for AMDVLK to be configured {file}`/etc/amd/amdVulkanSettings.cfg`.
|
|
See [AMDVLK GitHub page](https://github.com/GPUOpen-Drivers/AMDVLK?tab=readme-ov-file#runtime-settings).
|
|
'';
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
hardware.graphics = {
|
|
enable = true;
|
|
extraPackages = [ cfg.package ];
|
|
extraPackages32 = [ cfg.support32Bit.package ];
|
|
};
|
|
|
|
environment.sessionVariables = lib.mkIf cfg.supportExperimental.enable {
|
|
AMDVLK_ENABLE_DEVELOPING_EXT = "all";
|
|
};
|
|
|
|
environment.etc = lib.mkIf (cfg.settings != { }) {
|
|
"amd/amdVulkanSettings.cfg".text = lib.concatStrings (
|
|
lib.mapAttrsToList (n: v: ''
|
|
${n},${builtins.toString v}
|
|
'') cfg.settings
|
|
);
|
|
};
|
|
};
|
|
|
|
meta = {
|
|
maintainers = with lib.maintainers; [ johnrtitor ];
|
|
};
|
|
}
|