<commit_before>[package]
name        = "hologram-damogran-audio"
version     = "1.4.0"
description = "hologram: PulseAudio and MPD service for Damogran"
requires    = [
    "mpd",
    "pulseaudio",
    "pulseaudio-zeroconf",
]

# create "pulse" user and group, with a lingering user session that ensures
# that services come up automatically on boot
[[group]]
name    = "pulse"
system  = true

[[user]]
name    = "pulse"
comment = "PulseAudio user"
group   = "pulse"
groups  = ["audio"]

[[directory]]
path = "/home/pulse"
mode = "0700"
# we place various stuff in here; set ownership in one step
[[action]]
on     = "setup"
script = "chown -R pulse:pulse /home/pulse"

[[file]]
path        = "/var/lib/systemd/linger/pulse"
contentFrom = "/dev/null" # empty file

# enable network access for PulseAudio

[[file]]
path = "/usr/share/holo/files/50-damogran/etc/pulse/default.pa.holoscript"
mode = "0755"
content = """
#!/bin/sh
    cat
    echo 'load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1;10.0.0.0/8 auth-anonymous=1'
    echo 'load-module module-zeroconf-publish'
"""

# start PulseAudio as a user service, restart automatically if PulseAudio
# decides to exit after the last network client disconnects (it needs to be
# running at all times for network discovery to work)

[[symlink]]
path   = "/home/pulse/.config/systemd/user/sockets.target.wants/pulseaudio.socket"
target = "/usr/lib/systemd/user/pulseaudio.socket"

[[symlink]]
path   = "/home/pulse/.config/systemd/user/default.target.wants/pulseaudio.service"
target = "/usr/lib/systemd/user/pulseaudio.service"

[[file]]
path = "/home/pulse/.config/systemd/user/pulseaudio.service.d/restart.conf"
content = """
    [Service]
    Restart=always
"""

# start MPD as a user service, too

[[file]]
path    = "/usr/lib/systemd/user/mpd.service"
content = '''
    [Unit]
    Description=Music Player Daemon
    After=network.target sound.target

    [Service]
    ExecStart=/usr/bin/mpd --no-daemon

    # allow MPD to use real-time priority 50
    LimitRTPRIO=50
    LimitRTTIME=infinity

    # disallow writing to /usr, /bin, /sbin, ...
    ProtectSystem=yes

    # more paranoid security settings
    NoNewPrivileges=yes
    ProtectKernelTunables=yes
    ProtectControlGroups=yes
    ProtectKernelModules=yes
    # AF_NETLINK is required by libsmbclient, or it will exit() .. *sigh*
    RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX AF_NETLINK
    RestrictNamespaces=yes

    [Install]
    WantedBy=default.target
    Also=mpd.socket
'''

[[symlink]]
path   = "/home/pulse/.config/systemd/user/default.target.wants/mpd.service"
target = "/usr/lib/systemd/user/mpd.service"

[[directory]]
path = "/home/pulse/.mpd"

[[file]]
path    = "/home/pulse/.mpdconf"
content = """
    music_directory    "/raid/data/Musik"
    playlist_directory "~/.mpd/playlists"<commit_msg>aaand it's back in the mpd package<commit_after>[package]
name        = "hologram-damogran-audio"
version     = "1.4.1"
description = "hologram: PulseAudio and MPD service for Damogran"
requires    = [
    "mpd",
    "pulseaudio",
    "pulseaudio-zeroconf",
]

# create "pulse" user and group, with a lingering user session that ensures
# that services come up automatically on boot
[[group]]
name    = "pulse"
system  = true

[[user]]
name    = "pulse"
comment = "PulseAudio user"
group   = "pulse"
groups  = ["audio"]

[[directory]]
path = "/home/pulse"
mode = "0700"
# we place various stuff in here; set ownership in one step
[[action]]
on     = "setup"
script = "chown -R pulse:pulse /home/pulse"

[[file]]
path        = "/var/lib/systemd/linger/pulse"
contentFrom = "/dev/null" # empty file

# enable network access for PulseAudio

[[file]]
path = "/usr/share/holo/files/50-damogran/etc/pulse/default.pa.holoscript"
mode = "0755"
content = """
#!/bin/sh
    cat
    echo 'load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1;10.0.0.0/8 auth-anonymous=1'
    echo 'load-module module-zeroconf-publish'
"""

# start PulseAudio as a user service, restart automatically if PulseAudio
# decides to exit after the last network client disconnects (it needs to be
# running at all times for network discovery to work)

[[symlink]]
path   = "/home/pulse/.config/systemd/user/sockets.target.wants/pulseaudio.socket"
target = "/usr/lib/systemd/user/pulseaudio.socket"

[[symlink]]
path   = "/home/pulse/.config/systemd/user/default.target.wants/pulseaudio.service"
target = "/usr/lib/systemd/user/pulseaudio.service"

[[file]]
path = "/home/pulse/.config/systemd/user/pulseaudio.service.d/restart.conf"
content = """
    [Service]
    Restart=always
"""

# start MPD as a user service, too

[[symlink]]
path   = "/home/pulse/.config/systemd/user/default.target.wants/mpd.service"
target = "/usr/lib/systemd/user/mpd.service"

[[directory]]
path = "/home/pulse/.mpd"

[[file]]
path    = "/home/pulse/.mpdconf"
content = """
    music_directory    "/raid/data/Musik"
    playlist_directory "~/.mpd/playlists"
{'fraction_non_alphanumeric': 0.14380933144819227, 'fraction_numerical': 0.011512825691779438, 'mean_word_length': 3.6022304832713754, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, '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': '3495735', 'n_tokens_mistral': 1780, 'n_tokens_neox': 1690, 'n_words': 408}