workstation perf tweaks

This commit is contained in:
notgne2 2025-11-20 12:15:48 -07:00
parent 349cdd047d
commit e70c974289
No known key found for this signature in database
5 changed files with 325 additions and 288 deletions

View file

@ -107,7 +107,8 @@ in {
natural-scroll = false; natural-scroll = false;
}; };
}; };
binds = { binds =
{
"Mod+Return".action.spawn = "${config.programs.foot.package}/bin/foot"; "Mod+Return".action.spawn = "${config.programs.foot.package}/bin/foot";
"Mod+q".action = config.lib.niri.actions.close-window; "Mod+q".action = config.lib.niri.actions.close-window;
# "$mod, F, fullscreen, 0" # "$mod, F, fullscreen, 0"
@ -218,18 +219,26 @@ in {
// ( // (
# workspaces # workspaces
# binds $mod + [shift +] {1..9} to [move to] workspace {1..9} # binds $mod + [shift +] {1..9} to [move to] workspace {1..9}
lib.listToAttrs (builtins.concatLists (builtins.genList ( lib.listToAttrs (
builtins.concatLists (builtins.genList (
i: let i: let
ws = i + 1; ws = i + 1;
in [ in [
{ name = "Mod+${toString i}"; value = { action.focus-workspace = i; }; } {
{ name = "Mod+Shift+${toString i}"; value = { action.move-window-to-workspace = i; }; } name = "Mod+${toString i}";
value = {action.focus-workspace = i;};
}
{
name = "Mod+Shift+${toString i}";
value = {action.move-window-to-workspace = i;};
}
# "$mod, code:1${toString i}, workspace, ${toString ws}" # "$mod, code:1${toString i}, workspace, ${toString ws}"
# "$mod SHIFT, code:1${toString i}, movetoworkspace, ${toString ws}" # "$mod SHIFT, code:1${toString i}, movetoworkspace, ${toString ws}"
] ]
) )
9) 9)
)); )
);
}; };
}; };

View file

@ -21,7 +21,8 @@ in {
zip zip
]; ];
programs = { programs =
{
home-manager.enable = true; home-manager.enable = true;
zed-editor = { zed-editor = {
@ -143,7 +144,8 @@ in {
ignores = [".envrc"]; ignores = [".envrc"];
extraConfig.push.autoSetupRemote = true; extraConfig.push.autoSetupRemote = true;
}; };
} // (lib.optionalAttrs (options.programs ? nixcord) { }
// (lib.optionalAttrs (options.programs ? nixcord) {
nixcord = { nixcord = {
package = pkgs.vencord; package = pkgs.vencord;
@ -221,9 +223,6 @@ in {
}; };
}); });
home.sessionVariables = { home.sessionVariables = {
FZF_DEFAULT_COMMAND = "${pkgs.fd}/bin/fd --type f"; FZF_DEFAULT_COMMAND = "${pkgs.fd}/bin/fd --type f";
}; };
@ -232,5 +231,4 @@ in {
ext_tabline=false ext_tabline=false
ext_popupmenu=false ext_popupmenu=false
''; '';
} }

View file

@ -99,9 +99,17 @@ in {
matches = [{"node.name" = "matches:alsa_output.*";}]; matches = [{"node.name" = "matches:alsa_output.*";}];
apply_properties = { apply_properties = {
"audio.format" = "S32LE"; "audio.format" = "S32LE";
"audio.rate" = toString (cfg.rate * (if cfg.usbSoundcard then 2 else 1)); # for USB soundcards it should be twice your desired rate "audio.rate" = toString (cfg.rate
* (
if cfg.usbSoundcard
then 2
else 1
)); # for USB soundcards it should be twice your desired rate
"api.alsa.period-size" = toString cfg.periodSize; # defaults to 1024, tweak by trial-and-error "api.alsa.period-size" = toString cfg.periodSize; # defaults to 1024, tweak by trial-and-error
"api.alsa.disable-batch" = if cfg.batch then "false" else "true"; # generally, USB soundcards use the batch mode "api.alsa.disable-batch" =
if cfg.batch
then "false"
else "true"; # generally, USB soundcards use the batch mode
}; };
} }
]; ];

View file

@ -72,9 +72,30 @@ in {
# Make battery usage and performance sane # Make battery usage and performance sane
# hardware.system76.power-daemon.enable = lib.mkDefault true; # hardware.system76.power-daemon.enable = lib.mkDefault true;
zramSwap.enable = true;
services.tlp.enable = false; services.tlp.enable = false;
services.power-profiles-daemon.enable = lib.mkDefault false; services.power-profiles-daemon.enable = lib.mkDefault false;
services.system76-scheduler.enable = lib.mkDefault true; services.system76-scheduler = {
enable = lib.mkDefault true;
exceptions = lib.mkDefault [
"include descends=\"schedtool\""
"include descends=\"nice\""
"include descends=\"chrt\""
"include descends=\"taskset\""
"include descends=\"ionice\""
"schedtool"
"nice"
"chrt"
"ionice"
"dbus"
"dbus-broker"
"rtkit-daemon"
"taskset"
"systemd"
];
};
services.tuned = { services.tuned = {
enable = lib.mkDefault true; enable = lib.mkDefault true;
settings.dynamic_tuning = lib.mkDefault true; settings.dynamic_tuning = lib.mkDefault true;
@ -153,6 +174,7 @@ in {
extraGroups = [ extraGroups = [
"adbusers" # run ADB commands "adbusers" # run ADB commands
"audio" # soundcard access "audio" # soundcard access
"rtkit" # realtime stuff?
"video" # webcam access (and maybe wayland too?) "video" # webcam access (and maybe wayland too?)
"libvirtd" # run VMs through libvirt "libvirtd" # run VMs through libvirt
"kvm" # run KVM VMs "kvm" # run KVM VMs