Compare commits
5 commits
e35cad1252
...
8ab86a1204
Author | SHA1 | Date | |
---|---|---|---|
8ab86a1204 | |||
cfefe9bbe1 | |||
cb504ad8ca | |||
c120398b51 | |||
67e4c17305 |
6 changed files with 90 additions and 14 deletions
|
@ -23,7 +23,6 @@ in {
|
||||||
jujutsu
|
jujutsu
|
||||||
just
|
just
|
||||||
lazygit
|
lazygit
|
||||||
links2
|
|
||||||
linuxHeaders
|
linuxHeaders
|
||||||
neofetch
|
neofetch
|
||||||
microfetch
|
microfetch
|
||||||
|
@ -35,6 +34,7 @@ in {
|
||||||
television
|
television
|
||||||
trash-cli
|
trash-cli
|
||||||
util-linux
|
util-linux
|
||||||
|
w3m
|
||||||
wireguard-tools
|
wireguard-tools
|
||||||
zip
|
zip
|
||||||
zoxide
|
zoxide
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
environment.systemPackages = builtins.attrValues {
|
environment.systemPackages = builtins.attrValues {
|
||||||
inherit
|
inherit
|
||||||
(pkgs)
|
(pkgs)
|
||||||
|
abook
|
||||||
|
aerc
|
||||||
|
aichat
|
||||||
alsa-utils
|
alsa-utils
|
||||||
anki
|
anki
|
||||||
asciinema
|
asciinema
|
||||||
|
@ -73,6 +76,7 @@
|
||||||
vlc
|
vlc
|
||||||
vscodium
|
vscodium
|
||||||
wireguard-tools
|
wireguard-tools
|
||||||
|
wordgrinder
|
||||||
xournalpp
|
xournalpp
|
||||||
;
|
;
|
||||||
inherit (self.packages.${pkgs.stdenv.system}) helix;
|
inherit (self.packages.${pkgs.stdenv.system}) helix;
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
_: {
|
_: {
|
||||||
imports = [./bluetooth.nix ./keyboard ./graphics.nix];
|
imports = [
|
||||||
|
./bluetooth.nix
|
||||||
|
./keyboard
|
||||||
|
./graphics.nix
|
||||||
|
./power.nix
|
||||||
|
];
|
||||||
|
|
||||||
services.irqbalance.enable = true;
|
services.irqbalance.enable = true;
|
||||||
}
|
}
|
||||||
|
|
70
modules/system/hardware/power.nix
Normal file
70
modules/system/hardware/power.nix
Normal file
|
@ -0,0 +1,70 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkDefault;
|
||||||
|
in {
|
||||||
|
config = {
|
||||||
|
environment.systemPackages = builtins.attrValues {
|
||||||
|
inherit
|
||||||
|
(pkgs)
|
||||||
|
acpi
|
||||||
|
powertop
|
||||||
|
;
|
||||||
|
};
|
||||||
|
|
||||||
|
boot = {
|
||||||
|
kernelModules = ["acpi_call"];
|
||||||
|
extraModulePackages = with config.boot.kernelPackages; [
|
||||||
|
acpi_call
|
||||||
|
cpupower
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
hardware.acpilight.enable = false;
|
||||||
|
|
||||||
|
services = {
|
||||||
|
upower = {
|
||||||
|
enable = true;
|
||||||
|
percentageLow = 15;
|
||||||
|
percentageCritical = 5;
|
||||||
|
};
|
||||||
|
|
||||||
|
acpid = {
|
||||||
|
enable = true;
|
||||||
|
logEvents = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# INFO: Only works on Intel
|
||||||
|
undervolt = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
tempBat = 65;
|
||||||
|
package = pkgs.undervolt;
|
||||||
|
};
|
||||||
|
|
||||||
|
auto-cpufreq = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
charger = {
|
||||||
|
governor = "performance";
|
||||||
|
energy_performance_preference = "performance";
|
||||||
|
scaling_min_freq = mkDefault 1800000;
|
||||||
|
scaling_max_freq = mkDefault 3800000;
|
||||||
|
turbo = "auto";
|
||||||
|
};
|
||||||
|
|
||||||
|
battery = {
|
||||||
|
governor = "powersave";
|
||||||
|
energy_performance_preference = "power";
|
||||||
|
scaling_min_freq = mkDefault 1200000;
|
||||||
|
scaling_max_freq = mkDefault 1800000;
|
||||||
|
turbo = "never";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -26,24 +26,22 @@ in {
|
||||||
lib.mapAttrs (_: v: {flake = v;}) inputs
|
lib.mapAttrs (_: v: {flake = v;}) inputs
|
||||||
// {system.flake = inputs.self;};
|
// {system.flake = inputs.self;};
|
||||||
|
|
||||||
# This will additionally add your inputs to the system's legacy channels
|
# Add inputs to the system's legacy channels
|
||||||
# Making legacy nix commands consistent as well
|
# to make legacy nix commands consistent as well
|
||||||
nixPath = mapAttrsToList (key: _: "${key}=flake:${key}") config.nix.registry;
|
nixPath = mapAttrsToList (key: _: "${key}=flake:${key}") config.nix.registry;
|
||||||
|
|
||||||
# Run the Nix daemon on lowest possible priority so that my system
|
# Run the Nix daemon on lowest possible priority
|
||||||
# stays responsive during demanding tasks such as GC and builds.
|
|
||||||
# This is especially useful while auto-gc and auto-upgrade are enabled
|
|
||||||
# as they can be quite demanding on the CPU.
|
|
||||||
daemonCPUSchedPolicy = "idle";
|
daemonCPUSchedPolicy = "idle";
|
||||||
daemonIOSchedClass = "idle";
|
daemonIOSchedClass = "idle";
|
||||||
daemonIOSchedPriority = 7;
|
daemonIOSchedPriority = 7;
|
||||||
|
|
||||||
# Collect garbage
|
# Collect garbage
|
||||||
|
# NOTE: I use nh for this.
|
||||||
gc = {
|
gc = {
|
||||||
automatic = false;
|
automatic = false;
|
||||||
dates = "20:00";
|
dates = "20:00";
|
||||||
options = "--delete-older-than 7d";
|
options = "--delete-older-than 7d";
|
||||||
persistent = false; # don't try to catch up on missed GC runs
|
persistent = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Automatically optimize nix store by removing hard links
|
# Automatically optimize nix store by removing hard links
|
||||||
|
@ -132,13 +130,12 @@ in {
|
||||||
keep-derivations = true;
|
keep-derivations = true;
|
||||||
keep-outputs = true;
|
keep-outputs = true;
|
||||||
|
|
||||||
# Use binary cache, this is not Gentoo
|
# Use binary cache
|
||||||
# external builders can also pick up those substituters
|
|
||||||
builders-use-substitutes = true;
|
builders-use-substitutes = true;
|
||||||
|
|
||||||
# Substituters to pull from.
|
# Substituters to pull from.
|
||||||
substituters = [
|
substituters = [
|
||||||
"https://cache.nixos.org" # funny binary cache
|
"https://cache.nixos.org"
|
||||||
];
|
];
|
||||||
|
|
||||||
trusted-public-keys = [
|
trusted-public-keys = [
|
||||||
|
|
|
@ -19,8 +19,8 @@ in {
|
||||||
powersave = true;
|
powersave = true;
|
||||||
|
|
||||||
# Backend is either wpa_supplicant or iwd,
|
# Backend is either wpa_supplicant or iwd,
|
||||||
# we use iwd.
|
# I use wpa_supplicant since it is simply more reliable.
|
||||||
backend = "iwd";
|
backend = "wpa_supplicant";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue