btw i use nix
1{
2 pkgs,
3 config,
4 lib,
5 ...
6}:
7
8let
9 cfg = config.custom;
10in
11{
12 options.custom.laptop = lib.mkEnableOption "laptop";
13
14 config = lib.mkIf cfg.laptop {
15 users.users.${config.custom.username}.extraGroups = [ "input" ];
16
17 services.libinput.enable = true;
18
19 services.tlp.enable = true;
20 powerManagement.enable = true;
21
22 systemd.sleep.extraConfig = ''
23 HibernateDelaySec=1h
24 '';
25
26 # https://github.com/systemd/systemd/issues/12001#issuecomment-1711464475
27 services.logind.lidSwitch = "ignore";
28
29 environment.systemPackages = with pkgs; [
30 fusuma
31 kanshi
32 v4l-utils # for qv4l2
33 ];
34 };
35}