diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-10-14 14:13:09 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-10-14 14:13:09 +0200 |
commit | 6c155458d18c6eaa7931023a5c207b08da6b5303 (patch) | |
tree | 60b5009e6f28b85913d0c7663383087be55adf53 /modules/system/services | |
parent | docs(notes/backup_disk.md): Init (diff) | |
download | nixos-config-6c155458d18c6eaa7931023a5c207b08da6b5303.tar.gz nixos-config-6c155458d18c6eaa7931023a5c207b08da6b5303.zip |
fix(services/backup): Fail the backup script, if a command fails
Diffstat (limited to 'modules/system/services')
-rw-r--r-- | modules/system/services/backup/default.nix | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/system/services/backup/default.nix b/modules/system/services/backup/default.nix index e5f6e241..92700bf2 100644 --- a/modules/system/services/backup/default.nix +++ b/modules/system/services/backup/default.nix @@ -5,6 +5,8 @@ ... }: let backup-script = pkgs.writeShellScriptBin "backsnap" '' + set -xeu; + ${pkgs.util-linux}/bin/mount --mkdir "/dev/disk/by-uuid/${cfg.backupDiskUuid}" "/run/media/${cfg.backupDiskUuid}"; ${pkgs.snap-sync-forked}/bin/snap-sync-forked --UUID "${cfg.backupDiskUuid}" --noconfirm; ${pkgs.util-linux}/bin/umount "/run/media/${cfg.backupDiskUuid}"; |