2022-11-27 09:42:12 +00:00
|
|
|
{ lib
|
2023-10-09 19:29:22 +00:00
|
|
|
, buildGo121Module
|
2022-11-27 09:42:12 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchNpmDeps
|
|
|
|
, cacert
|
|
|
|
, go
|
|
|
|
, git
|
|
|
|
, enumer
|
|
|
|
, mockgen
|
|
|
|
, nodejs
|
|
|
|
, npmHooks
|
|
|
|
, nix-update-script
|
|
|
|
, nixosTests
|
|
|
|
, stdenv
|
|
|
|
}:
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
buildGo121Module rec {
|
2022-11-27 09:42:12 +00:00
|
|
|
pname = "evcc";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "0.120.3";
|
2022-11-27 09:42:12 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "evcc-io";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-FYjDuGIsdGhPXOdYMQuoMp6L4MH70fpOymqw4+bu5hc=";
|
2022-11-27 09:42:12 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
vendorHash = "sha256-LNMNqlb/aj+ZHuwMvtK//oWyi34mm47ShAAD427szS4=";
|
2022-11-27 09:42:12 +00:00
|
|
|
|
|
|
|
npmDeps = fetchNpmDeps {
|
|
|
|
inherit src;
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-quznAvgAFJJnKabsFZxAu7yDkAuvujg6of6En8JaFs4=";
|
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
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = !stdenv.isDarwin; # tries to bind to local network, doesn't work in darwin sandbox
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
# requires network access
|
|
|
|
rm meter/template_test.go
|
2023-04-12 12:48:02 +00:00
|
|
|
rm charger/template_test.go
|
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";
|
|
|
|
changelog = "https://github.com/andig/evcc/releases/tag/${version}";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ hexa ];
|
|
|
|
};
|
|
|
|
}
|