Home : Make services switch-independent.
This commit is contained in:
parent
0fd72bc32c
commit
6236a8e65b
|
@ -74,7 +74,7 @@
|
|||
echo "Backup : Complete ''${bupsize}."
|
||||
'';
|
||||
in {
|
||||
systemd.services.backup = {
|
||||
systemd.services.backup = util.mkStaticSystemdService {
|
||||
enable = true;
|
||||
description = "Home system backup.";
|
||||
serviceConfig = {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
docker exec -u 33 cloud php -f /var/www/html/cron.php || notify 'Nextcloud : Failed to run cron.'
|
||||
'';
|
||||
in {
|
||||
systemd.services.nextcloud = {
|
||||
systemd.services.nextcloud = util.mkStaticSystemdService {
|
||||
enable = true;
|
||||
description = "Nextcloud worker.";
|
||||
serviceConfig = {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
{ pkgs, ... }: let
|
||||
{ pkgs, util, ... }: let
|
||||
script = ''
|
||||
in="/storage/hot/docker/cloud/data/data/cakee/files/media/photo/"
|
||||
out="/storage/cold_1/backup/tmp/photo/"
|
||||
docker run --rm -v "''${in}":/in -v "''${out}":/out voronind.com/photoprocess:latest
|
||||
'';
|
||||
in {
|
||||
systemd.services.photos_process = {
|
||||
systemd.services.photos_process = util.mkStaticSystemdService {
|
||||
enable = true;
|
||||
description = "Process uploaded photos.";
|
||||
serviceConfig = {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
{ pkgs, ... }: let
|
||||
{ pkgs, util, ... }: let
|
||||
script = ''
|
||||
music="/storage/hot/media/music/"
|
||||
docker run --rm -v "''${music}":/music voronind.com/yamusic:latest
|
||||
'';
|
||||
in {
|
||||
systemd.services.yandex_music = {
|
||||
systemd.services.yandex_music = util.mkStaticSystemdService {
|
||||
enable = true;
|
||||
description = "Sync music from Yandex.Music.";
|
||||
serviceConfig = {
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
{ const, pkgs, lib, secret, ... }: {
|
||||
systemd.services.autoupdate = {
|
||||
{ const, pkgs, lib, secret, util, ... }: {
|
||||
systemd.services.autoupdate = util.mkStaticSystemdService {
|
||||
enable = true;
|
||||
description = "Signed system auto-update.";
|
||||
restartIfChanged = false;
|
||||
serviceConfig.Type = "oneshot";
|
||||
stopIfChanged = false;
|
||||
unitConfig.X-StopOnRemoval = false;
|
||||
path = with pkgs; [
|
||||
bash
|
||||
git
|
||||
|
|
|
@ -14,4 +14,11 @@
|
|||
catText = files: args: builtins.foldl' (acc: mod:
|
||||
acc + trimTabs ((import mod args).text)
|
||||
) "" files;
|
||||
|
||||
# Systemd service that does not restart with system switch.
|
||||
mkStaticSystemdService = params: params // {
|
||||
restartIfChanged = false;
|
||||
stopIfChanged = false;
|
||||
unitConfig.X-StopOnRemoval = false;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue