summary refs log tree commit diff
path: root/modules/fbcp.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/fbcp.nix')
-rw-r--r--modules/fbcp.nix31
1 files changed, 31 insertions, 0 deletions
diff --git a/modules/fbcp.nix b/modules/fbcp.nix
new file mode 100644
index 0000000..606dba8
--- /dev/null
+++ b/modules/fbcp.nix
@@ -0,0 +1,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" ];
+  };
+}