Run alejandra

This commit is contained in:
ItsDrike 2024-07-27 01:07:07 +02:00
parent 286920def4
commit c00134da1c
Signed by: ItsDrike
GPG key ID: FA2745890B7048C0
152 changed files with 827 additions and 721 deletions

View file

@ -1,15 +1,18 @@
# WARNING: This file is currently untested
# WARNING: This file is currently untested
# (I didn't yet run this NixOS config on any AMD GPU systems)
{ config, lib, pkgs, ... }:
let
dev = config.myOptions.device;
in
{
config,
lib,
pkgs,
...
}: let
dev = config.myOptions.device;
in {
config = lib.mkIf (dev.gpu.type == "amd") {
services.xserver.videoDrivers = lib.mkDefault ["modesetting" "amdgpu"];
boot = {
initrd.kernelModules = ["amdgpu"]; # load amdgpu kernel module as early as initrd
initrd.kernelModules = ["amdgpu"]; # load amdgpu kernel module as early as initrd
kernelModules = ["amdgpu"]; # if loading somehow fails during initrd but the boot continues, try again later
};
@ -26,7 +29,7 @@ in
graphics = {
enable = true;
extraPackages = with pkgs; [
extraPackages = with pkgs; [
# Enable AMDVLK (AMD's open-source Vulkan driver)
amdvlk
@ -35,14 +38,14 @@ in
rocmPackages.clr.icd
];
# AMDVLK for 32-bit applications
extraPackages32 = with pkgs; [ driversi686Linux.amdvlk ];
extraPackages32 = with pkgs; [driversi686Linux.amdvlk];
};
};
# HIP (SDK that allows running CUDA code on AMD GPUs)
# Most software has the paths hard-coded
systemd.tmpfiles.rules = [
"L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}"
"L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}"
];
};
}

View file

@ -4,4 +4,3 @@ _: {
./nvidia.nix
];
}

View file

@ -1,11 +1,14 @@
{ config, lib, pkgs, ... }:
let
{
config,
lib,
pkgs,
...
}: let
dev = config.myOptions.device;
isWayland = config.myOptions.home-manager.wms.isWayland;
inherit (lib) mkIf mkDefault mkMerge;
in
{
in {
config = mkIf (builtins.elem dev.gpu.type ["nvidia" "hybrid-nvidia"]) {
# Nvidia drivers are unfree software
nixpkgs.config.allowUnfree = true;
@ -35,9 +38,9 @@ in
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at: https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# supported GPUs is at: https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
#
# Enable this by default, hosts may override this option if their gpu is not
# Enable this by default, hosts may override this option if their gpu is not
# supported by the open source drivers
open = mkDefault true;
@ -88,7 +91,7 @@ in
];
sessionVariables = mkMerge [
{ LIBVA_DRIVER_NAME = "nvidia"; }
{LIBVA_DRIVER_NAME = "nvidia";}
(mkIf isWayland {
WLR_NO_HARDWARE_CURSORS = "1";