mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 07:23:20 +00:00
Merge pull request #189744 from symphorien/vaultwarden-service
nixos/vaultwarden: misc fixes
This commit is contained in:
commit
a47cfca9af
@ -197,6 +197,7 @@ in {
|
||||
AmbientCapabilities = "CAP_NET_BIND_SERVICE";
|
||||
StateDirectory = "bitwarden_rs";
|
||||
StateDirectoryMode = "0700";
|
||||
Restart = "always";
|
||||
};
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
@ -209,6 +210,8 @@ in {
|
||||
BACKUP_FOLDER = cfg.backupDir;
|
||||
};
|
||||
path = with pkgs; [ sqlite ];
|
||||
# if both services are started at the same time, vaultwarden fails with "database is locked"
|
||||
before = [ "vaultwarden.service" ];
|
||||
serviceConfig = {
|
||||
SyslogIdentifier = "backup-vaultwarden";
|
||||
Type = "oneshot";
|
||||
@ -220,7 +223,7 @@ in {
|
||||
};
|
||||
|
||||
systemd.timers.backup-vaultwarden = mkIf (cfg.backupDir != null) {
|
||||
aliases = [ "backup-bitwarden_rs.service" ];
|
||||
aliases = [ "backup-bitwarden_rs.timer" ];
|
||||
description = "Backup vaultwarden on time";
|
||||
timerConfig = {
|
||||
OnCalendar = mkDefault "23:00";
|
||||
|
Loading…
Reference in New Issue
Block a user