From 8632333facc7fe0e78e3b0b613429dc0ec201ad3 Mon Sep 17 00:00:00 2001 From: Ivan Dimitrov Date: Sun, 15 Oct 2023 08:46:48 +0300 Subject: [PATCH] nvidia proprietary drivers --- home/laptop/default.nix | 3 +++ modules/nvidia.nix | 21 +++++++++++++++++++++ sys/laptop/default.nix | 7 +------ 3 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 modules/nvidia.nix diff --git a/home/laptop/default.nix b/home/laptop/default.nix index 72b453b..5dc0831 100644 --- a/home/laptop/default.nix +++ b/home/laptop/default.nix @@ -8,6 +8,9 @@ username = "ivand"; homeDirectory = "/home/ivand"; stateVersion = "23.11"; + sessionPath = [ + "$HOME/.local/bin" + ]; pointerCursor = { name = "Catppuccin-Mocha-Green-Cursors"; package = pkgs.catppuccin-cursors.mochaGreen; diff --git a/modules/nvidia.nix b/modules/nvidia.nix new file mode 100644 index 0000000..9a0b2e4 --- /dev/null +++ b/modules/nvidia.nix @@ -0,0 +1,21 @@ +{ config, lib, pkgs, ... }: +{ + nixpkgs.config.allowUnfreePredicate = pkg: + builtins.elem (lib.getName pkg) [ + "nvidia-settings" + "nvidia-x11" + "nvidia-persistenced" + ]; + services.xserver.videoDrivers = [ "nvidia" ]; + + hardware.nvidia = { + prime = { + sync.enable = true; + nvidiaBusId = "PCI:1:0:0"; + intelBusId = "PCI:0:2:0"; + }; + modesetting.enable = true; + nvidiaSettings = true; + }; +} + diff --git a/sys/laptop/default.nix b/sys/laptop/default.nix index c99f274..a1f8adb 100644 --- a/sys/laptop/default.nix +++ b/sys/laptop/default.nix @@ -1,6 +1,6 @@ { config, pkgs, ... }: { - imports = [ ../../hardware-configuration.nix ]; + imports = [ ../../hardware-configuration.nix ../../modules/nvidia.nix ]; system.stateVersion = "23.11"; @@ -15,11 +15,6 @@ }; hardware = { - nvidia = { - modesetting.enable = true; - open = true; - nvidiaSettings = true; - }; opengl = { enable = true; driSupport = true;