feat: add sensors
This commit is contained in:
@@ -17,5 +17,6 @@
|
||||
./zed-editor.nix
|
||||
./virtualization.nix
|
||||
./printing.nix
|
||||
./sensors.nix
|
||||
];
|
||||
}
|
||||
|
||||
@@ -48,6 +48,8 @@
|
||||
awscli2
|
||||
gitui
|
||||
htop
|
||||
lm_sensors
|
||||
fanctl
|
||||
];
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
|
||||
27
nix/modules/sensors.nix
Normal file
27
nix/modules/sensors.nix
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options.sensors = {
|
||||
enable = lib.mkEnableOption "enable sensors";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.sensors.enable {
|
||||
boot.kernelModules = [
|
||||
"coretemp"
|
||||
"nct6775"
|
||||
];
|
||||
systemd.services."sensors-init" = {
|
||||
description = "Initialize sensor settings";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "/run/current-system/sw/bin/sensors -s";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user