summary refs log tree commit diff
path: root/modules/fbcp.nix
blob: 606dba8e43c1f81b9f7030c6041fa23abe5e4a8f (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
{ auxiliaryPkgs, ... }:

let
  inherit (auxiliaryPkgs) rpi-fbcp;
in
{
  systemd = {
    services."fbcp" = {
      enable = true;

      before = [ "graphical.target" ];
      after = [
        "systemd-user-sessions.service"
        "plymouth-start.service"
        "plymouth-quit.service"
        "systemd-logind.service"
        "getty@tty1.service"
      ];

      unitConfig = {
        ConditionPathExists = "/dev/fb0";
      };
      serviceConfig = {
        ExecStart = "+${rpi-fbcp}/bin/fbcp";
        DynamicUser = true;
      };
    };

    targets.graphical.wants = [ "fbcp.service" ];
  };
}