diff options
| author | quentin@aristote.fr <quentin@aristote.fr> | 2025-03-28 20:08:36 +0100 |
|---|---|---|
| committer | quentin@aristote.fr <quentin@aristote.fr> | 2025-03-29 17:55:32 +0100 |
| commit | b5ad1cffb8733b328fbeceaa2857853c92479e43 (patch) | |
| tree | 5a19d012d71e109cb7aef7cfca158420e47364a0 /config | |
| parent | 52b82eda1009e4d3e4211c2c3bda6d260f97857b (diff) | |
shut screen down on startup
Diffstat (limited to 'config')
| -rw-r--r-- | config/hardware/default.nix | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/config/hardware/default.nix b/config/hardware/default.nix index 76d8fec..5003cd0 100644 --- a/config/hardware/default.nix +++ b/config/hardware/default.nix @@ -1,4 +1,13 @@ -{nixos-hardware, ...}: { +{ + nixos-hardware, + pkgs, + ... +}: +# usage: +# blankscreen {force, poke} +let + blankscreen = "echo 0 > /sys/class/backlight/intel_backlight/brightness; setterm -term linux -blank </dev/tty1"; +in { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix @@ -22,7 +31,13 @@ lidSwitchDocked = "ignore"; }; - # usage: - # blankscreen {force, poke} - environment.shellAliases.blankscreen = "echo 0 > /sys/class/backlight/intel_backlight/brightness; setterm -term linux -blank </dev/tty1"; + environment.shellAliases = {inherit blankscreen;}; + systemd.services.blankscreen = { + description = "Shut down screen"; + path = [pkgs.util-linux]; + script = '' + ${blankscreen} force + ''; + wantedBy = ["default.target"]; + }; } |
