mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 18:41:34 +01:00
Move hardware config files into directory
This commit is contained in:
parent
cb3daa129c
commit
fa4d802536
7 changed files with 2 additions and 2 deletions
|
|
@ -1,28 +0,0 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = true;
|
||||
powerManagement.enable = true;
|
||||
package = config.boot.kernelPackages.nvidiaPackages.latest;
|
||||
};
|
||||
|
||||
systemd.services.gpu-temp-reader = {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
requires = [ "fancontrol.service" ];
|
||||
before = [ "fancontrol.service" ];
|
||||
script = ''
|
||||
${lib.getExe' pkgs.coreutils "touch"} /tmp/nvidia-gpu-temp
|
||||
while :; do
|
||||
temp="$(${lib.getExe' config.hardware.nvidia.package "nvidia-smi"} --query-gpu=temperature.gpu --format=csv,noheader,nounits)"
|
||||
${lib.getExe' pkgs.coreutils "echo"} "$((temp * 1000))" > /tmp/nvidia-gpu-temp
|
||||
${lib.getExe' pkgs.coreutils "sleep"} 2
|
||||
done
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue