From 1615abd814f8436fe85579f9cca00dc8a1aba645 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Fri, 29 Mar 2024 10:42:25 +0100 Subject: [PATCH] mpd/curacao: Can be controlled remotely --- curacao/default.nix | 1 + curacao/homeautomation/default.nix | 10 ++++++++++ hm/desktop/mpd/default.nix | 3 +-- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 curacao/homeautomation/default.nix 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 = ''