Enable hedgedoc on alto

This commit is contained in:
SebastianStork 2025-04-11 09:03:43 +02:00
parent 7c1275b0de
commit 6d9652bcc2
4 changed files with 117 additions and 7 deletions

View file

@ -0,0 +1,36 @@
{
config,
pkgs,
lib,
...
}:
{
options.myConfig.hedgedoc.backups.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.hedgedoc.backups.enable {
myConfig.resticBackup.hedgedoc = {
healthchecks.enable = true;
extraConfig = {
backupPrepareCommand = ''
${lib.getExe' pkgs.systemd "systemctl"} stop hedgedoc.service
'';
backupCleanupCommand = ''
${lib.getExe' pkgs.systemd "systemctl"} start hedgedoc.service
'';
paths = [ "/var/lib/hedgedoc" ];
};
};
environment.systemPackages = [
(pkgs.writeShellApplication {
name = "hedgedoc-restore";
text = ''
sudo systemctl stop hedgedoc.service
sudo restic-hedgedoc restore --target / latest
sudo systemctl start hedgedoc.service
'';
})
];
};
}