2022-11-27 09:42:12 +00:00
|
|
|
{ lib
|
2024-06-05 15:53:02 +00:00
|
|
|
, stdenv
|
2024-09-19 14:19:46 +00:00
|
|
|
, buildGo123Module
|
2022-11-27 09:42:12 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchNpmDeps
|
|
|
|
, cacert
|
|
|
|
, git
|
2024-09-19 14:19:46 +00:00
|
|
|
, go_1_23
|
2022-11-27 09:42:12 +00:00
|
|
|
, enumer
|
|
|
|
, mockgen
|
|
|
|
, nodejs
|
|
|
|
, npmHooks
|
|
|
|
, nix-update-script
|
|
|
|
, nixosTests
|
|
|
|
}:
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
buildGo123Module rec {
|
2022-11-27 09:42:12 +00:00
|
|
|
pname = "evcc";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "0.130.9";
|
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-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-g3z2yqw/84OMui5mchfqVHoR/6LdwNHgeBodf1jUtj4=";
|
2022-11-27 09:42:12 +00:00
|
|
|
};
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
vendorHash = "sha256-C2eoNmv0GSi5DV53aUwGcBOw6n2btU/HhniMyu21vLE=";
|
2022-11-27 09:42:12 +00:00
|
|
|
|
|
|
|
npmDeps = fetchNpmDeps {
|
|
|
|
inherit src;
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-60F6j87T77JEt3ej4FVTc8rnnpZSGzomrQp8VPWjv6Q=";
|
2022-11-27 09:42:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
nodejs
|
|
|
|
npmHooks.npmConfigHook
|
|
|
|
];
|
|
|
|
|
|
|
|
overrideModAttrs = _: {
|
|
|
|
nativeBuildInputs = [
|
|
|
|
enumer
|
2024-09-19 14:19:46 +00:00
|
|
|
go_1_23
|
2022-11-27 09:42:12 +00:00
|
|
|
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-09-19 14:19:46 +00:00
|
|
|
"TestTemplates"
|
2024-06-05 15:53:02 +00:00
|
|
|
];
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|