aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAkshay <[email protected]>2023-02-09 05:14:49 +0000
committerAkshay <[email protected]>2023-02-09 05:14:49 +0000
commit01781658b87f573f05e1fa3f48be810656b93d84 (patch)
treea9ceae7aea2bfd665f96ab049b4773e7b455bddf /scripts
parentd681bd972bdef874f8aa65a6903390793810a224 (diff)
working config
Diffstat (limited to 'scripts')
-rw-r--r--scripts/default.nix3
-rw-r--r--scripts/nvidia-offload.nix12
2 files changed, 15 insertions, 0 deletions
diff --git a/scripts/default.nix b/scripts/default.nix
index 220d76d..f134556 100644
--- a/scripts/default.nix
+++ b/scripts/default.nix
@@ -36,6 +36,9 @@ let
36 # battery script 36 # battery script
37 battery = import ./battery.nix pkgs; 37 battery = import ./battery.nix pkgs;
38 38
39 # run-on-gpu script
40 battery = import ./nvidia-offload.nix pkgs;
41
39 # fzf script to switch between tmux sessions 42 # fzf script to switch between tmux sessions
40 tmux-fzf = pkgs.writeScriptBin "tmux-fzf" '' 43 tmux-fzf = pkgs.writeScriptBin "tmux-fzf" ''
41 LIST_DATA="#{session_name}/#{window_name}/#{pane_current_command} @ #{pane_current_path}" 44 LIST_DATA="#{session_name}/#{window_name}/#{pane_current_command} @ #{pane_current_path}"
diff --git a/scripts/nvidia-offload.nix b/scripts/nvidia-offload.nix
new file mode 100644
index 0000000..de55fa2
--- /dev/null
+++ b/scripts/nvidia-offload.nix
@@ -0,0 +1,12 @@
1{ pkgs, ... }:
2
3let
4 name = "nvidia-offload";
5in
6pkgs.writeShellScriptBin name ''
7 export __NV_PRIME_RENDER_OFFLOAD=1
8 export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
9 export __GLX_VENDOR_LIBRARY_NAME=nvidia
10 export __VK_LAYER_NV_optimus=NVIDIA_only
11 exec "$@"
12''