From 13e70c17570223f24c9e8d44d1d00bcd1d0114ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Sat, 6 May 2023 08:27:43 +0100 Subject: [PATCH] only one go proc for restic on vpsfree, to see if it helps with memory usage --- nixos/boxes/vpsfree1/backups.nix | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/nixos/boxes/vpsfree1/backups.nix b/nixos/boxes/vpsfree1/backups.nix index cf5d7a8d..c18e7e01 100644 --- a/nixos/boxes/vpsfree1/backups.nix +++ b/nixos/boxes/vpsfree1/backups.nix @@ -1,12 +1,9 @@ -{ - config, - pkgs, - ... -}: let +{ config, pkgs, ... }: +let genericBackupPath = "/var/lib/backups/"; containersBackupPath = "${genericBackupPath}/oci-containers/"; in rec { - environment.systemPackages = with pkgs; [restic]; + environment.systemPackages = with pkgs; [ restic ]; sops.secrets."restic-backups-b2-repo-password" = { sopsFile = ./restic.sops.yaml; @@ -30,13 +27,17 @@ in rec { mkdir -p ${containersBackupPath}/ ${pkgs.podman}/bin/podman volume export woodpecker-server-data -o ${containersBackupPath}/woodpecker.tar ''; - timerConfig = {OnCalendar = "hourly";}; - environmentFile = "${config.sops.secrets.restic-backups-b2-environment.path}"; + timerConfig = { OnCalendar = "hourly"; }; + environmentFile = + "${config.sops.secrets.restic-backups-b2-environment.path}"; }; }; - systemd.services.restic-backups-b2.serviceConfig = { - Nice = 19; - IOSchedulingClass = "idle"; + systemd.services.restic-backups-b2 = { + environment = { GOMAXPROCS = "1"; }; + serviceConfig = { + Nice = 19; + IOSchedulingClass = "idle"; + }; }; }