From 3c26c0ef573cdf976f4f4d8e98525419afad1972 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 2 Aug 2016 14:27:40 +0200 Subject: pulseaudio on bragi --- bragi.nix | 44 +++++++++++++++++--------------------------- 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/bragi.nix b/bragi.nix index 89ed2628..8b704f68 100644 --- a/bragi.nix +++ b/bragi.nix @@ -36,18 +36,7 @@ in rec { }; } ); - trivmix = let trivmix = customizedHaskellPackages.trivmix; in - pkgs.stdenv.mkDerivation { - name = "trivmix-wrapper"; - nativeBuildInputs = [ pkgs.makeWrapper ]; - buildCommand = '' - mkdir -p $out/bin - makeWrapper ${trivmix}/bin/trivmix $out/bin/trivmix \ - --run "umask 0" \ - --set JACK_PROMISCUOUS_SERVER 1 - ''; - }; - # jack2 = pkgs.callPackage ./customized/jack2.nix {}; + jack2Full = pkgs.symlinkJoin { name = "jack2"; paths = [ (pkgs.jack2Full.override { dbus = null; }) ]; @@ -55,7 +44,6 @@ in rec { postBuild = '' for bin in $out/bin/${"*"}; do wrapProgram $bin \ - --set JACK_PROMISCUOUS_SERVER 1 \ --run "umask 0" done ''; @@ -65,22 +53,9 @@ in rec { name = "mpd"; paths = [ (pkgs.mpd.override { gmeSupport = false; pulseaudioSupport = false; }) ]; buildInputs = [ pkgs.makeWrapper ]; - postBuild = '' - wrapProgram $out/bin/mpd \ - --set JACK_PROMISCUOUS_SERVER 1 \ - --run "umask 0" ''; }; - mpv = pkgs.stdenv.lib.overrideDerivation pkgs.mpv (oldAttrs: { - buildInputs = oldAttrs.buildInputs ++ [pkgs.makeWrapper]; - postInstall = '' - wrapProgram $out/bin/mpv \ - --set JACK_PROMISCUOUS_SERVER 1 \ - --run "umask 0" - ''; - }); - inherit (pkgs.callPackage ./custom/thermoprint {}) thermoprint-server thermoprint-webgui tprint; }; @@ -91,7 +66,7 @@ in rec { tmux nfs-utils jack2Full - trivmix + haskellPackages.trivmix zsh tprint ]; @@ -121,6 +96,10 @@ in rec { ''; }; + systemd.globalEnvironment = { + JACK_PROMISCUOUS_SERVER = "1"; + }; + systemd.services.jack = { wantedBy = [ "sound.target" ]; serviceConfig = { @@ -143,6 +122,17 @@ in rec { systemd.services."passmix4" = trivmixService { name = "passmix4"; connectOut = "system:playback_3"; connectIn = "system:capture_7"; group = "hel_out"; }; systemd.services."passmix5" = trivmixService { name = "passmix5"; connectOut = "system:playback_4"; connectIn = "system:capture_8"; group = "hel_out"; }; + hardware.pulseaudio = { + enable = true; + package = with pkgs; pulseaudioFull; + systemWide = true; + tcp = { + enable = true; + zeroconf.publish.enable = true; + zeroconf.discovery.enable = true; + }; + }; + services.mpd = { enable = true; musicDirectory = "/media/odin/music"; -- cgit v1.2.3