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 =
let
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
pkgs.writeShellScriptBin "show-gokill-status" ''
@@ -35,8 +35,7 @@
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
${pkgs.i3}/bin/i3-msg "exec $TERMINAL -T 'Status' -e $APP_COMMAND";
# layout tabbed"
${pkgs.i3}/bin/i3-msg "exec $TERMINAL -T 'Status' -e $APP_COMMAND; layout tabbed"
'';
packages.alarmSound = pkgs.writeShellScriptBin "alarm-sound" ''
@@ -154,6 +153,7 @@
environment.systemPackages = with pkgs; [
libraspberrypi
raspberrypi-eeprom
unclutter
self.packages.aarch64-linux.alertTest
];
@@ -218,7 +218,7 @@
[all]
enable_uart=1
dtoverlay=piscreen,drm,rotate=180,speed=18000000s
dtoverlay=piscreen,drm,rotate=0,speed=18000000s
'';
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 = {
enable = true;
description = "Open gokill status view at boot";
wantedBy = [ "graphical.target" ];
after = [ "graphical.target" ];
wantedBy = [ "gokill.service" ];
environment = {
DISPLAY = ":0";
XAUTHORITY = "/home/rpi/.Xauthority";
};
#preStart = "${pkgs.coreutils-full}/bin/sleep 30";
serviceConfig = {
ExecStart = "${self.packages.aarch64-linux.showGokillStatus}/bin/show-gokill-status";
};
@@ -280,7 +300,7 @@
type = "Timeout";
name = "custom timeout";
options = {
duration = 60;
duration = 120;
};
actions = [
{
@@ -320,6 +340,11 @@
i3lock #default i3 screen locker
];
};
# Hide mouse cursor
displayManager.startx.extraCommands = ''
${pkgs.unclutter}/bin/unclutter &
'';
};
services.openssh.enable = true;