about summary refs log tree commit diff
path: root/hosts/roles
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/roles')
-rw-r--r--hosts/roles/music-server.nix31
1 files changed, 31 insertions, 0 deletions
diff --git a/hosts/roles/music-server.nix b/hosts/roles/music-server.nix
new file mode 100644
index 0000000..0b41b05
--- /dev/null
+++ b/hosts/roles/music-server.nix
@@ -0,0 +1,31 @@
+{ config, pkgs, lib, ... }:
+let cfg = config.my.roles.music-server;
+
+in {
+  options.my.roles.music-server = {
+    enable = lib.mkEnableOption "Music server";
+  };
+
+  config = lib.mkIf cfg.enable {
+    services.navidrome = {
+      enable = true;
+      settings = {
+        MusicFolder = "/data/fast/music";
+        Address = "0.0.0.0";
+        httpPort = "4533";
+      };
+    };
+
+    services.restic.backups = {
+      navidrome = {
+        paths = [ "/var/lib/navidrome/" ];
+        repository = "/data/slow/backups/systems";
+        passwordFile = config.age.secrets.restic-repo-systems.path;
+        timerConfig = { OnCalendar = "00:35"; };
+        initialize = true;
+        extraBackupArgs = [ "--tag navidrome" ];
+        pruneOpts = [ "--keep-daily 7" "--keep-weekly 4 --keep-monthly 6" ];
+      };
+    };
+  };
+}