From 94f8172f0f5a6d5568b5204d88c5d45e77a20f69 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sun, 24 Apr 2022 13:46:18 -0700 Subject: backups: do backups for the laptop From the laptop I only backup /home/fcuny, as the rest should be straightforward to rebuild with nix. I run that backup as my own user, since I need my ssh key to use the remote repository (which is on the NAS). I also need a new secret for it (I might have been able to use `pass' for this, but well, that's easy enough). For the NAS, I update the list of directories to backup to include home, this will be on the systems backup. --- modules/services/backup/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'modules/services') diff --git a/modules/services/backup/default.nix b/modules/services/backup/default.nix index aefd383..2db1aa8 100644 --- a/modules/services/backup/default.nix +++ b/modules/services/backup/default.nix @@ -67,6 +67,15 @@ in { When to run the backup. See man systemd.timer for details. ''; }; + + user = mkOption { + type = types.str; + default = "root"; + description = '' + As which user the backup should run. + ''; + example = "postgresql"; + }; }; config = lib.mkIf cfg.enable { @@ -76,7 +85,7 @@ in { extraBackupArgs = [ "--verbose=2" ]; # Take care of creating the repository if it doesn't exist initialize = true; - inherit (cfg) passwordFile pruneOpts timerConfig repository; + inherit (cfg) passwordFile pruneOpts timerConfig repository user; }; }; } -- cgit 1.4.1