Initial commit unclean

This commit is contained in:
2025-08-30 20:31:10 +02:00
commit 4ebc8b23fe
50 changed files with 5191 additions and 0 deletions

View File

@@ -0,0 +1,58 @@
{ pkgs, ... }:
{
# Experiments with services
systemd = {
timers."sync-manage-hourly" = {
enable = false;
wantedBy = [ "timers.target" ];
timerConfig = {
OnBootSec = "10s"; # Start 10 seconds after boot
OnUnitActiveSec = "1h"; # Repeat every hour
Unit = "sync-manage.service"; # Points to the service unit
};
};
services = {
"shutdown-script" = {
enable = false;
description = "Run custom script on shutdown";
after = [ "shutdown.target" ]; # Ensure it runs during shutdown
script = "/home/jonas/projects/scripts/check_git.sh"; # Specify the path to your script
serviceConfig = {
Type = "oneshot";
User = "jonas"; # Run as jonas
WorkingDirectory = "/home/jonas"; # Set working directory to jonas' home
execStop = "/home/jonas/projects/scripts/check_git.sh"; # Specify the path to your script
# To ensure the script finishes before the system powers off
TimeoutStopSec = "30"; # You can adjust this if necessary
};
# To ensure the script finishes before the system powers off
};
"sync-manage" = {
script = ''
# Run the script from jonas' home directory
/home/jonas/projects/scripts/sync_manage.sh
'';
serviceConfig = {
Type = "oneshot";
User = "jonas"; # Run as jonas
WorkingDirectory = "/home/jonas"; # Set working directory to jonas' home
};
};
"sync-manage-shutdown" = {
enable = false;
script = ''
# Check if the system is connected to Wi-Fi
/home/jonas/projects/scripts/sync_manage.sh
'';
serviceConfig = {
Type = "oneshot";
User = "jonas"; # Run as jonas
ExecStop = "/usr/bin/true";
RemainAfterExit = true;
};
};
};
};
}