Files
nixpkgs/pkgs/by-name/ev/evcc/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

123 lines
2.2 KiB
Nix

{
lib,
stdenv,
buildGo125Module,
fetchFromGitHub,
fetchNpmDeps,
cacert,
git,
go_1_25,
gokrazy,
enumer,
mockgen,
nodejs,
npmHooks,
nix-update-script,
nixosTests,
}:
let
version = "0.209.1";
src = fetchFromGitHub {
owner = "evcc-io";
repo = "evcc";
tag = version;
hash = "sha256-cIUc7+mQy9Q+monXOXO6tBmwwAjF+HLgbfo3VnJT9Dk=";
};
vendorHash = "sha256-Is6hv2nkTQhugSj+CqcTiwAPvIBtNNAvWZLLWm0jU/8=";
commonMeta = with lib; {
license = licenses.mit;
maintainers = with maintainers; [ hexa ];
};
decorate = buildGo125Module {
pname = "evcc-decorate";
inherit version src vendorHash;
subPackages = "cmd/decorate";
meta = commonMeta // {
description = "EVCC decorate helper";
homepage = "https://github.com/evcc-io/evcc/tree/master/cmd/decorate";
};
};
in
buildGo125Module rec {
pname = "evcc";
inherit version src vendorHash;
npmDeps = fetchNpmDeps {
inherit src;
hash = "sha256-0pjYFgF4PqWibIQvklZx116V+uDg+MIC7hmQxlCKSvc=";
};
nativeBuildInputs = [
nodejs
npmHooks.npmConfigHook
];
overrideModAttrs = _: {
nativeBuildInputs = [
decorate
enumer
go_1_25
gokrazy
git
cacert
mockgen
];
preBuild = ''
make assets
'';
};
tags = [
"release"
"test"
];
ldflags = [
"-X github.com/evcc-io/evcc/util.Version=${version}"
"-X github.com/evcc-io/evcc/util.Commit=${src.tag}"
"-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
"TestOctopusConfigParse"
"TestTemplates"
"TestOcpp"
];
in
[ "-skip=^${lib.concatStringsSep "$|^" skippedTests}$" ];
passthru = {
inherit decorate;
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";
};
}