home/modules: start background tasks in background.slice

This commit is contained in:
2025-05-27 11:06:33 +02:00
parent a76415de95
commit 96b66673ec
10 changed files with 10 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ in
Service = {
Type = "oneshot";
Slice = "background.slice";
CPUSchedulingPolicy = "idle";
IOSchedulingClass = "idle";
ExecStart = "${lib.getExe cfg.package} prune";

View File

@@ -32,6 +32,7 @@ in
Service = {
Type = "oneshot";
Slice = "background.slice";
CPUSchedulingPolicy = "idle";
IOSchedulingClass = "idle";
ExecStart = "${lib.getExe cfg.package} --refresh-keys";

View File

@@ -32,6 +32,7 @@ in
Service = {
Type = "oneshot";
Slice = "background.slice";
CPUSchedulingPolicy = "idle";
IOSchedulingClass = "idle";
ExecStart = "${lib.getExe cfg.package} --update-trustdb";

View File

@@ -31,6 +31,7 @@ in
Service = {
Type = "oneshot";
Slice = "background.slice";
CPUSchedulingPolicy = "idle";
IOSchedulingClass = "idle";
ExecStart = lib.getExe (pkgs.writeShellApplication {

View File

@@ -26,6 +26,7 @@ in
Service = {
Type = "oneshot";
Slice = "background.slice";
CPUSchedulingPolicy = "idle";
IOSchedulingClass = "idle";
ExecStart = "${lib.getExe pkgs.flock} %t/newsboat.lock ${lib.getExe package} --execute=reload";

View File

@@ -25,6 +25,7 @@ in
Service = {
Type = "oneshot";
Slice = "background.slice";
CPUSchedulingPolicy = "idle";
IOSchedulingClass = "idle";
ExecStart = "${lib.getExe pkgs.flock} %t/newsboat.lock ${lib.getExe package} --vacuum";

View File

@@ -44,6 +44,7 @@ in
Service = {
Type = "oneshot";
Slice = "background.slice";
ExecStart = lib.getExe (pkgs.writeShellApplication {
name = "fetch-nix-index-database";
runtimeInputs = with pkgs; [

View File

@@ -61,6 +61,7 @@ in
Unit.Description = "Watchdog that moves screenshots from all prismlauncher minecraft instances into a common dir";
Service = {
Type = "oneshot";
Slice = "background.slice";
ExecStart = lib.getExe (pkgs.writeShellApplication {
name = "prismlauncher-move-minecraft-screenshots.sh";
runtimeInputs = with pkgs; [ coreutils findutils ];

View File

@@ -115,6 +115,7 @@ in
Unit.Description = "Downloads directory watchdog, sorts the downloads directory";
Service = {
Type = "oneshot";
Slice = "background.slice";
SyslogIdentifier = mapping.unitName;
ExecStart = let
script = pkgs.writeShellApplication {

View File

@@ -36,6 +36,7 @@ in
};
Service = {
Type = "oneshot";
Slice = "background.slice";
ExecStart = "${lib.getExe pkgs.mpc-cli} update --wait";
PrivateUsers = true;