Merge pull request #189744 from symphorien/vaultwarden-service

nixos/vaultwarden: misc fixes
This commit is contained in:
Guillaume Girol 2022-09-12 19:26:39 +00:00 committed by GitHub
commit a47cfca9af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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";