<commit_before>{ config, lib, pkgs, ... }:

with lib;

let
  streams = builtins.attrNames config.services.liquidsoap.streams;

  streamService =
    name:
    let stream = builtins.getAttr name config.services.liquidsoap.streams; in
    { inherit name;
      value = {
        after = [ "network-online.target" "sound.target" ];
        description = "${name} liquidsoap stream";
        wantedBy = [ "multi-user.target" ];
        path = [ pkgs.wget ];
        preStart =
          ''
            mkdir -p /var/log/liquidsoap
            chown liquidsoap -R /var/log/liquidsoap
          '';
        serviceConfig = {
          PermissionsStartOnly="true";
          ExecStart = "${pkgs.liquidsoap}/bin/liquidsoap ${stream}";
          User = "liquidsoap";
        };
      };
    };
in
{

  ##### interface

  options = {<commit_msg>nixos/liquidsoap: replace deprecated usage of PermissionsStartOnly see https://github.com/NixOS/nixpkgs/issues/53852<commit_after>{ config, lib, pkgs, ... }:

with lib;

let
  streams = builtins.attrNames config.services.liquidsoap.streams;

  streamService =
    name:
    let stream = builtins.getAttr name config.services.liquidsoap.streams; in
    { inherit name;
      value = {
        after = [ "network-online.target" "sound.target" ];
        description = "${name} liquidsoap stream";
        wantedBy = [ "multi-user.target" ];
        path = [ pkgs.wget ];
        serviceConfig = {
          ExecStart = "${pkgs.liquidsoap}/bin/liquidsoap ${stream}";
          User = "liquidsoap";
          LogsDirectory = "liquidsoap";
        };
      };
    };
in
{

  ##### interface

  options = {
{'fraction_non_alphanumeric': 0.13577981651376148, 'fraction_numerical': 0.0030581039755351682, 'mean_word_length': 2.2268244575936884, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6949765', 'n_tokens_mistral': 531, 'n_tokens_neox': 486, 'n_words': 100}