]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/mpd.nix
Move secrets to flakes
[perso/Immae/Config/Nix.git] / modules / private / mpd.nix
index c7e24862e00ad4c038187867e8aba9fb67ba6a9f..f2e87bb8006c1152fec3f6f6583fba251e7e69ed 100644 (file)
@@ -1,4 +1,4 @@
-{ lib, pkgs, config, myconfig,  ... }:
+{ lib, pkgs, config,  ... }:
 {
   options.myServices.mpd.enable = lib.mkEnableOption "enable MPD";
   config = lib.mkIf config.myServices.mpd.enable {
@@ -9,7 +9,7 @@
       {
         dest = "mpd";
         permissions = "0400";
-        text = myconfig.env.mpd.password;
+        text = config.myEnv.mpd.password;
       }
       {
         dest = "mpd-config";
@@ -17,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"
         '';
       }
     ];
     systemd.services.mpd.serviceConfig.RuntimeDirectory = "mpd";
     services.filesWatcher.mpd = {
       restart = true;
-      paths = [ "/var/secrets/mpd-config" ];
+      paths = [ config.secrets.fullPaths."mpd-config" ];
     };
 
     services.mpd = {
       enable = true;
       network.listenAddress = "any";
-      musicDirectory = myconfig.env.mpd.folder;
+      musicDirectory = config.myEnv.mpd.folder;
       extraConfig = ''
-        include "/var/secrets/mpd-config"
+        include "${config.secrets.fullPaths."mpd-config"}"
         audio_output {
           type            "null"
           name            "No Output"