Merge pull request #189744 from symphorien/vaultwarden-service

nixos/vaultwarden: misc fixes

authored by

Guillaume Girol and committed by
GitHub
a47cfca9 730715f4

+4 -1
+4 -1
nixos/modules/services/security/vaultwarden/default.nix
··· 197 AmbientCapabilities = "CAP_NET_BIND_SERVICE"; 198 StateDirectory = "bitwarden_rs"; 199 StateDirectoryMode = "0700"; 200 }; 201 wantedBy = [ "multi-user.target" ]; 202 }; ··· 209 BACKUP_FOLDER = cfg.backupDir; 210 }; 211 path = with pkgs; [ sqlite ]; 212 serviceConfig = { 213 SyslogIdentifier = "backup-vaultwarden"; 214 Type = "oneshot"; ··· 220 }; 221 222 systemd.timers.backup-vaultwarden = mkIf (cfg.backupDir != null) { 223 - aliases = [ "backup-bitwarden_rs.service" ]; 224 description = "Backup vaultwarden on time"; 225 timerConfig = { 226 OnCalendar = mkDefault "23:00";
··· 197 AmbientCapabilities = "CAP_NET_BIND_SERVICE"; 198 StateDirectory = "bitwarden_rs"; 199 StateDirectoryMode = "0700"; 200 + Restart = "always"; 201 }; 202 wantedBy = [ "multi-user.target" ]; 203 }; ··· 210 BACKUP_FOLDER = cfg.backupDir; 211 }; 212 path = with pkgs; [ sqlite ]; 213 + # if both services are started at the same time, vaultwarden fails with "database is locked" 214 + before = [ "vaultwarden.service" ]; 215 serviceConfig = { 216 SyslogIdentifier = "backup-vaultwarden"; 217 Type = "oneshot"; ··· 223 }; 224 225 systemd.timers.backup-vaultwarden = mkIf (cfg.backupDir != null) { 226 + aliases = [ "backup-bitwarden_rs.timer" ]; 227 description = "Backup vaultwarden on time"; 228 timerConfig = { 229 OnCalendar = mkDefault "23:00";