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

@ -39,8 +39,8 @@
};
nixConfig = {
extra-substituters = [ "https://niri.cachix.org" ];
extra-trusted-public-keys = [ "niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964=" ];
extra-substituters = ["https://niri.cachix.org"];
extra-trusted-public-keys = ["niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964="];
};
outputs = {

View file

@ -89,7 +89,7 @@ in {
package = pkgs.niri-unstable;
settings = {
window-rules = [
{ draw-border-with-background = false; }
{draw-border-with-background = false;}
];
prefer-no-csd = true;
xwayland-satellite = {
@ -97,7 +97,7 @@ in {
path = lib.getExe pkgs.xwayland-satellite-unstable;
};
spawn-at-startup = [
{ argv = ["noctalia-shell"]; }
{argv = ["noctalia-shell"];}
];
clipboard.disable-primary = true;
input = {
@ -107,7 +107,8 @@ in {
natural-scroll = false;
};
};
binds = {
binds =
{
"Mod+Return".action.spawn = "${config.programs.foot.package}/bin/foot";
"Mod+q".action = config.lib.niri.actions.close-window;
# "$mod, F, fullscreen, 0"
@ -218,18 +219,26 @@ in {
// (
# workspaces
# 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
ws = i + 1;
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 SHIFT, code:1${toString i}, movetoworkspace, ${toString ws}"
]
)
9)
));
)
);
};
};

View file

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

View file

@ -96,12 +96,20 @@ in {
wireplumber.extraConfig."99-alsa-lowlatency"."alsa_monitor.rules" = [
{
matches = [ { "node.name" = "matches:alsa_output.*"; } ];
matches = [{"node.name" = "matches:alsa_output.*";}];
apply_properties = {
"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.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
# hardware.system76.power-daemon.enable = lib.mkDefault true;
zramSwap.enable = true;
services.tlp.enable = 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 = {
enable = lib.mkDefault true;
settings.dynamic_tuning = lib.mkDefault true;
@ -153,6 +174,7 @@ in {
extraGroups = [
"adbusers" # run ADB commands
"audio" # soundcard access
"rtkit" # realtime stuff?
"video" # webcam access (and maybe wayland too?)
"libvirtd" # run VMs through libvirt
"kvm" # run KVM VMs