]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/mpd.nix
Add syden peertube website
[perso/Immae/Config/Nix.git] / modules / private / mpd.nix
index b2241651921d93c36524b0d566a33dbadfae7683..1e6e666d978f6881a70f92f3aca66d04030e831e 100644 (file)
@@ -1,14 +1,15 @@
-{ lib, pkgs, config, myconfig,  ... }:
+{ lib, pkgs, config,  ... }:
 {
-  config = {
-    services.backup.profiles.mpd = {
+  options.myServices.mpd.enable = lib.mkEnableOption "enable MPD";
+  config = lib.mkIf config.myServices.mpd.enable {
+    services.duplyBackup.profiles.mpd = {
       rootDir = "/var/lib/mpd";
     };
     secrets.keys = [
       {
         dest = "mpd";
         permissions = "0400";
-        text = myconfig.env.mpd.password;
+        text = config.myEnv.mpd.password;
       }
       {
         dest = "mpd-config";
@@ -16,7 +17,7 @@
         user = "mpd";
         group = "mpd";
         text = ''
-          password "${myconfig.env.mpd.password}@read,add,control,admin"
+          password "${config.myEnv.mpd.password}@read,add,control,admin"
         '';
       }
     ];
@@ -31,7 +32,7 @@
     services.mpd = {
       enable = true;
       network.listenAddress = "any";
-      musicDirectory = myconfig.env.mpd.folder;
+      musicDirectory = config.myEnv.mpd.folder;
       extraConfig = ''
         include "/var/secrets/mpd-config"
         audio_output {