From cf30e1c21fd93fbb58cc177996093709c2979302 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Wed, 9 Oct 2024 11:59:13 -0400 Subject: [PATCH] fix(netd): handle source filter properly --- .../homie/modules/home-assistant/default.nix | 3 +++ .../apps/Spotify/PlayAlbum/PlayAlbum.yaml | 1 - .../apps/Spotify/PlayArtist/PlayArtist.yaml | 1 - .../Spotify/PlayPlaylist/PlayPlaylist.yaml | 1 - .../apps/Spotify/PlaySong/PlaySong.yaml | 1 - .../home-assistant/netdaemon/package.nix | 19 ++++++++----------- .../home-assistant/netdaemon/program.cs | 1 - 7 files changed, 11 insertions(+), 16 deletions(-) delete mode 100644 devices/homie/modules/home-assistant/netdaemon/apps/Spotify/PlayAlbum/PlayAlbum.yaml delete mode 100644 devices/homie/modules/home-assistant/netdaemon/apps/Spotify/PlayArtist/PlayArtist.yaml delete mode 100644 devices/homie/modules/home-assistant/netdaemon/apps/Spotify/PlayPlaylist/PlayPlaylist.yaml delete mode 100644 devices/homie/modules/home-assistant/netdaemon/apps/Spotify/PlaySong/PlaySong.yaml diff --git a/devices/homie/modules/home-assistant/default.nix b/devices/homie/modules/home-assistant/default.nix index 8fc8bec6..748535a1 100644 --- a/devices/homie/modules/home-assistant/default.nix +++ b/devices/homie/modules/home-assistant/default.nix @@ -9,6 +9,9 @@ ./timer.nix ]; + # TODO: netd: make error handling with HA notifs + # TODO: nix: add HA options for custom_sentences and stuff + services.home-assistant = { enable = true; diff --git a/devices/homie/modules/home-assistant/netdaemon/apps/Spotify/PlayAlbum/PlayAlbum.yaml b/devices/homie/modules/home-assistant/netdaemon/apps/Spotify/PlayAlbum/PlayAlbum.yaml deleted file mode 100644 index 8b137891..00000000 --- a/devices/homie/modules/home-assistant/netdaemon/apps/Spotify/PlayAlbum/PlayAlbum.yaml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/devices/homie/modules/home-assistant/netdaemon/apps/Spotify/PlayArtist/PlayArtist.yaml b/devices/homie/modules/home-assistant/netdaemon/apps/Spotify/PlayArtist/PlayArtist.yaml deleted file mode 100644 index 8b137891..00000000 --- a/devices/homie/modules/home-assistant/netdaemon/apps/Spotify/PlayArtist/PlayArtist.yaml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/devices/homie/modules/home-assistant/netdaemon/apps/Spotify/PlayPlaylist/PlayPlaylist.yaml b/devices/homie/modules/home-assistant/netdaemon/apps/Spotify/PlayPlaylist/PlayPlaylist.yaml deleted file mode 100644 index 8b137891..00000000 --- a/devices/homie/modules/home-assistant/netdaemon/apps/Spotify/PlayPlaylist/PlayPlaylist.yaml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/devices/homie/modules/home-assistant/netdaemon/apps/Spotify/PlaySong/PlaySong.yaml b/devices/homie/modules/home-assistant/netdaemon/apps/Spotify/PlaySong/PlaySong.yaml deleted file mode 100644 index 8b137891..00000000 --- a/devices/homie/modules/home-assistant/netdaemon/apps/Spotify/PlaySong/PlaySong.yaml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/devices/homie/modules/home-assistant/netdaemon/package.nix b/devices/homie/modules/home-assistant/netdaemon/package.nix index b1b49565..636a7ea8 100644 --- a/devices/homie/modules/home-assistant/netdaemon/package.nix +++ b/devices/homie/modules/home-assistant/netdaemon/package.nix @@ -1,25 +1,22 @@ { + lib, buildDotnetModule, dotnetCorePackages, }: let + inherit (lib) any hasSuffix; pname = "netdaemon-config"; in buildDotnetModule { inherit pname; version = "0.0.0"; - src = - builtins.filterSource - (file: type: + src = builtins.path { + name = "src"; + path = ./.; + filter = file: type: (type != "directory") - || (builtins.all (f: baseNameOf file != f) [ - ".envrc" - "deps.nix" - "default.nix" - "netdaemon.nix" - "package.nix" - ])) - ./.; + || any (s: hasSuffix s file) [".cs" ".csproj"]; + }; projectFile = "netdaemon.csproj"; nugetDeps = ./deps.nix; diff --git a/devices/homie/modules/home-assistant/netdaemon/program.cs b/devices/homie/modules/home-assistant/netdaemon/program.cs index cbe7a6e3..c6d216e8 100644 --- a/devices/homie/modules/home-assistant/netdaemon/program.cs +++ b/devices/homie/modules/home-assistant/netdaemon/program.cs @@ -14,7 +14,6 @@ using System.Reflection; try { await Host.CreateDefaultBuilder(args) - .UseNetDaemonAppSettings() .UseNetDaemonDefaultLogging() .UseNetDaemonRuntime() .UseNetDaemonTextToSpeech()