reworking pi display
This commit is contained in:
parent
9f0a8d314a
commit
b99925ff12
5 changed files with 100 additions and 133 deletions
|
|
@ -1,45 +1,14 @@
|
|||
{ pkgs, ... }:
|
||||
let
|
||||
readlink = "${pkgs.coreutils}/bin/readlink";
|
||||
notify-send = "${pkgs.libnotify}/bin/notify-send";
|
||||
in {
|
||||
{pkgs, ...}: {
|
||||
systemd = {
|
||||
services = {
|
||||
clean-keychain = {
|
||||
description = "Clean up .keychain on boot";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
wantedBy = ["multi-user.target"];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${pkgs.coreutils-full}/bin/rm -rf /home/don/.keychain";
|
||||
};
|
||||
};
|
||||
};
|
||||
user = {
|
||||
services = {
|
||||
detect-reboot-for-upgrade = {
|
||||
script = ''
|
||||
set -eu -o pipefail
|
||||
booted="$(${readlink} /run/booted-system/{initrd,kernel,kernel-modules})"
|
||||
built="$(${readlink} /nix/var/nix/profiles/system/{initrd,kernel,kernel-modules})"
|
||||
if [[ "''${booted}" != "''${built}" ]];
|
||||
then
|
||||
echo "Looks like we need a reboot!"
|
||||
${notify-send} --urgency=low --icon=system-reboot "Reboot is needed for a NixOS upgrade."
|
||||
fi
|
||||
'';
|
||||
serviceConfig = { Type = "oneshot"; };
|
||||
};
|
||||
};
|
||||
timers = {
|
||||
detect-reboot-for-upgrade = {
|
||||
wantedBy = [ "timers.target" ];
|
||||
partOf = [ "detect-reboot-for-upgrade.service" ];
|
||||
timerConfig = {
|
||||
OnCalendar = "hourly";
|
||||
Unit = "detect-reboot-for-upgrade.service";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue