optimizing

This commit is contained in:
Matt Nish-Lapidus 2024-10-01 16:57:09 -04:00
parent cef0ebd264
commit b417858ff5
4 changed files with 58 additions and 13 deletions

View file

@ -13,7 +13,7 @@
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelPackages = pkgs.linuxPackages_zen;
boot.kernelPackages = pkgs.linuxPackages_6_10;
systemd.services.tailscaled.after = ["NetworkManager-wait-online.service"];
@ -30,6 +30,8 @@
openrazer.users = [ "emenel" ];
graphics.enable = true;
enableAllFirmware = true;
nvidia = {
package = config.boot.kernelPackages.nvidiaPackages.mkDriver {
version = "555.58.02";
@ -62,7 +64,7 @@
# Currently alpha-quality/buggy, so false is currently the recommended setting.
open = false;
forceFullCompositionPipeline = true;
#forceFullCompositionPipeline = true;
prime = {
amdgpuBusId = "PCI:0:2:0";
@ -104,10 +106,10 @@
# Select internationalisation properties.
i18n.defaultLocale = "en_CA.UTF-8";
nix.nixPath = [ "nixos-config=/home/emenel/source/nixos-config" ];
nix.nixPath = [ "nixos-config=/home/emenel/source/nixos-config" "nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos" ];
nix.package = pkgs.nixFlakes;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nix.settings.experimental-features = [ "nix-command" "flakes" "repl-flake" ];
# Enable the X11 windowing system
services.xserver.enable = true;
@ -156,7 +158,16 @@
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
wireplumber.enable = true;
wireplumber.enable = true;
# extraConfig.pipewire."92-low-latency" = {
# "context.properties" = {
# "default.clock.rate" = 48000;
# "default.clock.quantum" = 32;
# "default.clock.min-quantum" = 32;
# "default.clock.max-quantum" = 32;
# };
# };
};
# Enable touchpad support (enabled default in most desktopManager).
@ -166,7 +177,7 @@
users.users.emenel = {
isNormalUser = true;
description = "emenel";
extraGroups = [ "networkmanager" "wheel" "uinput" "input" "audio" "video" "libvirtd" "nvidia" "cups" ];
extraGroups = [ "networkmanager" "wheel" "uinput" "input" "audio" "video" "libvirtd" "nvidia" "cups" "openrazer"];
openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFvtBCUQEi7r6mXdaULEaMMvGH1IWZBX9tXpjbIECar2 matt@emenel.ca" ];
packages = with pkgs; [
git
@ -175,6 +186,7 @@
# enable fish and launch it from bash for interactive shells
programs.fish.enable = true;
environment.pathsToLink = [ "/share/fish" ];
programs.bash = {
interactiveShellInit = ''
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
@ -201,6 +213,8 @@
rsync
kmonad
gnupg
openrazer-daemon
tlp
];
#programs.gnupg.enable = true;
@ -212,13 +226,14 @@
geary
seahorse
gnome-music
gnome-tour
];
services.kmonad = {
enable = true;
keyboards = {
quefrency = {
device = "/dev/input/by-id/usb-Keebio_Quefrency_Rev._5-event-kbd";
device = "/dev/input/by-id/usb-Keebio_Quefrency_Rev._5-event-kbd";
config = builtins.readFile ../../dotfiles/dot_config/kmonad/quefrency.kbd;
};
razer = {
@ -251,7 +266,32 @@
extraCompatPackages = [ pkgs.proton-ge-bin ];
};
# Enable the OpenSSH daemon.
powerManagement.enable = true;
services.power-profiles-daemon.enable = false;
services.tlp = {
enable = true;
settings = {
CPU_SCALING_GOVERNOR_ON_AC = "performance";
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
CPU_MIN_PERF_ON_AC = 0;
CPU_MAX_PERF_ON_AC = 100;
CPU_MIN_PERF_ON_BAT = 0;
CPU_MAX_PERF_ON_BAT = 20;
#Optional helps save long term battery health
START_CHARGE_THRESH_BAT0 = 40; # 40 and bellow it starts to charge
STOP_CHARGE_THRESH_BAT0 = 80; # 80 and above it stops charging
};
};
# powerManagement.powertop.enable = true;
# services.thermald.enable = true;
# enable the OpenSSH daemon.
services.openssh.enable = true;
#serivces.openssh.permitRootLogin = "no";
#services.openssh.passwordAuthentication = true;