diff options
author | Dominique Martinet @ jormungand <asmadeus@codewreck.org> | 2020-05-09 20:52:00 +0200 |
---|---|---|
committer | Dominique Martinet @ jormungand <asmadeus@codewreck.org> | 2020-05-09 20:52:15 +0200 |
commit | 523ff1709c00e737620806d73e59ed5b9e8e945d (patch) | |
tree | c1684dcd5726a3df763a281bfa2ac2fc8daf5aa4 /machines/jormungand | |
parent | ad2be966e193133fcac2a9843ba53585b0d1c992 (diff) |
mpd: move out of container
Diffstat (limited to 'machines/jormungand')
-rw-r--r-- | machines/jormungand/configuration.nix | 1 | ||||
-rw-r--r-- | machines/jormungand/containers.nix | 38 | ||||
-rw-r--r-- | machines/jormungand/mpd.nix | 9 |
3 files changed, 10 insertions, 38 deletions
diff --git a/machines/jormungand/configuration.nix b/machines/jormungand/configuration.nix index 2d44ab3..0ddd4d3 100644 --- a/machines/jormungand/configuration.nix +++ b/machines/jormungand/configuration.nix @@ -8,6 +8,7 @@ ../../modules/common.nix ../../modules/users.nix ./nginx.nix + ./mpd.nix ../../modules/ashuffle.nix ./containers.nix ]; diff --git a/machines/jormungand/containers.nix b/machines/jormungand/containers.nix index 737091c..58987b3 100644 --- a/machines/jormungand/containers.nix +++ b/machines/jormungand/containers.nix @@ -20,44 +20,6 @@ let targetConfig = { time.timeZone = "Europe/Paris"; }; in { - - containers.mpd = { - autoStart = true; - timeoutStartSec = "10m"; - bindMounts = { - "/var/lib/mpd/music" = { hostPath = "/home/asmadeus/zik"; }; - }; - config = { config, pkgs, ... }: targetConfig // { - services.mpd = { - enable = true; - extraConfig = '' - replaygain "auto" - volume_normalization "yes" - max_output_buffer_size "32768" - filesystem_charset "UTF-8" - id3v1_encoding "UTF-8" - audio_output { - type "httpd" - name "mpd" - encoder "vorbis" # optional, vorbis or lame - port "8080" - bind_to_address "127.0.0.1" # optional, IPv4 or IPv6 - quality "5.0" # do not define if bitrate is defined - #bitrate "128" # do not define if quality is defined - format "44100:16:2" - max_clients "0" # optional 0=no limit - } - # until services.mpd.fluidsynth, see https://github.com/NixOS/nixpkgs/pull/87270 - decoder { - plugin "fluidsynth" - soundfont "${pkgs.soundfont-fluid}/share/soundfonts/FluidR3_GM2-2.sf2" - } - ''; - }; - environment.systemPackages = with pkgs; [ ashuffle soundfont-fluid ]; - }; - }; - containers.matrix = { autoStart = true; timeoutStartSec = "10m"; diff --git a/machines/jormungand/mpd.nix b/machines/jormungand/mpd.nix new file mode 100644 index 0000000..f857684 --- /dev/null +++ b/machines/jormungand/mpd.nix @@ -0,0 +1,9 @@ +{ config, pkgs, ... }: + +{ + imports = [ ../../modules/mpd.nix ]; + + systemd.services.mpd.serviceConfig.BindReadOnlyPaths = [ + "/home/asmadeus/zik:/var/lib/mpd/music" + ]; +} |