diff --git a/hosts/poseidon/default.nix b/hosts/poseidon/default.nix index cf3ca3a..fb55c25 100644 --- a/hosts/poseidon/default.nix +++ b/hosts/poseidon/default.nix @@ -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 = { diff --git a/services/navidrome.nix b/services/navidrome.nix index 3473737..b245ed5 100644 --- a/services/navidrome.nix +++ b/services/navidrome.nix @@ -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;