services: navidrome: setup restic backups

This commit is contained in:
Antoine Martin 2021-08-22 17:48:45 +02:00
parent 8157595747
commit c94356e24f
2 changed files with 13 additions and 5 deletions

View file

@ -114,7 +114,7 @@ in
navidrome = {
enable = true;
musicFolder = "${config.services.nextcloud.home}/data/alarsyo/files/Musique/Songs";
musicFolder.path = "${config.services.nextcloud.home}/data/alarsyo/files/Musique/Songs";
};
nextcloud = {

View file

@ -8,9 +8,12 @@ let
in {
options.my.services.navidrome = {
enable = mkEnableOption "Navidrome";
musicFolder = mkOption {
type = types.str;
default = "./music";
musicFolder = {
path = mkOption {
type = types.str;
default = "./music";
};
backup = mkEnableOption "backup the music folder";
};
};
@ -21,10 +24,15 @@ in {
Address = "127.0.0.1";
Port = 4533;
LastFM.Enabled = false;
MusicFolder = cfg.musicFolder;
MusicFolder = cfg.musicFolder.path;
};
};
my.services.restic-backup = {
paths = [ "/var/lib/navidrome" ] ++ optional cfg.musicFolder.backup cfg.musicFolder.path;
exclude = [ "/var/lib/navidrome/cache" ];
};
services.nginx.virtualHosts."music.${domain}" = {
forceSSL = true;
useACMEHost = domain;