stockholm/lass/1systems/aergia/physical.nix

73 lines
1.9 KiB
Nix
Raw Normal View History

2023-01-26 15:13:42 +00:00
{ config, lib, pkgs, modulesPath, ... }:
{
imports = [
./config.nix
(modulesPath + "/installer/scan/not-detected.nix")
];
disko.devices = import ./disk.nix;
networking.hostId = "deadbeef";
# boot.loader.efi.canTouchEfiVariables = true;
boot.loader.grub = {
enable = true;
device = "/dev/nvme0n1";
efiSupport = true;
efiInstallAsRemovable = true;
};
2023-01-29 23:27:34 +00:00
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.kernelParams = [
# Enable energy savings during sleep
"mem_sleep_default=deep"
"initcall_blacklist=acpi_cpufreq_init"
# for ryzenadj -i
"iomem=relaxed"
];
2023-01-26 15:13:42 +00:00
# Enables the amd cpu scaling https://www.kernel.org/doc/html/latest/admin-guide/pm/amd-pstate.html
# On recent AMD CPUs this can be more energy efficient.
2023-01-29 23:27:34 +00:00
boot.kernelModules = [ "amd-pstate" "kvm-amd" ];
2023-01-26 15:13:42 +00:00
# hardware.cpu.amd.updateMicrocode = true;
services.xserver.videoDrivers = [
"amdgpu"
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" "usb_storage" "sd_mod" ];
environment.systemPackages = [
2023-01-29 23:27:34 +00:00
pkgs.vulkan-tools
2023-01-26 15:13:42 +00:00
pkgs.ryzenadj
2023-01-29 23:27:34 +00:00
(pkgs.writers.writeDashBin "set_tdp" ''
set -efux
watt=$1
value=$(( $watt * 1000 ))
${pkgs.ryzenadj}/bin/ryzenadj --stapm-limit="$value" --fast-limit="$value" --slow-limit="$value"
'')
2023-01-26 15:13:42 +00:00
];
# textsize
services.xserver.dpi = 200;
2023-01-29 23:27:34 +00:00
hardware.video.hidpi.enable = lib.mkDefault true;
# corectrl
programs.corectrl.enable = true;
users.users.mainUser.extraGroups = [ "corectrl" ];
# use newer ryzenadj
nixpkgs.config.packageOverrides = super: {
ryzenadj = super.ryzenadj.overrideAttrs (old: {
version = "unstable-2023-01-15";
src = pkgs.fetchFromGitHub {
owner = "FlyGoat";
repo = "RyzenAdj";
rev = "1052fb52b2c0e23ac4cd868c4e74d4a9510be57c"; # unstable on 2023-01-15
sha256 = "sha256-/IxkbQ1XrBrBVrsR4EdV6cbrFr1m+lGwz+rYBqxYG1k=";
};
});
};
2023-01-26 15:13:42 +00:00
}