From c7a28de8860c8f95f5fbebd265093f688704f842 Mon Sep 17 00:00:00 2001 From: Syed Daanish Date: Tue, 7 Jul 2026 18:24:56 +0100 Subject: [PATCH] Add nvidia drivers and fix interactive.fish --- home/fish/interactive.fish | 4 ++-- hosts/tardis/default.nix | 2 +- hosts/tardis/nvidia.nix | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 hosts/tardis/nvidia.nix diff --git a/home/fish/interactive.fish b/home/fish/interactive.fish index 04ae800..c594843 100644 --- a/home/fish/interactive.fish +++ b/home/fish/interactive.fish @@ -1,3 +1,3 @@ -if test "$KITTY_STR" -eq 1 - fastfetch +if test "$KITTY_STR" = "1" + fastfetch end diff --git a/hosts/tardis/default.nix b/hosts/tardis/default.nix index 8e487ad..de27268 100644 --- a/hosts/tardis/default.nix +++ b/hosts/tardis/default.nix @@ -31,7 +31,7 @@ services.xserver = { enable = true; displayManager.startx.enable = true; - videoDrivers = [ "modesetting" ]; + videoDrivers = [ "modesetting" "nvidia" ]; xkb = { layout = "us"; variant = ""; diff --git a/hosts/tardis/nvidia.nix b/hosts/tardis/nvidia.nix new file mode 100644 index 0000000..883467c --- /dev/null +++ b/hosts/tardis/nvidia.nix @@ -0,0 +1,33 @@ +{ config, ... }: + +{ + nix.settings = { + substituters = [ "https://cache.nixos-cuda.org" ]; + trusted-public-keys = [ + "cache.nixos-cuda.org:74DUi4Ye579gUqzH4ziL9IyiJBlDpMRn9MBN8oNan9M=" + ]; + }; + + hardware.graphics = { + enable = true; + }; + + services.xserver.videoDrivers = ["nvidia"]; + + hardware.nvidia = { + modesetting.enable = true; + powerManagement.enable = false; + powerManagement.finegrained = false; + open = true; + nvidiaSettings = true; + package = config.boot.kernelPackages.nvidiaPackages.stable; + prime = { + offload = { + enable = true; + enableOffloadCmd = true; + }; + intelBusId = "PCI:0@0:2:0"; + nvidiaBusId = "PCI:1@0:0:0"; + }; + }; +}