forked from Zynh0722/permafrost
backlight: module init
This commit is contained in:
parent
cd0b89928b
commit
ebe79b2a73
1 changed files with 23 additions and 0 deletions
23
modules/backlight.nix
Normal file
23
modules/backlight.nix
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
{ 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'";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue