Files
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

59 lines
1.6 KiB
Nix

{
buildRebar3,
fetchFromGitHub,
fetchHex,
fetchgit,
lib,
rebar3Relx,
writeScript,
}:
rebar3Relx rec {
releaseType = "escript";
pname = "elvis-erlang";
version = "4.1.1";
src = fetchFromGitHub {
owner = "inaka";
repo = "elvis";
hash = "sha256-9aOJpKYb+M07bi6aEMt5Gtr/edOGm+jyA8bxiLyUd0g=";
tag = version;
};
beamDeps = builtins.attrValues (
import ./rebar-deps.nix {
inherit fetchHex fetchgit fetchFromGitHub;
builder = buildRebar3;
}
);
passthru.updateScript = writeScript "update.sh" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p bash common-updater-scripts git nix-prefetch-git gnutar gzip "rebar3WithPlugins {globalPlugins = [beamPackages.rebar3-nix];}"
set -euo pipefail
latest=$(list-git-tags | sort -V | tail -1)
if [ "$latest" != "${version}" ]; then
nixpkgs="$(git rev-parse --show-toplevel)"
nix_path="$nixpkgs/pkgs/development/beam-modules/elvis-erlang"
update-source-version elvis-erlang "$latest" --version-key=version --print-changes --file="$nix_path/default.nix"
tmpdir=$(mktemp -d)
cp -R $(nix-build $nixpkgs --no-out-link -A elvis-erlang.src)/* "$tmpdir"
(cd "$tmpdir" && HOME=. rebar3 nix lock -o "$nix_path/rebar-deps.nix")
nixfmt "$nix_path/rebar-deps.nix"
else
echo "elvis-erlang is already up-to-date"
fi
'';
meta = {
homepage = "https://github.com/inaka/elvis";
description = "Erlang Style Reviewer";
platforms = lib.platforms.unix;
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ dlesl ];
mainProgram = "elvis";
};
}