mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-22 10:14:25 +01:00
Enable hedgedoc on alto
This commit is contained in:
parent
7c1275b0de
commit
6d9652bcc2
4 changed files with 117 additions and 7 deletions
36
modules/system/hedgedoc/backups.nix
Normal file
36
modules/system/hedgedoc/backups.nix
Normal 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
|
||||
'';
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue