reformat all the nix files

using
    nix run -f channel:nixos-unstable nixfmt -c nixfmt $(git ls-files *.nix)
This commit is contained in:
Raphael Borun Das Gupta 2020-04-05 19:05:38 +02:00
parent a7f51f92f1
commit bf0be939cc
14 changed files with 312 additions and 312 deletions

View file

@ -1,33 +1,29 @@
# Regular backup role to a separate device
{
systemdMount, # Systemd mount name
borgArchiveFolder, # Absolute borg root folder
keepWithin? "14d",
keepWeekly? "4",
keepMonthly? "6",
keepYearly? "-1",
schedule? "13:37", # Systemd Schedule of backup timer
{ systemdMount, # Systemd mount name
borgArchiveFolder, # Absolute borg root folder
keepWithin ? "14d", keepWeekly ? "4", keepMonthly ? "6", keepYearly ? "-1"
, schedule ? "13:37", # Systemd Schedule of backup timer
}:
let pkgs = import<nixpkgs>{};
in
{
let pkgs = import <nixpkgs> { };
in {
systemd = {
systemd = {
services.backup = {
description = "Backup of all user data and system configuration with BorgBackup";
description =
"Backup of all user data and system configuration with BorgBackup";
serviceConfig.Type = "oneshot";
path = with pkgs; [ bash borgbackup ];
script = ''
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
systemctl start ${systemdMount}
export BORG_REPO=${borgArchiveFolder} \
BORG_BASE_DIR=${borgArchiveFolder}/borg-base-dir
echo "Backup started at `date`"
borg create --exclude /var/backup \
--exclude /var/tmp \
@ -37,10 +33,10 @@ in
/home \
/root \
/var
sync
echo "Backup finished at `date`"
echo "Backup prune started at `date`"
borg prune --prefix '{hostname}-' \
--keep-within ${keepWithin} \