mirror of
https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git
synced 2025-04-02 12:11:21 +02:00
wenche: Fix nvidia driver. flake: add shells/cuda.
This commit is contained in:
parent
bdaa765dbb
commit
4f28815018
@ -160,6 +160,15 @@
|
||||
|
||||
devShells = forAllSystems (system: {
|
||||
default = nixpkgs.legacyPackages.${system}.callPackage ./shell.nix { };
|
||||
cuda = let
|
||||
cuda-pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config = {
|
||||
allowUnfree = true;
|
||||
cudaSupport = true;
|
||||
};
|
||||
};
|
||||
in cuda-pkgs.callPackage ./shells/cuda.nix { };
|
||||
});
|
||||
|
||||
packages = {
|
||||
|
@ -27,7 +27,7 @@
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = true;
|
||||
open = true;
|
||||
open = false;
|
||||
package = config.boot.kernelPackages.nvidiaPackages.production;
|
||||
};
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.kernelModules = [ "nvidia" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
|
25
shells/cuda.nix
Normal file
25
shells/cuda.nix
Normal file
@ -0,0 +1,25 @@
|
||||
# nix develop .#cuda
|
||||
# Copied from https://nixos.wiki/wiki/CUDA
|
||||
{ pkgs }:
|
||||
|
||||
pkgs.mkShell {
|
||||
name = "cuda-env-shell";
|
||||
buildInputs = with pkgs; [
|
||||
git gitRepo gnupg autoconf curl
|
||||
procps gnumake util-linux m4 gperf unzip
|
||||
cudatoolkit linuxPackages.nvidia_x11
|
||||
libGLU libGL
|
||||
xorg.libXi xorg.libXmu freeglut
|
||||
xorg.libXext xorg.libX11 xorg.libXv xorg.libXrandr zlib
|
||||
ncurses5 stdenv.cc binutils
|
||||
|
||||
# Other applications, like
|
||||
hashcat
|
||||
];
|
||||
shellHook = ''
|
||||
export CUDA_PATH=${pkgs.cudatoolkit}
|
||||
# export LD_LIBRARY_PATH=${pkgs.linuxPackages.nvidia_x11}/lib:${pkgs.ncurses5}/lib
|
||||
export EXTRA_LDFLAGS="-L/lib -L${pkgs.linuxPackages.nvidia_x11}/lib"
|
||||
export EXTRA_CCFLAGS="-I/usr/include"
|
||||
'';
|
||||
}
|
Loading…
Reference in New Issue
Block a user