2022-11-27 09:42:12 +00:00
|
|
|
{ lib
|
2024-02-29 20:09:43 +00:00
|
|
|
, buildGo122Module
|
2022-11-27 09:42:12 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchNpmDeps
|
|
|
|
, cacert
|
2024-02-29 20:09:43 +00:00
|
|
|
, go_1_22
|
2022-11-27 09:42:12 +00:00
|
|
|
, git
|
|
|
|
, enumer
|
|
|
|
, mockgen
|
|
|
|
, nodejs
|
|
|
|
, npmHooks
|
|
|
|
, nix-update-script
|
|
|
|
, nixosTests
|
|
|
|
, stdenv
|
|
|
|
}:
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
let
|
|
|
|
buildGoModule = buildGo122Module;
|
|
|
|
go = go_1_22;
|
|
|
|
in
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
buildGoModule rec {
|
2022-11-27 09:42:12 +00:00
|
|
|
pname = "evcc";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.124.10";
|
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-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-NbM8Uev2qIIS6WriP7QnVUumF29rZSOCavouPkPmYpE=";
|
2022-11-27 09:42:12 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
vendorHash = "sha256-PZWMqv3R4Dq4cLtGNuvHCQ/GiYvlKJfSKEmBn0JYnb8=";
|
2022-11-27 09:42:12 +00:00
|
|
|
|
|
|
|
npmDeps = fetchNpmDeps {
|
|
|
|
inherit src;
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-FWnRZ/NI49QZj8Uv6IbHc8IPAh3F5u4S6hY64B8+Uvk=";
|
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";
|
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 ];
|
|
|
|
};
|
|
|
|
}
|