Cleanup of code and modules. Fully modular config now. Cleanup unused and redundant packages. Fix shell alias

This commit is contained in:
2025-08-31 15:00:59 +02:00
parent ffd8112f61
commit ad08a4fa5c
9 changed files with 253 additions and 303 deletions

View File

@@ -1,67 +0,0 @@
{ config, lib, ... }:
let
inherit (lib) mkOption types;
in
{
options.batMode = mkOption {
type = types.enum [ "single" "double" ];
default = "single";
};
config = {
powerManagement.powertop.enable = true;
services.upower = {
enable = true;
# In accordance with the waybar battery colors
percentageLow = 30;
percentageCritical = 20;
percentageAction = 10;
criticalPowerAction = "PowerOff"; # This can destroy work
usePercentageForPolicy = true;
};
services.tlp = if config.batMode == "single" then {
enable = true;
settings = {
START_CHARGE_THRESH_BAT0 = 65;
STOP_CHARGE_THRESH_BAT0 = 85;
CPU_SCALING_GOVERNOR_ON_AC = "performance";
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 = 65;
};
} else {
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 = 75;
# 0 is first
START_CHARGE_THRESH_BAT0 = 60;
STOP_CHARGE_THRESH_BAT0 = 85;
# 1 is second
START_CHARGE_THRESH_BAT1 = 60;
STOP_CHARGE_THRESH_BAT1 = 85;
};
};
};
}

26
modules/hardware/boot.nix Normal file
View File

@@ -0,0 +1,26 @@
{ config, lib, ... }:
let
inherit (lib) mkOption types;
in {
options.bootMode = mkOption {
type = types.enum [ "uefi" "legacy" ];
default = "uefi";
};
config = {
boot.consoleLogLevel = 0;
boot.kernelParams = [ "quiet" "udev.log_level=3" ];
boot.loader = if config.bootMode == "uefi" then {
efi.canTouchEfiVariables = true;
systemd-boot.enable = true;
timeout = 0;
} else {
grub.enable = true;
grub.device = "/dev/sda";
timeout = 0;
};
};
}

View File

@@ -13,11 +13,11 @@
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
environment.systemPackages = with pkgs; [
(blender.override {
cudaSupport = true;
})
];
#environment.systemPackages = with pkgs; [
# (blender.override {
# cudaSupport = true;
# })
#];
# This causes very long build times
#nixpkgs.config.cudaSupport = true;