mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 17:31:34 +01:00
Enable actualbudget on alto
This commit is contained in:
parent
2194d76230
commit
e558859799
3 changed files with 89 additions and 2 deletions
33
modules/system/actualbudget/backups.nix
Normal file
33
modules/system/actualbudget/backups.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options.myConfig.actualbudget.backups.enable = lib.mkEnableOption "";
|
||||
|
||||
config = lib.mkIf config.myConfig.actualbudget.backups.enable {
|
||||
myConfig.resticBackup.actual = {
|
||||
enable = true;
|
||||
healthchecks.enable = true;
|
||||
|
||||
extraConfig = {
|
||||
backupPrepareCommand = "${lib.getExe' pkgs.systemd "systemctl"} stop actual.service";
|
||||
backupCleanupCommand = "${lib.getExe' pkgs.systemd "systemctl"} start actual.service";
|
||||
paths = [ "/var/lib/actual" ];
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = [
|
||||
(pkgs.writeShellApplication {
|
||||
name = "actual-restore";
|
||||
text = ''
|
||||
sudo systemctl stop actual.service
|
||||
sudo restic-actual restore latest --target /
|
||||
sudo systemctl start actual.service
|
||||
'';
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue