Automate restic restore command creation

This commit is contained in:
SebastianStork 2025-06-07 15:12:21 +02:00
parent 731f0ec615
commit e6989963c7
6 changed files with 70 additions and 95 deletions

View file

@ -1,9 +1,4 @@
{
config,
pkgs,
lib,
...
}:
{ config, lib, ... }:
let
user = config.users.users.actual.name;
in
@ -16,18 +11,5 @@ in
dependentService = "actual.service";
extraConfig.paths = [ config.services.actual.settings.dataDir ];
};
environment.systemPackages = [
(pkgs.writeShellApplication {
name = "actual-restore";
text = ''
sudo --user=${user} bash -c "
systemctl stop actual.service
restic-actual restore latest --target /
systemctl start actual.service
"
'';
})
];
};
}