stockholm/lass/2configs/home-media.nix

35 lines
963 B
Nix
Raw Normal View History

2020-04-26 17:22:50 +00:00
with import <stockholm/lib>;
{ pkgs, ... }:
{
users.users.media = {
isNormalUser = true;
uid = genid_uint31 "media";
extraGroups = [ "video" "audio" "pipewire" ];
2020-04-26 17:22:50 +00:00
};
services.xserver.displayManager.autoLogin = {
2020-04-26 17:22:50 +00:00
enable = true;
user = "media";
};
hardware.pulseaudio.configFile = pkgs.writeText "pulse.pa" ''
.include ${pkgs.pulseaudioFull}/etc/pulse/default.pa
load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1;10.42.0.0/24 auth-anonymous=1
'';
krebs.iptables.tables.filter.INPUT.rules = [
{ predicate = "-p tcp --dport 4713"; target = "ACCEPT"; } # pulseaudio
];
2022-09-18 10:19:02 +00:00
environment.systemPackages = [
(pkgs.writers.writeDashBin "snapmpv" ''
/run/current-system/sw/bin/mpv \
--audio-display=no --audio-channels=stereo \
--audio-samplerate=48000 --audio-format=s16 \
--ao-pcm-file=/run/snapserver/snapfifo --ao=pcm \
--audio-delay=-1 \
"$@"
'')
];
2020-04-26 17:22:50 +00:00
}