permafrost/modules/backlight.nix

22 lines
641 B
Nix
Raw Permalink Normal View History

2024-12-28 07:30:11 -08:00
{ pkgs, lib, ... }:
{
systemd.services.enable-screen = {
description = "disable screen";
enable = true;
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.coreutils}/bin/cp /sys/class/backlight/intel_backlight/max_brightness /sys/class/backlight/intel_backlight/brightness";
};
};
systemd.services.disable-screen = {
description = "disable screen";
enable = true;
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "oneshot";
ExecStart = "${lib.getExe pkgs.bash} -c '${pkgs.coreutils}/bin/echo 0 > /sys/class/backlight/intel_backlight/brightness'";
};
};
}