1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6
7 cfg = config.services.autorandr;
8
9in {
10
11 options = {
12
13 services.autorandr = {
14 enable = mkEnableOption "handling of hotplug and sleep events by autorandr";
15 };
16
17 };
18
19 config = mkIf cfg.enable {
20
21 services.udev.packages = [ pkgs.autorandr ];
22
23 environment.systemPackages = [ pkgs.autorandr ];
24
25 systemd.packages = [ pkgs.autorandr ];
26
27 systemd.services.autorandr = {
28 wantedBy = [ "sleep.target" ];
29 };
30
31 };
32
33 meta.maintainers = with maintainers; [ gnidorah ];
34}