99 lines
2.5 KiB
Nix
99 lines
2.5 KiB
Nix
{
|
|
config,
|
|
pkgs,
|
|
lib,
|
|
username,
|
|
inputs,
|
|
...
|
|
}:
|
|
{
|
|
imports = [
|
|
./common.nix
|
|
./hardware_desktop.nix
|
|
./no-rgb.nix
|
|
./vr.nix
|
|
|
|
inputs.nixos-hardware.nixosModules.common-cpu-amd-pstate
|
|
inputs.nixos-hardware.nixosModules.common-cpu-amd-zenpower
|
|
];
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
networking.hostId = "abf570f9";
|
|
boot = {
|
|
kernelParams = [
|
|
# allow overclocking (I actually underclock but lol)
|
|
"amdgpu.ppfeaturemask=0xFFF7FFFF"
|
|
];
|
|
|
|
kernelModules = [
|
|
# kernel module for case fan control
|
|
"nct6775"
|
|
];
|
|
};
|
|
|
|
services.xserver.enable = false;
|
|
services.desktopManager.plasma6.enable = true;
|
|
services.displayManager = {
|
|
sddm = {
|
|
enable = true;
|
|
wayland.enable = true;
|
|
};
|
|
|
|
autoLogin = {
|
|
enable = true;
|
|
user = username;
|
|
};
|
|
};
|
|
|
|
# services.openssh = {
|
|
# enable = true;
|
|
# ports = [ 22 ];
|
|
# settings = {
|
|
# PasswordAuthentication = true;
|
|
# AllowUsers = null; # Allows all users by default. Can be [ "user1" "user2" ]
|
|
# UseDns = true;
|
|
# X11Forwarding = false;
|
|
# PermitRootLogin = "no"; # "yes", "without-password", "prohibit-password", "forced-commands-only", "no"
|
|
# };
|
|
# };
|
|
|
|
programs.steam = {
|
|
remotePlay.openFirewall = true;
|
|
localNetworkGameTransfers.openFirewall = true;
|
|
};
|
|
|
|
# LACT (Linux AMDGPU Configuration Tool): https://github.com/ilya-zlobintsev/LACT
|
|
environment.systemPackages = with pkgs; [
|
|
lact
|
|
];
|
|
systemd.packages = with pkgs; [ lact ];
|
|
systemd.services.lactd.wantedBy = [ "multi-user.target" ];
|
|
|
|
systemd.services.lactd.serviceConfig.ExecStartPre = "${lib.getExe pkgs.bash} -c \"sleep 3s\"";
|
|
|
|
# control case fans with gpu temperature
|
|
# I have case fans attached to my gpu for better cooling
|
|
hardware.fancontrol = {
|
|
enable = false;
|
|
config =
|
|
let
|
|
select_hwmon = "hwmon/hwmon[[:print:]]*";
|
|
gpu_path = "/sys/bus/pci/drivers/amdgpu/0000:0c:00.0/${select_hwmon}";
|
|
mobo_path = "/sys/devices/platform/nct6775.656/${select_hwmon}";
|
|
fan_speed = "${mobo_path}/pwm4";
|
|
in
|
|
''
|
|
INTERVAL=10
|
|
FCTEMPS=${fan_speed}=${gpu_path}/temp1_input
|
|
FCFANS= ${fan_speed}=${mobo_path}/fan4_input
|
|
MINTEMP=${fan_speed}=40
|
|
MAXTEMP=${fan_speed}=80
|
|
MINSTART=${fan_speed}=150
|
|
MINSTOP=${fan_speed}=0
|
|
MAXPWM=${fan_speed}=255
|
|
'';
|
|
};
|
|
|
|
systemd.services.fancontrol.serviceConfig.ExecStartPre = "${lib.getExe pkgs.bash} -c \"sleep 3s\"";
|
|
}
|