X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=modules%2Fprivate%2Fmpd.nix;fp=modules%2Fprivate%2Fmpd.nix;h=0000000000000000000000000000000000000000;hb=1a64deeb894dc95e2645a75771732c6cc53a79ad;hp=640b0015f6078fc47fbf152abf005358c73f59f2;hpb=fa25ffd4583cc362075cd5e1b4130f33306103f0;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/modules/private/mpd.nix b/modules/private/mpd.nix deleted file mode 100644 index 640b001..0000000 --- a/modules/private/mpd.nix +++ /dev/null @@ -1,60 +0,0 @@ -{ lib, pkgs, config, ... }: -{ - options.myServices.mpd.enable = lib.mkEnableOption "enable MPD"; - config = lib.mkIf config.myServices.mpd.enable { - secrets.keys = { - "mpd" = { - permissions = "0400"; - text = config.myEnv.mpd.password; - }; - "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 = [ config.secrets.fullPaths."mpd-config" ]; - }; - - services.mpd = { - enable = true; - network.listenAddress = "any"; - musicDirectory = config.myEnv.mpd.folder; - extraConfig = '' - include "${config.secrets.fullPaths."mpd-config"}" - audio_output { - type "null" - name "No Output" - mixer_type "none" - } - audio_output { - type "httpd" - name "OGG" - encoder "vorbis" - bind_to_address "/run/mpd/ogg.sock" - quality "5.0" - format "44100:16:1" - } - audio_output { - type "httpd" - name "MP3" - encoder "lame" - bind_to_address "/run/mpd/mp3.sock" - quality "5.0" - format "44100:16:1" - } - - - ''; - }; - }; -} -