aboutsummaryrefslogtreecommitdiff
path: root/nixops
diff options
context:
space:
mode:
Diffstat (limited to 'nixops')
-rw-r--r--nixops/eldiron.nix1
-rw-r--r--nixops/modules/mpd/default.nix41
-rw-r--r--nixops/modules/websites/tools/tools/default.nix4
-rw-r--r--nixops/modules/websites/tools/tools/ympd.json15
-rw-r--r--nixops/modules/websites/tools/tools/ympd.nix15
5 files changed, 74 insertions, 2 deletions
diff --git a/nixops/eldiron.nix b/nixops/eldiron.nix
index cad4e75..a4b3f73 100644
--- a/nixops/eldiron.nix
+++ b/nixops/eldiron.nix
@@ -24,6 +24,7 @@
24 ./modules/certificates.nix 24 ./modules/certificates.nix
25 ./modules/gitolite 25 ./modules/gitolite
26 ./modules/databases 26 ./modules/databases
27 ./modules/mpd
27 ./modules/websites 28 ./modules/websites
28 ./modules/mail 29 ./modules/mail
29 ./modules/ftp 30 ./modules/ftp
diff --git a/nixops/modules/mpd/default.nix b/nixops/modules/mpd/default.nix
new file mode 100644
index 0000000..7781b36
--- /dev/null
+++ b/nixops/modules/mpd/default.nix
@@ -0,0 +1,41 @@
1{ lib, pkgs, config, myconfig, mylibs, ... }:
2{
3 config = {
4 networking.firewall.allowedTCPPorts = [ 6600 ];
5 users.users.mpd.extraGroups = [ "wwwrun" ];
6 services.mpd = {
7 enable = true;
8 network.listenAddress = "any";
9 musicDirectory = myconfig.env.mpd.folder;
10 extraConfig = ''
11 password "${myconfig.env.mpd.password}@read,add,control,admin"
12 audio_output {
13 type "null"
14 name "No Output"
15 mixer_type "none"
16 }
17 audio_output {
18 type "httpd"
19 name "OGG"
20 encoder "vorbis"
21 port "${myconfig.env.ports.mpd_ogg}"
22 bind_to_address "127.0.0.1"
23 quality "5.0"
24 format "44100:16:1"
25 }
26 audio_output {
27 type "httpd"
28 name "MP3"
29 encoder "lame"
30 port "${myconfig.env.ports.mpd_mp3}"
31 bind_to_address "127.0.0.1"
32 quality "5.0"
33 format "44100:16:1"
34 }
35
36
37 '';
38 };
39 };
40}
41
diff --git a/nixops/modules/websites/tools/tools/default.nix b/nixops/modules/websites/tools/tools/default.nix
index 5db7d3e..2e10a46 100644
--- a/nixops/modules/websites/tools/tools/default.nix
+++ b/nixops/modules/websites/tools/tools/default.nix
@@ -117,6 +117,10 @@ in {
117 dokuwiki = dokuwiki.activationScript; 117 dokuwiki = dokuwiki.activationScript;
118 }; 118 };
119 119
120 nixpkgs.config.packageOverrides = oldpkgs: rec {
121 ympd = oldpkgs.ympd.overrideAttrs(old: mylibs.fetchedGithub ./ympd.json);
122 };
123
120 systemd.services.tt-rss = { 124 systemd.services.tt-rss = {
121 description = "Tiny Tiny RSS feeds update daemon"; 125 description = "Tiny Tiny RSS feeds update daemon";
122 serviceConfig = { 126 serviceConfig = {
diff --git a/nixops/modules/websites/tools/tools/ympd.json b/nixops/modules/websites/tools/tools/ympd.json
new file mode 100644
index 0000000..51f06d5
--- /dev/null
+++ b/nixops/modules/websites/tools/tools/ympd.json
@@ -0,0 +1,15 @@
1{
2 "tag": "612f8fc-master",
3 "meta": {
4 "name": "ympd",
5 "url": "https://github.com/notandy/ympd",
6 "branch": "master"
7 },
8 "github": {
9 "owner": "notandy",
10 "repo": "ympd",
11 "rev": "612f8fc0b2c47fc89d403e4a044541c6b2b238c8",
12 "sha256": "01hnj10zl103mrn82vyd42fvq7w5az3jf1qz18889zv67kn73ll9",
13 "fetchSubmodules": true
14 }
15}
diff --git a/nixops/modules/websites/tools/tools/ympd.nix b/nixops/modules/websites/tools/tools/ympd.nix
index 3d0faad..613a171 100644
--- a/nixops/modules/websites/tools/tools/ympd.nix
+++ b/nixops/modules/websites/tools/tools/ympd.nix
@@ -3,14 +3,17 @@ let
3 ympd = rec { 3 ympd = rec {
4 config = { 4 config = {
5 webPort = "localhost:${env.listenPort}"; 5 webPort = "localhost:${env.listenPort}";
6 mpd = env.mpd; 6 mpd = {
7 host = "${env.mpd.host} --mpdpass ${env.mpd.password}";
8 port = env.mpd.port;
9 };
7 }; 10 };
8 apache = { 11 apache = {
9 modules = [ 12 modules = [
10 "proxy_wstunnel" 13 "proxy_wstunnel"
11 ]; 14 ];
12 vhostConf = '' 15 vhostConf = ''
13 <LocationMatch "^/mpd"> 16 <LocationMatch "^/mpd(?!/music.(mp3|ogg))">
14 Use LDAPConnect 17 Use LDAPConnect
15 Require ldap-group cn=users,cn=mpd,ou=services,dc=immae,dc=eu 18 Require ldap-group cn=users,cn=mpd,ou=services,dc=immae,dc=eu
16 </LocationMatch> 19 </LocationMatch>
@@ -24,6 +27,14 @@ let
24 <Location "/mpd/ws"> 27 <Location "/mpd/ws">
25 ProxyPass ws://${config.webPort}/ws 28 ProxyPass ws://${config.webPort}/ws
26 </Location> 29 </Location>
30 <Location "/mpd/music.mp3">
31 ProxyPass http://localhost:${env.mp3port}/
32 ProxyPassReverse http://localhost:${env.mp3port}/
33 </Location>
34 <Location "/mpd/music.ogg">
35 ProxyPass http://localhost:${env.oggport}/
36 ProxyPassReverse http://localhost:${env.oggport}/
37 </Location>
27 ''; 38 '';
28 }; 39 };
29 }; 40 };