From ead58c4b1c68949f5ce14d9cf0d87aad083c6117 Mon Sep 17 00:00:00 2001 From: tomoron Date: Fri, 31 Jan 2025 22:34:54 +0100 Subject: [PATCH] add configuration for new nvdia gpu on server config --- flake.nix | 2 +- hosts/server.nix | 25 ++++++++++++++++++------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/flake.nix b/flake.nix index f40b890..d5776b9 100644 --- a/flake.nix +++ b/flake.nix @@ -6,7 +6,7 @@ # By: tomoron +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2024/10/17 18:15:24 by tomoron #+# #+# # -# Updated: 2024/11/18 15:13:57 by tomoron ### ########.fr # +# Updated: 2025/01/31 22:34:00 by tomoron ### ########.fr # # # # **************************************************************************** # diff --git a/hosts/server.nix b/hosts/server.nix index e09d56a..9487229 100644 --- a/hosts/server.nix +++ b/hosts/server.nix @@ -13,8 +13,12 @@ networking.hostName = "server"; services.openssh.enable = true; + services.xserver.videoDrivers = [ "nvidia" ]; + environment.systemPackages = with pkgs; [ zfs + nvidia-docker + libnvidia-container ]; boot.supportedFilesystems = [ "zfs" ]; @@ -30,8 +34,15 @@ nameservers = ["8.8.8.8" "8.8.4.4" "1.1.1.1"]; hostId = "68290da7"; }; - virtualisation.docker.liveRestore = false; - virtualisation.docker.enableOnBoot = true; + virtualisation.docker = { + liveRestore = false; + enableOnBoot = true; +# daemon.settings = { +# runtimes.nvidia.path = "${pkgs.nvidia-docker}/bin/nvidia-container-runtime"; +# exec-opts = ["native.cgroupdriver=cgroupfs"]; +# }; + + }; services.fail2ban.enable = true; services.fail2ban.bantime = "2h"; @@ -39,12 +50,12 @@ hardware.nvidia-container-toolkit.enable = true; hardware.nvidia = { - open = false; + open = true; -# prime.nvidiaBusId = "PCI:1:0:0"; -# prime.amdgpuBusId = "PCI:13:0:0"; -# prime.sync.enable = true; + prime.nvidiaBusId = "PCI:1:0:0"; + prime.amdgpuBusId = "PCI:13:0:0"; + prime.sync.enable = true; -# modesetting.enable = true; + modesetting.enable = true; }; }