summary refs log tree commit diff
path: root/nixos/modules/services/misc/autorandr.nix
blob: 3020130ad1f699f8fc53dc9d89a0c2ba3e8520f0 (plain) (blame)
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
{ config, lib, pkgs, ... }:

with lib;

let

  cfg = config.services.autorandr;

in {

  options = {

    services.autorandr = {
      enable = mkEnableOption "handling of hotplug and sleep events by autorandr";
    };

  };

  config = mkIf cfg.enable {

    services.udev.packages = [ pkgs.autorandr ];

    environment.systemPackages = [ pkgs.autorandr ];

    systemd.packages = [ pkgs.autorandr ];

    systemd.services.autorandr = {
      wantedBy = [ "sleep.target" ];
    };

  };

  meta.maintainers = with maintainers; [ gnidorah ];
}