mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 15:33:13 +00:00
nixos/vaultwarden: create backupDir using tmpfiles.d
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
parent
635e1006e4
commit
80ea6a21fb
@ -1,8 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Based on: https://github.com/dani-garcia/vaultwarden/wiki/Backing-up-your-vault
|
||||
if ! mkdir -p "$BACKUP_FOLDER"; then
|
||||
echo "Could not create backup folder '$BACKUP_FOLDER'" >&2
|
||||
if [ ! -d "$BACKUP_FOLDER" ]; then
|
||||
echo "Backup folder '$BACKUP_FOLDER' does not exist" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -230,6 +230,13 @@ in {
|
||||
};
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
|
||||
systemd.tmpfiles.settings = mkIf (cfg.backupDir != null) {
|
||||
"10-vaultwarden".${cfg.backupDir}.d = {
|
||||
inherit user group;
|
||||
mode = "0770";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# uses attributes of the linked package
|
||||
|
Loading…
Reference in New Issue
Block a user