blob: 4c03d095b04b9c642b6601516835b7b80f2ff5ac (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
{
nixos-hardware,
pkgs,
...
}:
let
# usage:
# blankscreen {force, poke}
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
# Community-curated hardware configuration
nixos-hardware.nixosModules.common-cpu-intel
nixos-hardware.nixosModules.common-pc
nixos-hardware.nixosModules.common-pc-ssd
];
personal.hardware = {
usb.enable = false;
disks.crypted = "/dev/disk/by-uuid/29fa7cc7-e8ca-4f9f-bd3d-46475ede48e2";
firmwareNonFree.enable = true;
keyboard.keyMap = "fr";
sound.enable = false;
};
environment.shellAliases = { inherit blankscreen; };
systemd = {
suppressedSystemUnits = [ "systemd-backlight@.service" ];
services.blankscreen = {
description = "Shut down screen";
path = [ pkgs.util-linux ];
script = ''
${blankscreen} force
'';
wantedBy = [ "default.target" ];
after = [ "multi-user.target" ];
};
};
}
|