services: navidrome: setup restic backups
This commit is contained in:
parent
8157595747
commit
c94356e24f
|
@ -114,7 +114,7 @@ in
|
||||||
|
|
||||||
navidrome = {
|
navidrome = {
|
||||||
enable = true;
|
enable = true;
|
||||||
musicFolder = "${config.services.nextcloud.home}/data/alarsyo/files/Musique/Songs";
|
musicFolder.path = "${config.services.nextcloud.home}/data/alarsyo/files/Musique/Songs";
|
||||||
};
|
};
|
||||||
|
|
||||||
nextcloud = {
|
nextcloud = {
|
||||||
|
|
|
@ -8,10 +8,13 @@ let
|
||||||
in {
|
in {
|
||||||
options.my.services.navidrome = {
|
options.my.services.navidrome = {
|
||||||
enable = mkEnableOption "Navidrome";
|
enable = mkEnableOption "Navidrome";
|
||||||
musicFolder = mkOption {
|
musicFolder = {
|
||||||
|
path = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "./music";
|
default = "./music";
|
||||||
};
|
};
|
||||||
|
backup = mkEnableOption "backup the music folder";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
@ -21,10 +24,15 @@ in {
|
||||||
Address = "127.0.0.1";
|
Address = "127.0.0.1";
|
||||||
Port = 4533;
|
Port = 4533;
|
||||||
LastFM.Enabled = false;
|
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}" = {
|
services.nginx.virtualHosts."music.${domain}" = {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
useACMEHost = domain;
|
useACMEHost = domain;
|
||||||
|
|
Loading…
Reference in a new issue