156 lines
4.2 KiB
Nix
156 lines
4.2 KiB
Nix
{
|
|
config,
|
|
pkgs,
|
|
lib,
|
|
username,
|
|
system,
|
|
cpu_arch,
|
|
inputs,
|
|
...
|
|
}:
|
|
{
|
|
imports = [
|
|
./common.nix
|
|
./hardware_desktop.nix
|
|
|
|
inputs.nixos-hardware.nixosModules.common-cpu-amd-pstate
|
|
inputs.nixos-hardware.nixosModules.common-cpu-amd-zenpower
|
|
inputs.nixos-hardware.nixosModules.common-pc-ssd
|
|
];
|
|
|
|
boot = {
|
|
kernelPackages = pkgs.linuxPackages_6_10;
|
|
supportedFilesystems = [ "zfs" ];
|
|
|
|
kernelPatches = [
|
|
#for making ALVR support better :)
|
|
{
|
|
name = "amdgpu-ignore-ctx-privileges";
|
|
patch = pkgs.fetchpatch {
|
|
name = "cap_sys_nice_begone.patch";
|
|
url = "https://github.com/Frogging-Family/community-patches/raw/master/linux61-tkg/cap_sys_nice_begone.mypatch";
|
|
sha256 = "Y3a0+x2xvHsfLax/uwycdJf3xLxvVfkfDVqjkxNaYEo=";
|
|
};
|
|
}
|
|
];
|
|
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;
|
|
};
|
|
|
|
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"
|
|
};
|
|
};
|
|
|
|
systemd.services.no-rgb =
|
|
let
|
|
no-rgb = pkgs.writeScriptBin "no-rgb" ''
|
|
#!/bin/sh
|
|
NUM_DEVICES=$(${pkgs.openrgb}/bin/openrgb --noautoconnect --list-devices | grep -E '^[0-9]+: ' | wc -l)
|
|
|
|
for i in $(seq 0 $(($NUM_DEVICES - 1))); do
|
|
${pkgs.openrgb}/bin/openrgb --noautoconnect --device $i --mode direct --color 000000
|
|
done
|
|
'';
|
|
in
|
|
{
|
|
description = "disable rgb";
|
|
serviceConfig = {
|
|
ExecStart = "${no-rgb}/bin/no-rgb";
|
|
Type = "oneshot";
|
|
};
|
|
wantedBy = [ "multi-user.target" ];
|
|
};
|
|
|
|
services.hardware.openrgb.enable = true;
|
|
services.udev.packages = [ pkgs.openrgb ];
|
|
hardware.i2c.enable = true;
|
|
|
|
#System packages
|
|
environment.systemPackages = with pkgs; [
|
|
openrgb-with-all-plugins
|
|
lact
|
|
];
|
|
|
|
programs.alvr = {
|
|
enable = true;
|
|
package = inputs.alvr.legacyPackages.${pkgs.system}.alvr;
|
|
openFirewall = true;
|
|
};
|
|
|
|
programs.steam = {
|
|
enable = true;
|
|
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
|
|
# dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
|
|
localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
|
|
};
|
|
|
|
# services.ollama = {
|
|
# enable = true;
|
|
# acceleration = "rocm";
|
|
# environmentVariables = {
|
|
# HCC_AMDGPU_TARGET = "gfx1031"; # used to be necessary, but doesn't seem to anymore
|
|
# };
|
|
# rocmOverrideGfx = "10.3.1";
|
|
# };
|
|
|
|
# services.open-webui = {
|
|
# enable = true;
|
|
# openFirewall = true;
|
|
# port = 8082;
|
|
# environment = {
|
|
# # Disable authentication
|
|
# WEBUI_AUTH = "False";
|
|
# PYDANTIC_SKIP_VALIDATING_CORE_SCHEMAS = "True";
|
|
# };
|
|
# };
|
|
|
|
systemd.packages = with pkgs; [ lact ];
|
|
systemd.services.lactd.wantedBy = [ "multi-user.target" ];
|
|
|
|
# control case fans with gpu temperature
|
|
# I have case fans attached to my gpu for better cooling
|
|
hardware.fancontrol = {
|
|
enable = true;
|
|
config =
|
|
let
|
|
select_hwmon = "hwmon/hwmon[[:print:]]*";
|
|
gpu_path = "/sys/devices/pci0000:00/0000:00:03.1/0000:09:00.0/0000:0a:00.0/0000:0b: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
|
|
'';
|
|
};
|
|
}
|