fix: add offload condition to bind

This commit is contained in:
DACHXY 2025-01-05 16:18:22 +08:00
parent c93bc1099c
commit 4d0a35652c
3 changed files with 9 additions and 6 deletions

View file

@ -1,8 +1,9 @@
{ mainMod }:
{ mainMod, nvidia-offload-enabled }:
let
prefix = if nvidia-offload-enabled then "offload " else "";
uwsm = "uwsm app --";
browser = "offload firefox";
terminal = "offload ghostty";
browser = "${prefix}firefox";
terminal = "${prefix}ghostty";
filemanager = "nemo";
scripts = "~/.config/scripts";

View file

@ -5,6 +5,7 @@
system,
hyprcursor-size,
xcursor-size,
nvidia-offload-enabled,
...
}:
@ -31,8 +32,6 @@ let
song_info=$(playerctl metadata --format '{{title}} 󰎆 {{artist}}')
echo "$song_info"
'';
hyprlockAccent = "lavender";
in
{
home.packages = with pkgs; [
@ -62,7 +61,7 @@ in
settings =
{
bind = import ./hypr/bind.nix { inherit mainMod; };
bind = import ./hypr/bind.nix { inherit mainMod nvidia-offload-enabled; };
bindm = import ./hypr/bindm.nix { inherit mainMod; };
monitor = import ./hypr/monitor.nix;
plugin = plugins;

View file

@ -5,6 +5,7 @@
nix-version,
git-config,
username,
config,
...
}:
@ -15,6 +16,7 @@ let
# Get bus id with `lshw`
intel-bus-id = "PCI:0:2:0";
nvidia-bus-id = "PCI:1:0:0";
nvidia-offload-enabled = config.hardware.nvidia.prime.offload.enable;
in
{
imports = [
@ -50,6 +52,7 @@ in
hyprcursor-size
git-config
username
nvidia-offload-enabled
;
};
users."${username}" = {