Add systemd service to update due date in app

This commit is contained in:
thiloho
2023-11-17 12:18:16 +01:00
parent 5e3300e6ff
commit 1235dab32d
3 changed files with 22 additions and 6 deletions

6
flake.lock generated
View File

@@ -176,11 +176,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1700097994, "lastModified": 1700219613,
"narHash": "sha256-0IUYijMM+TZyuWYMowRPAzK18vuJje0OuJQRhUv+Ts8=", "narHash": "sha256-26GCFDYrDttfvcKDaYFER7qahDrHG2NZGlnCzPaL+LE=",
"owner": "thiloho", "owner": "thiloho",
"repo": "todos", "repo": "todos",
"rev": "3cb88c135f554ed94195075cb8a487ee1acf695d", "rev": "8b992461e3d2d07abf6b204298e46cc1b7ef355a",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -144,6 +144,21 @@
Restart = "always"; Restart = "always";
}; };
}; };
todoapp-check-due-dates = {
description = "Set is_overdue for todo in database to true if todo is overdue";
path = [
pkgs.postgresql_15
];
script = ''
psql -d todos -c "UPDATE user_todo SET is_overdue = true WHERE due_date::date < CURRENT_DATE AND is_completed = false AND is_overdue = false"
'';
serviceConfig = {
User = "postgres";
};
wantedBy = ["timers.target"];
partOf = [ "todoapp.service" ];
startAt = "daily";
};
denbot = { denbot = {
description = "Thilo's Den discord bot"; description = "Thilo's Den discord bot";
wantedBy = ["multi-user.target"]; wantedBy = ["multi-user.target"];

View File

@@ -56,6 +56,7 @@
userSettings = { userSettings = {
"nix.enableLanguageServer" = true; "nix.enableLanguageServer" = true;
"nix.serverPath" = "nil"; "nix.serverPath" = "nil";
"window.titleBarStyle" = "custom";
}; };
}; };
git = { git = {
@@ -69,9 +70,9 @@
obs-studio.enable = true; obs-studio.enable = true;
}; };
home = { home = {
sessionVariables = { # sessionVariables = {
NIXOS_OZONE_WL=1; # NIXOS_OZONE_WL=1;
}; # };
packages = with pkgs; [ packages = with pkgs; [
libreoffice libreoffice
airshipper airshipper