This commit is contained in:
2025-12-24 02:51:31 +01:00
parent 0a7c04c26a
commit 8e5e119233

View File

@@ -26,7 +26,7 @@
packages.showGokillStatus = packages.showGokillStatus =
let let
watchGokillStatus = pkgs.writeShellScriptBin "watch-gokill-status" '' watchGokillStatus = pkgs.writeShellScriptBin "watch-gokill-status" ''
${pkgs.procps}/bin/watch -c -t "${gokillPackage}/bin/gokillctl --db=/etc/gokill status; ${gokillPackage}/bin/gokillctl --db=/etc/gokill remote status" ${pkgs.procps}/bin/watch -c -t "sudo ${gokillPackage}/bin/gokillctl --db=/etc/gokill status; # sudo ${gokillPackage}/bin/gokillctl --db=/etc/gokill remote status"
''; '';
in in
pkgs.writeShellScriptBin "show-gokill-status" '' pkgs.writeShellScriptBin "show-gokill-status" ''
@@ -35,8 +35,7 @@
TARGET_WORKSPACE="1" TARGET_WORKSPACE="1"
#env DISPLAY=:0 ${pkgs.sudo}/bin/sudo su -c "${pkgs.i3}/bin/i3-msg \"exec $TERMINAL -T 'Status' -e $APP_COMMAND;\"" rpi #env DISPLAY=:0 ${pkgs.sudo}/bin/sudo su -c "${pkgs.i3}/bin/i3-msg \"exec $TERMINAL -T 'Status' -e $APP_COMMAND;\"" rpi
${pkgs.i3}/bin/i3-msg "exec $TERMINAL -T 'Status' -e $APP_COMMAND"; ${pkgs.i3}/bin/i3-msg "exec $TERMINAL -T 'Status' -e $APP_COMMAND; layout tabbed"
# layout tabbed"
''; '';
packages.alarmSound = pkgs.writeShellScriptBin "alarm-sound" '' packages.alarmSound = pkgs.writeShellScriptBin "alarm-sound" ''
@@ -154,6 +153,7 @@
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
libraspberrypi libraspberrypi
raspberrypi-eeprom raspberrypi-eeprom
unclutter
self.packages.aarch64-linux.alertTest self.packages.aarch64-linux.alertTest
]; ];
@@ -218,7 +218,7 @@
[all] [all]
enable_uart=1 enable_uart=1
dtoverlay=piscreen,drm,rotate=180,speed=18000000s dtoverlay=piscreen,drm,rotate=0,speed=18000000s
''; '';
in in
'' ''
@@ -252,14 +252,34 @@
''; '';
}; };
security.sudo = {
extraRules = [
{
users = [ "rpi" ];
commands = [
{
command = "ALL";
options = [ "NOPASSWD" ];
}
{
command = "${inputs.gokill.packages.aarch64-linux.gokill}/bin/gokillctl";
options = [ "NOPASSWD" ];
}
];
}
];
};
systemd.services.gokill-status = { systemd.services.gokill-status = {
enable = true; enable = true;
description = "Open gokill status view at boot"; description = "Open gokill status view at boot";
wantedBy = [ "graphical.target" ]; after = [ "graphical.target" ];
wantedBy = [ "gokill.service" ];
environment = { environment = {
DISPLAY = ":0"; DISPLAY = ":0";
XAUTHORITY = "/home/rpi/.Xauthority"; XAUTHORITY = "/home/rpi/.Xauthority";
}; };
#preStart = "${pkgs.coreutils-full}/bin/sleep 30";
serviceConfig = { serviceConfig = {
ExecStart = "${self.packages.aarch64-linux.showGokillStatus}/bin/show-gokill-status"; ExecStart = "${self.packages.aarch64-linux.showGokillStatus}/bin/show-gokill-status";
}; };
@@ -280,7 +300,7 @@
type = "Timeout"; type = "Timeout";
name = "custom timeout"; name = "custom timeout";
options = { options = {
duration = 60; duration = 120;
}; };
actions = [ actions = [
{ {
@@ -320,6 +340,11 @@
i3lock #default i3 screen locker i3lock #default i3 screen locker
]; ];
}; };
# Hide mouse cursor
displayManager.startx.extraCommands = ''
${pkgs.unclutter}/bin/unclutter &
'';
}; };
services.openssh.enable = true; services.openssh.enable = true;