aboutsummaryrefslogtreecommitdiff
path: root/modules/private/mpd.nix
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2023-10-04 01:35:06 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2023-10-04 02:11:48 +0200
commit1a64deeb894dc95e2645a75771732c6cc53a79ad (patch)
tree1b9df4838f894577a09b9b260151756272efeb53 /modules/private/mpd.nix
parentfa25ffd4583cc362075cd5e1b4130f33306103f0 (diff)
downloadNix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.gz
Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.zst
Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.zip
Squash changes containing private information
There were a lot of changes since the previous commit, but a lot of them contained personnal information about users. All thos changes got stashed into a single commit (history is kept in a different place) and private information was moved in a separate private repository
Diffstat (limited to 'modules/private/mpd.nix')
-rw-r--r--modules/private/mpd.nix60
1 files changed, 0 insertions, 60 deletions
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 @@
1{ lib, pkgs, config, ... }:
2{
3 options.myServices.mpd.enable = lib.mkEnableOption "enable MPD";
4 config = lib.mkIf config.myServices.mpd.enable {
5 secrets.keys = {
6 "mpd" = {
7 permissions = "0400";
8 text = config.myEnv.mpd.password;
9 };
10 "mpd-config" = {
11 permissions = "0400";
12 user = "mpd";
13 group = "mpd";
14 text = ''
15 password "${config.myEnv.mpd.password}@read,add,control,admin"
16 '';
17 };
18 };
19 networking.firewall.allowedTCPPorts = [ 6600 ];
20 users.users.mpd.extraGroups = [ "wwwrun" "keys" ];
21 systemd.services.mpd.serviceConfig.RuntimeDirectory = "mpd";
22 services.filesWatcher.mpd = {
23 restart = true;
24 paths = [ config.secrets.fullPaths."mpd-config" ];
25 };
26
27 services.mpd = {
28 enable = true;
29 network.listenAddress = "any";
30 musicDirectory = config.myEnv.mpd.folder;
31 extraConfig = ''
32 include "${config.secrets.fullPaths."mpd-config"}"
33 audio_output {
34 type "null"
35 name "No Output"
36 mixer_type "none"
37 }
38 audio_output {
39 type "httpd"
40 name "OGG"
41 encoder "vorbis"
42 bind_to_address "/run/mpd/ogg.sock"
43 quality "5.0"
44 format "44100:16:1"
45 }
46 audio_output {
47 type "httpd"
48 name "MP3"
49 encoder "lame"
50 bind_to_address "/run/mpd/mp3.sock"
51 quality "5.0"
52 format "44100:16:1"
53 }
54
55
56 '';
57 };
58 };
59}
60