blob: b0895e25e0273e27c74d482e52ccffea6f9cb4d1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
{ config, pkgs, ... }:
let
inherit (pkgs) writeText klipperscreen;
ksConfig =
let
inherit (config.services.moonraker) address port;
in
writeText "KlipperScreen.conf" ''
[printer fourmi]
moonraker_host: ${address}
moonraker_port: ${toString port}
'';
in
{
# avoid conflict between console and cage.
console.enable = false;
# without this the kiosk doesn't even want to get loaded :)
systemd.defaultUnit = "graphical.target";
services.cage = {
enable = true;
program = "${klipperscreen}/bin/KlipperScreen -c ${ksConfig}";
extraArguments = [ "-d" ];
environment = {
# don't fail with no devices found.
"WLR_LIBINPUT_NO_DEVICES" = "1";
};
user = "klipper";
};
# auto-restart cage.
systemd.services."cage-tty1" = {
startLimitBurst = 5;
startLimitIntervalSec = 500;
serviceConfig = {
RestartSec = 5;
Restart = "on-failure";
};
};
}
|