Added nvidia drivers

This commit is contained in:
didier committed 2024-10-30 08:11:33 -04:00
1 parent 319e5f4e0f
commit 43423300b5
2 files changed
+23 -1

No files matched your search

+8
View File
@@ -1,5 +1,13 @@
{ {
description = "Tool to build NixOS for GCP. "; description = "Tool to build NixOS for GCP. ";
nixConfig = {
extra-substituters = [
"https://cuda-maintainers.cachix.org"
];
extra-trusted-public-keys = [
"cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
];
};
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
+15 -1
View File
@@ -1,4 +1,4 @@
{ pkgs, lib, modulesPath, ... }: { { pkgs, lib, modulesPath, config, ... }: {
imports = [ "${modulesPath}/virtualisation/google-compute-image.nix" ]; imports = [ "${modulesPath}/virtualisation/google-compute-image.nix" ];
config = { config = {
@@ -55,6 +55,7 @@
bat bat
ripgrep ripgrep
helix helix
(pkgs.python312.withPackages (ps: [ps.torch]))
]; ];
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
nixpkgs.config.cudaSupport = true; nixpkgs.config.cudaSupport = true;
@@ -62,5 +63,18 @@
services.openssh.settings.PasswordAuthentication = false; services.openssh.settings.PasswordAuthentication = false;
programs.zsh.enable = true; programs.zsh.enable = true;
services.xserver.videoDrivers = ["nvidia"];
nix.settings.substituters = [
"https://cuda-maintainers.cachix.org"
];
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = false;
powerManagement.finegrained = false;
open = false;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
hardware.graphics.enable = true;
}; };
} }