diff --git a/curacao/default.nix b/curacao/default.nix index e13ecea..e820e76 100644 --- a/curacao/default.nix +++ b/curacao/default.nix @@ -10,6 +10,7 @@ ./disko.nix ./features.nix ./hardware.nix + ./homeautomation ./webcam ]; } diff --git a/curacao/homeautomation/default.nix b/curacao/homeautomation/default.nix new file mode 100644 index 0000000..9a6cd00 --- /dev/null +++ b/curacao/homeautomation/default.nix @@ -0,0 +1,10 @@ +{ pkgs, lib, config, ... }: +{ + config = { + # Allow mpd control from home assistant and phone + networking.firewall.extraCommands = '' + iptables -A nixos-fw -p tcp -m tcp --dport 6600 -s 192.168.7.53 -j nixos-fw-accept + iptables -A nixos-fw -p tcp -m tcp --dport 6600 -s 192.168.7.92 -j nixos-fw-accept + ''; + }; +} diff --git a/hm/desktop/mpd/default.nix b/hm/desktop/mpd/default.nix index 10683ff..bea9ceb 100644 --- a/hm/desktop/mpd/default.nix +++ b/hm/desktop/mpd/default.nix @@ -14,8 +14,7 @@ services.mpd = { enable = true; network = { - listenAddress = "0.0.0.0"; # So it can be controlled from home - # TODO ... and whoever is the Wi-Fi network I'm using, which, not great + listenAddress = "0.0.0.0"; # Can be controlled remotely, determined with firewall startWhenNeeded = true; }; extraConfig = ''