X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Fprivate%2Fmpd.nix;h=640b0015f6078fc47fbf152abf005358c73f59f2;hb=f69e0c01557a7cd2c6f353f71126c4cd47ae344c;hp=1e6e666d978f6881a70f92f3aca66d04030e831e;hpb=ab8f306d7c2c49b8116e1af7b355ed2384617ed9;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/modules/private/mpd.nix b/modules/private/mpd.nix index 1e6e666..640b001 100644 --- a/modules/private/mpd.nix +++ b/modules/private/mpd.nix @@ -2,31 +2,26 @@ { 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"; + secrets.keys = { + "mpd" = { permissions = "0400"; text = config.myEnv.mpd.password; - } - { - dest = "mpd-config"; + }; + "mpd-config" = { permissions = "0400"; user = "mpd"; group = "mpd"; text = '' password "${config.myEnv.mpd.password}@read,add,control,admin" ''; - } - ]; + }; + }; networking.firewall.allowedTCPPorts = [ 6600 ]; users.users.mpd.extraGroups = [ "wwwrun" "keys" ]; systemd.services.mpd.serviceConfig.RuntimeDirectory = "mpd"; services.filesWatcher.mpd = { restart = true; - paths = [ "/var/secrets/mpd-config" ]; + paths = [ config.secrets.fullPaths."mpd-config" ]; }; services.mpd = { @@ -34,7 +29,7 @@ network.listenAddress = "any"; musicDirectory = config.myEnv.mpd.folder; extraConfig = '' - include "/var/secrets/mpd-config" + include "${config.secrets.fullPaths."mpd-config"}" audio_output { type "null" name "No Output"