snapshot pre-cleanup-2026-06-04T16-10-09Z

This commit is contained in:
2026-06-04 18:10:09 +02:00
parent 3ecc4a55bf
commit d673efcc8c
4 changed files with 104 additions and 106 deletions
+1 -1
View File
@@ -119,4 +119,4 @@ disk = {
};
};
};
};
};};}
+54 -55
View File
@@ -49,7 +49,60 @@
};
};
};
perSystem = {pkgs, ...}: {
## Desktop
flake.nixosModules.autoCleanup-desktop = {
pkgs,
pkgs-unstable,
...
}: {
# Ensure your script is available system-wide
environment.systemPackages = [
self.packages.${pkgs.system}.custom-cleanNix-desktop
pkgs-unstable.statix
];
users.users.tomasr = {
linger = true; # lingering is required
};
systemd.user.services.custom-cleanNix = {
description = "NixOS configuration auto cleanup";
serviceConfig = {
Type = "oneshot";
ExecStart = "/run/current-system/sw/bin/custom-cleanNix";
# safety for long rebuilds
TimeoutStartSec = "45min";
TimeoutStopSec = "10min";
# avoid overlap
RemainAfterExit = true;
# tweaks that should make the system run normally during the rebuilds
Nice = 10;
IOSchedulingClass = "best-effort";
IOSchedulingPriority = 7;
};
};
# Systemd USER timer
systemd.user.timers.custom-cleanNix = {
wantedBy = ["timers.target"];
timerConfig = {
OnCalendar = "Sat *-*-* 20:00:00"; # runs saturday night. If for whatever reason something breaks. I have whole sunday to fix it.
Persistent = true; # if it happens during shutted down
# avoids thundering herd on boot
RandomizedDelaySec = "2h";
};
};
};
perSystem = {pkgs, ...}: {
packages.custom-cleanNix-laptop = pkgs.writeShellApplication {
name = "custom-cleanNix";
@@ -120,60 +173,6 @@
rm -f "$ERROR_FILE"
'';
};
};
## Desktop
flake.nixosModules.autoCleanup-desktop = {
pkgs,
pkgs-unstable,
...
}: {
# Ensure your script is available system-wide
environment.systemPackages = [
self.packages.${pkgs.system}.custom-cleanNix-desktop
pkgs-unstable.statix
];
users.users.tomasr = {
linger = true; # lingering is required
};
systemd.user.services.custom-cleanNix = {
description = "NixOS configuration auto cleanup";
serviceConfig = {
Type = "oneshot";
ExecStart = "/run/current-system/sw/bin/custom-cleanNix";
# safety for long rebuilds
TimeoutStartSec = "45min";
TimeoutStopSec = "10min";
# avoid overlap
RemainAfterExit = true;
# tweaks that should make the system run normally during the rebuilds
Nice = 10;
IOSchedulingClass = "best-effort";
IOSchedulingPriority = 7;
};
};
# Systemd USER timer
systemd.user.timers.custom-cleanNix = {
wantedBy = ["timers.target"];
timerConfig = {
OnCalendar = "Sat *-*-* 20:00:00"; # runs saturday night. If for whatever reason something breaks. I have whole sunday to fix it.
Persistent = true; # if it happens during shutted down
# avoids thundering herd on boot
RandomizedDelaySec = "2h";
};
};
};
perSystem = {pkgs, ...}: {
packages.custom-cleanNix-desktop = pkgs.writeShellApplication {
name = "custom-cleanNix";
+48 -49
View File
@@ -44,7 +44,54 @@
};
};
};
perSystem = {pkgs, ...}: {
## desktop
flake.nixosModules.autoUpdate-desktop = {pkgs, ...}: {
# Ensure your script is available system-wide
environment.systemPackages = [
self.packages.${pkgs.system}.custom-autoupdate-desktop
];
users.users.tomasr = {
linger = true; # lingering is required
};
systemd.user.services.custom-autoupdate = {
description = "NixOS flake auto update";
serviceConfig = {
Type = "oneshot";
ExecStart = "/run/current-system/sw/bin/custom-autoupdate";
# safety for long rebuilds
TimeoutStartSec = "45min";
TimeoutStopSec = "10min";
# avoid overlap
RemainAfterExit = true;
# tweaks that should make the system run normally during the rebuilds
Nice = 10;
IOSchedulingClass = "best-effort";
IOSchedulingPriority = 7;
};
};
# Systemd USER timer
systemd.user.timers.custom-autoupdate = {
wantedBy = ["timers.target"];
timerConfig = {
OnCalendar = "Fri *-*-* 20:00:00"; # runs friday night. If for whatever reason something breaks. I have whole week-end to fix it.
Persistent = true; # if it happens during shutted down
# avoids thundering herd on boot
RandomizedDelaySec = "2h";
};
};
};
perSystem = {pkgs, ...}: {
packages.custom-autoupdate-laptop = pkgs.writeShellApplication {
name = "custom-autoupdate";
@@ -106,54 +153,6 @@
rm -f "$ERROR_FILE"
'';
};
};
## desktop
flake.nixosModules.autoUpdate-desktop = {pkgs, ...}: {
# Ensure your script is available system-wide
environment.systemPackages = [
self.packages.${pkgs.system}.custom-autoupdate-desktop
];
users.users.tomasr = {
linger = true; # lingering is required
};
systemd.user.services.custom-autoupdate = {
description = "NixOS flake auto update";
serviceConfig = {
Type = "oneshot";
ExecStart = "/run/current-system/sw/bin/custom-autoupdate";
# safety for long rebuilds
TimeoutStartSec = "45min";
TimeoutStopSec = "10min";
# avoid overlap
RemainAfterExit = true;
# tweaks that should make the system run normally during the rebuilds
Nice = 10;
IOSchedulingClass = "best-effort";
IOSchedulingPriority = 7;
};
};
# Systemd USER timer
systemd.user.timers.custom-autoupdate = {
wantedBy = ["timers.target"];
timerConfig = {
OnCalendar = "Fri *-*-* 20:00:00"; # runs friday night. If for whatever reason something breaks. I have whole week-end to fix it.
Persistent = true; # if it happens during shutted down
# avoids thundering herd on boot
RandomizedDelaySec = "2h";
};
};
};
perSystem = {pkgs, ...}: {
packages.custom-autoupdate-desktop = pkgs.writeShellApplication {
name = "custom-autoupdate";