mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
108 lines
1.9 KiB
Nix
108 lines
1.9 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
buildGo126Module,
|
|
fetchFromGitHub,
|
|
fetchNpmDeps,
|
|
cacert,
|
|
git,
|
|
go_1_26,
|
|
gokrazy,
|
|
enumer,
|
|
mockgen,
|
|
nodejs,
|
|
npmHooks,
|
|
nix-update-script,
|
|
nixosTests,
|
|
}:
|
|
|
|
let
|
|
version = "0.308.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "evcc-io";
|
|
repo = "evcc";
|
|
tag = version;
|
|
hash = "sha256-MsNDWTv6CDQfQMA9miImvGkQeJnsh6/zYtAcQJjHaF4=";
|
|
};
|
|
|
|
vendorHash = "sha256-UI1WyTDJA5GRgt8TmpMQi4DmYzfQFGhDd5WeitT8VnI=";
|
|
|
|
commonMeta = {
|
|
license = lib.licenses.mit;
|
|
maintainers = with lib.maintainers; [ hexa ];
|
|
};
|
|
in
|
|
|
|
buildGo126Module rec {
|
|
pname = "evcc";
|
|
inherit version src vendorHash;
|
|
|
|
npmDeps = fetchNpmDeps {
|
|
inherit src;
|
|
hash = "sha256-ypBg2TQ3qbc8cIBfFqICbNSCsIdokOtaFOqFD9bnMQM=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
nodejs
|
|
npmHooks.npmConfigHook
|
|
];
|
|
|
|
overrideModAttrs = _: {
|
|
nativeBuildInputs = [
|
|
enumer
|
|
go_1_26
|
|
gokrazy
|
|
git
|
|
cacert
|
|
mockgen
|
|
];
|
|
|
|
preBuild = ''
|
|
GOFLAGS="-mod=mod" make assets
|
|
'';
|
|
};
|
|
|
|
tags = [
|
|
"release"
|
|
"test"
|
|
];
|
|
|
|
ldflags = [
|
|
"-X github.com/evcc-io/evcc/util.Version=${version}"
|
|
"-s"
|
|
"-w"
|
|
];
|
|
|
|
preBuild = ''
|
|
make ui
|
|
'';
|
|
|
|
doCheck = !stdenv.hostPlatform.isDarwin; # darwin sandbox limitations around network access, access to /etc/protocols and likely more
|
|
|
|
checkFlags =
|
|
let
|
|
skippedTests = [
|
|
# network access
|
|
"TestOcpp"
|
|
"TestOctopusConfigParse"
|
|
"TestSessionHandlerTimezoneFilter"
|
|
"TestTemplates"
|
|
];
|
|
in
|
|
[ "-skip=^${lib.concatStringsSep "$|^" skippedTests}$" ];
|
|
|
|
passthru = {
|
|
tests = {
|
|
inherit (nixosTests) evcc;
|
|
};
|
|
updateScript = nix-update-script { };
|
|
};
|
|
|
|
meta = commonMeta // {
|
|
description = "EV Charge Controller";
|
|
homepage = "https://evcc.io";
|
|
changelog = "https://github.com/evcc-io/evcc/releases/tag/${version}";
|
|
mainProgram = "evcc";
|
|
};
|
|
}
|