mirror of
https://github.com/kmein/niveum
synced 2026-03-20 12:01:06 +01:00
chore: organize
use read-made spotifyd module move sshPort to niveum lib (used also from deploy.nix) factor out sshd config, use from toum factor out urlwatch access scardanelli locally mpd: configure webradio playlist scardanelli: use cage for kiosk toum: use wifi config toum: use spacetime, dont redeclare toum: use ssh config
This commit is contained in:
21
configs/mpd.nix
Normal file
21
configs/mpd.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
radioStations = import <niveum/lib/radio-stations.nix>;
|
||||
radioStationsFile = pkgs.writeText "stations" (lib.concatStringsSep "\n" radioStations);
|
||||
in
|
||||
{
|
||||
system.activationScripts.webradio = ''
|
||||
install -d /var/lib/mpd/playlists
|
||||
ln -sfn ${toString radioStationsFile} /var/lib/mpd/playlists/webradio.m3u
|
||||
'';
|
||||
|
||||
services.mpd.enable = true;
|
||||
services.ympd.enable = true;
|
||||
|
||||
# dont let anyone outside localhost or local network in
|
||||
networking.firewall.extraCommands = let ympdPort = config.services.ympd.webPort; in ''
|
||||
${pkgs.iptables}/bin/iptables -A INPUT -p tcp --dport ${ympdPort} -s 192.168.0.0/16 -j ACCEPT
|
||||
${pkgs.iptables}/bin/iptables -A INPUT -p tcp --dport ${ympdPort} -s 127.0.0.0/8 -j ACCEPT
|
||||
${pkgs.iptables}/bin/iptables -A INPUT -p tcp --dport ${ympdPort} -j DROP
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user