diff --git a/hardware-configuration.nix b/hardware-configuration.nix index 47ea804..b360c32 100644 --- a/hardware-configuration.nix +++ b/hardware-configuration.nix @@ -12,7 +12,7 @@ boot.initrd.kernelModules = [ "vfio" "vfio_pci" "vfio_iommu_type1" "ahci" ]; # 2) Also load them again in the running system - boot.kernelModules = [ "vfio" "vfio_pci" "vfio_iommu_typoe1" "ahci" ]; + boot.kernelModules = [ "vfio" "vfio_pci" "vfio_iommu_type1" "ahci" ]; # 3) Kernel params to turn on IOMMU and bind your card to vfio-pci boot.kernelParams = lib.mkForce [ @@ -62,12 +62,35 @@ services.xserver.videoDrivers = [ "nvidia" ]; hardware.nvidia = { - package = config.boot.kernelPackages.nvidiaPackages.legacy_470; + package = config.boot.kernelPackages.nvidiaPackages.stable; modesetting.enable = true; powerManagement.enable = true; open = false; # <--- this must be false for proprietary nvidiaSettings = true; + nvidiaPersistenced = true; }; + + systemd.services.nvidia-idle-reset = { + description = "Reset NVIDIA clocks so idle GPU can enter low-power P8"; + wantedBy = [ "multi-user.target" ]; + after = [ "nvidia-persistenced.service" "systemd-udev-settle.service" ]; + wants = [ "nvidia-persistenced.service" "systemd-udev-settle.service" ]; + + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + }; + + path = [ config.boot.kernelPackages.nvidiaPackages.stable ]; + + script = '' + nvidia-smi -pm 1 || true + nvidia-smi --auto-boost-default=0 || true + nvidia-smi -rgc || true + nvidia-smi -rmc || true + ''; + }; + nixpkgs.config.allowUnfree = true; nixpkgs.config.nvidia.acceptLicense = true; } diff --git a/master.nix b/master.nix index cfea074..9e0ca16 100644 --- a/master.nix +++ b/master.nix @@ -5,7 +5,7 @@ { config, pkgs, ... }: let - home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/release-25.11.tar.gz"; + home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/release-26.05.tar.gz"; in { @@ -24,6 +24,7 @@ in ./incus.nix ./drives.nix ./prometheus.nix + #./ollama.nix #./cron.nix #./auto-upgrade.nix ]; @@ -35,5 +36,7 @@ in # Before changing this value read the documentation for this option # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). system.stateVersion = "24.11"; # Did you read the comment? + documentation.enable = false; + } diff --git a/packages.nix b/packages.nix index 56f84d3..99f2b28 100644 --- a/packages.nix +++ b/packages.nix @@ -18,7 +18,11 @@ helix # Very bazed terminal editor broot # Very bazed terminal file explorer tcpdump - python3 + + python312 + python312Packages.pip + python312Packages.virtualenv + ffmpeg ]; }