8 streams = builtins.attrNames config.services.liquidsoap.streams;
13 stream = builtins.getAttr name config.services.liquidsoap.streams;
19 "network-online.target"
22 description = "${name} liquidsoap stream";
23 wantedBy = [ "multi-user.target" ];
26 ExecStart = "${pkgs.liquidsoap}/bin/liquidsoap ${stream}";
28 LogsDirectory = "liquidsoap";
40 services.liquidsoap.streams = lib.mkOption {
43 Set of Liquidsoap streams to start,
44 one systemd service per stream.
49 example = lib.literalExpression ''
51 myStream1 = "/etc/liquidsoap/myStream1.liq";
52 myStream2 = ./myStream2.liq;
53 myStream3 = "out(playlist(\"/srv/music/\"))";
57 type = lib.types.attrsOf (lib.types.either lib.types.path lib.types.str);
63 config = lib.mkIf (builtins.length streams != 0) {
65 users.users.liquidsoap = {
66 uid = config.ids.uids.liquidsoap;
68 extraGroups = [ "audio" ];
69 description = "Liquidsoap streaming user";
70 home = "/var/lib/liquidsoap";
74 users.groups.liquidsoap.gid = config.ids.gids.liquidsoap;
76 systemd.services = builtins.listToAttrs (map streamService streams);