2024-10-05 12:38:13 -04:00
|
|
|
{
|
2024-10-10 13:11:11 -04:00
|
|
|
lib,
|
2024-10-05 12:38:13 -04:00
|
|
|
buildDotnetModule,
|
|
|
|
dotnetCorePackages,
|
2024-10-05 17:04:57 -04:00
|
|
|
}: let
|
2024-10-10 13:11:11 -04:00
|
|
|
inherit (lib) any hasInfix hasSuffix removeSuffix;
|
|
|
|
|
|
|
|
srcDirs = ["apps"];
|
2024-10-21 02:48:43 -04:00
|
|
|
srcPatterns = [".cs" ".csproj" ".json" ".version" "HomeAssistantGenerated"];
|
2024-10-10 13:11:11 -04:00
|
|
|
|
2024-10-05 12:38:13 -04:00
|
|
|
pname = "netdaemon-config";
|
2024-10-05 17:04:57 -04:00
|
|
|
in
|
|
|
|
buildDotnetModule {
|
|
|
|
inherit pname;
|
2024-10-10 13:11:11 -04:00
|
|
|
version = removeSuffix "\n" (builtins.readFile ./.version);
|
2024-10-05 12:38:13 -04:00
|
|
|
|
2024-10-10 13:11:11 -04:00
|
|
|
src = builtins.path {
|
|
|
|
name = "netdaemon-src";
|
|
|
|
path = ./.;
|
|
|
|
filter = file: type:
|
|
|
|
(type == "directory" && any (s: hasInfix s file) srcDirs)
|
|
|
|
|| any (s: hasSuffix s file) srcPatterns;
|
|
|
|
};
|
2024-10-05 12:38:13 -04:00
|
|
|
|
2024-10-21 02:48:43 -04:00
|
|
|
preBuild = ''
|
|
|
|
mv HomeAssistantGenerated HomeAssistantGenerated.cs
|
|
|
|
'';
|
|
|
|
|
2024-10-05 17:04:57 -04:00
|
|
|
projectFile = "netdaemon.csproj";
|
2024-12-22 17:04:02 -05:00
|
|
|
nugetDeps = ./deps.json;
|
2024-10-05 12:38:13 -04:00
|
|
|
|
2024-12-11 16:32:30 -05:00
|
|
|
dotnet-sdk = dotnetCorePackages.sdk_9_0;
|
|
|
|
dotnet-runtime = dotnetCorePackages.runtime_9_0;
|
2024-10-05 17:04:57 -04:00
|
|
|
executables = [];
|
|
|
|
|
|
|
|
postFixup = ''
|
2024-10-21 02:48:43 -04:00
|
|
|
cp -r $out/lib/${pname} $netdaemonConfig
|
2024-10-05 17:04:57 -04:00
|
|
|
'';
|
|
|
|
|
2024-10-21 02:48:43 -04:00
|
|
|
outputs = ["out" "netdaemonConfig"];
|
2024-10-05 17:04:57 -04:00
|
|
|
}
|