Browse Source

fix: set dhcp by interface, setup tlp, add fonts, change pa config

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
master
Chinmay D. Pai 5 months ago
parent
commit
22034ff788
Signed by: thunderbottom GPG Key ID: 75507BE256F40CED
4 changed files with 88 additions and 1 deletions
  1. +68
    -0
      bastion.nix
  2. +1
    -1
      desktop/boot.nix
  3. +17
    -0
      hardware/sound/default.nix
  4. +2
    -0
      system/fonts.nix

+ 68
- 0
bastion.nix View File

@ -24,6 +24,8 @@
home-manager.users.chnmy = (import ./home/chnmy);
networking.hostName = "bastion";
networking.useDHCP = false;
networking.interfaces.wlp2s0.useDHCP = true;
nixpkgs.config.allowUnfree = true;
@ -45,8 +47,74 @@
services.smartd.notifications.x11.enable = true;
services.tailscale.enable = true;
services.tlp.enable = true;
services.throttled.enable = true;
services.upower.enable = true;
services.tlp.settings = {
START_CHARGE_THRESH_BAT0 = 40;
STOP_CHARGE_THRESH_BAT0 = 90;
CPU_SCALING_GOVERNOR_ON_AC = "performance";
CPU_SCALING_GOVERNOR_ON_BAT = "schedutil";
SOUND_POWER_SAVE_ON_AC = 0;
SOUND_POWER_SAVE_ON_BAT = 1;
RUNTIME_PM_ON_AC = "on";
RUNTIME_PM_ON_BAT = "auto";
NATACPI_ENABLE = 1;
TPACPI_ENABLE = 1;
TPSMAPI_ENABLE = 1;
};
services.throttled.extraConfig = ''
[GENERAL]
Enabled: True
Sysfs_Power_Path: /sys/class/power_supply/AC*/online
[BATTERY]
# Update the registers every this many seconds
Update_Rate_s: 30
# Max package power for time window #1
PL1_Tdp_W: 29
# Time window #1 duration
PL1_Duration_s: 28
# Max package power for time window #2
PL2_Tdp_W: 44
# Time window #2 duration
PL2_Duration_S: 0.002
# Max allowed temperature before throttling
Trip_Temp_C: 85
# Set cTDP to normal=0, down=1 or up=2 (EXPERIMENTAL)
cTDP: 1
[AC]
# Update the registers every this many seconds
Update_Rate_s: 5
# Max package power for time window #1
PL1_Tdp_W: 44
# Time window #1 duration
PL1_Duration_s: 28
# Max package power for time window #2
PL2_Tdp_W: 44
# Time window #2 duration
PL2_Duration_S: 0.002
# Max allowed temperature before throttling
Trip_Temp_C: 95
# Set HWP energy performance hints to 'performance' on high load (EXPERIMENTAL)
HWP_Mode: False
# Set cTDP to normal=0, down=1 or up=2 (EXPERIMENTAL)
cTDP: 2
[UNDERVOLT]
# CPU core voltage offset (mV)
CORE: -105
# Integrated GPU voltage offset (mV)
GPU: -85
# CPU cache voltage offset (mV)
CACHE: -105
# System Agent voltage offset (mV)
UNCORE: -85
# Analog I/O voltage offset (mV)
ANALOGIO: 0
'';
system.autoUpgrade.enable = true;
system.copySystemConfiguration = true;
system.stateVersion = "20.03";


+ 1
- 1
desktop/boot.nix View File

@ -5,7 +5,7 @@
boot.extraModulePackages = with config.boot.kernelPackages; [ acpi_call ];
boot.kernelModules = [ "acpi_call" ];
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.kernelParams = [ "i915.enable_fbc=1" "i915.enable_psr=2" "i915.fastboot=1" "i915.lvds_downclock=1" "drm.vblankoffdelay=1" ];
boot.kernelParams = [ "i915.enable_fbc=1" "i915.enable_psr=2" "i915.fastboot=1" "intel_pstate=passive" "drm.vblankoffdelay=1" ];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;


+ 17
- 0
hardware/sound/default.nix View File

@ -2,6 +2,23 @@
{
hardware.pulseaudio = {
daemon.config = {
default-sample-format = "float32le";
default-sample-rate = 48000;
alternate-sample-rate = 44100;
default-sample-channels = 2;
default-fragments = 2;
default-fragment-size-msec = 125;
resample-method = "soxr-vhq";
avoid-resampling = "yes";
enable-lfe-remixing = "no";
high-priority = "yes";
nice-level = -11;
realtime-scheduling = "yes";
realtime-priority = 9;
rlimit-rtprio = 9;
daemonize = "no";
};
enable = true;
support32Bit = true;
};


+ 2
- 0
system/fonts.nix View File

@ -3,6 +3,7 @@
{
fonts.enableFontDir = true;
fonts.fonts = with pkgs; [
aileron
corefonts
dejavu_fonts
fira-code
@ -16,6 +17,7 @@
noto-fonts-cjk
noto-fonts-emoji
powerline-fonts
vistafonts
];
fonts.fontconfig.localConf = ''
<fontconfig>


Loading…
Cancel
Save