2022-11-27 09:42:12 +00:00
|
|
|
{ lib
|
2024-06-05 15:53:02 +00:00
|
|
|
, stdenv
|
2024-07-27 06:49:29 +00:00
|
|
|
, buildGoModule
|
2022-11-27 09:42:12 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchNpmDeps
|
|
|
|
, cacert
|
|
|
|
, git
|
2024-07-27 06:49:29 +00:00
|
|
|
, go
|
2022-11-27 09:42:12 +00:00
|
|
|
, enumer
|
|
|
|
, mockgen
|
|
|
|
, nodejs
|
|
|
|
, npmHooks
|
|
|
|
, nix-update-script
|
|
|
|
, nixosTests
|
|
|
|
}:
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
buildGoModule rec {
|
2022-11-27 09:42:12 +00:00
|
|
|
pname = "evcc";
|
2024-07-31 10:19:44 +00:00
|
|
|
version = "0.129.0";
|
2022-11-27 09:42:12 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "evcc-io";
|
2024-01-13 08:15:51 +00:00
|
|
|
repo = "evcc";
|
2022-11-27 09:42:12 +00:00
|
|
|
rev = version;
|
2024-07-31 10:19:44 +00:00
|
|
|
hash = "sha256-LoDY6mVV2iDWUo1fUPrOjTTaQudkxrBTkCeIGQWSN8M=";
|
2022-11-27 09:42:12 +00:00
|
|
|
};
|
|
|
|
|
2024-07-31 10:19:44 +00:00
|
|
|
vendorHash = "sha256-AY1MXFgd6dK1w36iV0vur7ACGn5FTfPICEHXCnRfcb8=";
|
2022-11-27 09:42:12 +00:00
|
|
|
|
|
|
|
npmDeps = fetchNpmDeps {
|
|
|
|
inherit src;
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-XG9nefBefF2gdDWA9IYBI2dv6Lig2LqGgOnTjyni0fM=";
|
2022-11-27 09:42:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
nodejs
|
|
|
|
npmHooks.npmConfigHook
|
|
|
|
];
|
|
|
|
|
|
|
|
overrideModAttrs = _: {
|
|
|
|
nativeBuildInputs = [
|
|
|
|
enumer
|
|
|
|
go
|
|
|
|
git
|
|
|
|
cacert
|
|
|
|
mockgen
|
|
|
|
];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
make assets
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
tags = [
|
|
|
|
"release"
|
2023-04-29 16:46:19 +00:00
|
|
|
"test"
|
2022-11-27 09:42:12 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-X github.com/evcc-io/evcc/server.Version=${version}"
|
|
|
|
"-X github.com/evcc-io/evcc/server.Commit=${src.rev}"
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
make ui
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
doCheck = !stdenv.isDarwin; # darwin sandbox limitations around network access, access to /etc/protocols and likely more
|
2022-11-27 09:42:12 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
checkFlags = let
|
|
|
|
skippedTests = [
|
|
|
|
# network access
|
|
|
|
"TestOctopusConfigParse"
|
2024-07-27 06:49:29 +00:00
|
|
|
"TestTemplates/ac-elwa-2"
|
2024-06-05 15:53:02 +00:00
|
|
|
"TestTemplates/allinpower"
|
|
|
|
"TestTemplates/electricitymaps"
|
|
|
|
"TestTemplates/elering"
|
|
|
|
"TestTemplates/energinet"
|
|
|
|
"TestTemplates/grünstromindex"
|
2024-07-31 10:19:44 +00:00
|
|
|
"TestTemplates/keba-modbus"
|
2024-06-05 15:53:02 +00:00
|
|
|
"TestTemplates/pun"
|
|
|
|
"TestTemplates/entsoe"
|
|
|
|
"TestTemplates/ngeso"
|
|
|
|
"TestTemplates/tibber"
|
|
|
|
"TestTemplates/groupe-e"
|
|
|
|
"TestTemplates/awattar"
|
|
|
|
"TestTemplates/energy-charts-api"
|
|
|
|
"TestTemplates/polestar"
|
|
|
|
"TestTemplates/sma-inverter-speedwire/battery"
|
|
|
|
"TestTemplates/sma-inverter-speedwire/pv"
|
|
|
|
"TestTemplates/smartenergy"
|
|
|
|
"TestTemplates/tibber-pulse/grid"
|
|
|
|
|
|
|
|
];
|
|
|
|
in
|
|
|
|
[ "-skip=^${lib.concatStringsSep "$|^" skippedTests}$" ];
|
2022-11-27 09:42:12 +00:00
|
|
|
|
|
|
|
passthru = {
|
|
|
|
tests = {
|
|
|
|
inherit (nixosTests) evcc;
|
|
|
|
};
|
2022-12-28 21:21:41 +00:00
|
|
|
updateScript = nix-update-script { };
|
2022-11-27 09:42:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "EV Charge Controller";
|
|
|
|
homepage = "https://evcc.io";
|
2023-11-16 04:20:00 +00:00
|
|
|
changelog = "https://github.com/evcc-io/evcc/releases/tag/${version}";
|
2022-11-27 09:42:12 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ hexa ];
|
|
|
|
};
|
|
|
|
}
|