diff --git a/README.org b/README.org index 4640b87..667dc35 100644 --- a/README.org +++ b/README.org @@ -1236,6 +1236,9 @@ in { Option "TripleBuffer" "on" ''; + # Fix graphical corruption on suspend. + hardware.nvidia.powerManagement.enable = true; + # Configure `offload-mode'. hardware.nvidia.prime = { offload.enable = true; @@ -1255,6 +1258,15 @@ in { ]; }; + # Create an external display setup. + specialisation = { + external-display.configuration = { + system.nixos.tags = [ "external-display" ]; + hardware.nvidia.prime.offload.enable = lib.mkForce false; + hardware.nvidia.powerManagement.enable = lib.mkForce false; + }; + }; + # Add user to video group. users.users.chris = { extraGroups = [ "video" ]; @@ -2970,6 +2982,23 @@ epkgs.doom-themes (load-theme 'doom-nord t) (doom-modeline-mode +1) +;; Define a method for returning information about the current theme. +;; This is based off the function `org-roam-ui-get-theme'. +(defun dotfiles/theme () + "Return information about the current theme." + (list `(bg . ,(face-background hl-line-face)) + `(bg-alt . ,(face-background 'default)) + `(fg . ,(face-foreground 'default)) + `(fg-alt . ,(face-foreground font-lock-comment-face)) + `(red . ,(face-foreground 'error)) + `(orange . ,(face-foreground 'warning)) + `(yellow . ,(face-foreground font-lock-builtin-face)) + `(green . ,(face-foreground 'success)) + `(cyan . ,(face-foreground font-lock-constant-face)) + `(blue . ,(face-foreground font-lock-keyword-face)) + `(violet . ,(face-foreground font-lock-constant-face)) + `(magenta . ,(face-foreground font-lock-preprocessor-face)))) + ;; Load a new theme with t t. (dotfiles/leader "tt" '(counsel-load-theme :which-key "Theme")) diff --git a/modules/nvidia.nix b/modules/nvidia.nix index 810b3d3..01adda6 100644 --- a/modules/nvidia.nix +++ b/modules/nvidia.nix @@ -31,6 +31,9 @@ in { Option "TripleBuffer" "on" ''; + # Fix graphical corruption on suspend. + hardware.nvidia.powerManagement.enable = true; + # Configure `offload-mode'. hardware.nvidia.prime = { offload.enable = true; @@ -50,6 +53,15 @@ in { ]; }; + # Create an external display setup. + specialisation = { + external-display.configuration = { + system.nixos.tags = [ "external-display" ]; + hardware.nvidia.prime.offload.enable = lib.mkForce false; + hardware.nvidia.powerManagement.enable = lib.mkForce false; + }; + }; + # Add user to video group. users.users.chris = { extraGroups = [ "video" ];