nix-config/hosts/widar/default.nix
Lander Van den Bulcke ea6f358eaf
feat: tweak power settings for laptop
Signed-off-by: Lander Van den Bulcke <landervandenbulcke@gmail.com>
2025-09-27 18:10:59 +02:00

115 lines
2.3 KiB
Nix

{ pkgs, ... }:
{
imports = [
./hardware-configuration.nix
../common/global
../common/users/lander
../common/optional/fonts.nix
../common/optional/yubikey-gpg.nix
../common/optional/virt.nix
../common/optional/servarr.nix
../common/optional/steam.nix
];
networking = {
hostName = "widar";
networkmanager.enable = true;
};
boot = {
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
};
services.xserver.enable = true;
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
services.xserver.xkb = {
layout = "us";
variant = "";
};
services.logind = {
lidSwitch = "hibernate";
lidSwitchExternalPower = "lock";
};
services.thermald.enable = true;
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";
};
};
services.openssh = {
enable = true;
openFirewall = true;
};
services.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
hardware.graphics = {
enable = true;
enable32Bit = true;
};
#24.11
hardware.graphics.extraPackages = with pkgs; [
amdvlk
];
# For 32 bit applications
hardware.graphics.extraPackages32 = with pkgs; [
driversi686Linux.amdvlk
];
systemd.packages = with pkgs; [ lact ];
systemd.services.lactd.wantedBy = [ "multi-user.target" ];
programs.gamemode.enable = true;
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [
(firefox.override { nativeMessagingHosts = [ passff-host ]; })
vim
wget
git
texliveFull
tf-summarize
awscli2
libreoffice
lact
];
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
services.tailscale.enable = true;
services.mullvad-vpn = {
enable = true;
package = pkgs.mullvad-vpn;
};
services.printing.enable = true;
services.printing.drivers = [ pkgs.brlaser ];
system.stateVersion = "24.11";
}