nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 fetchFromGitHub,
4 buildNimPackage,
5}:
6
7buildNimPackage (finalAttrs: {
8 pname = "nph";
9 version = "0.6.2";
10
11 postPatch = ''
12 substituteInPlace src/nph.nim \
13 --replace-fail 'git describe --long --dirty --always --tags' "echo ${finalAttrs.version}"
14 '';
15
16 src = fetchFromGitHub {
17 owner = "arnetheduck";
18 repo = "nph";
19 tag = "v${finalAttrs.version}";
20 hash = "sha256-rO6nEdW36CoQF30VP+zR+Osw2AuBmkXC+ugPrhDvH4o=";
21 };
22
23 lockFile = ./lock.json;
24
25 checkPhase = ''
26 runHook preCheck
27
28 $out/bin/nph tests/before
29 diff tests/before tests/after -x "*.yaml"
30
31 runHook postCheck
32 '';
33
34 meta = {
35 description = "Opinionated code formatter for Nim";
36 homepage = "https://github.com/arnetheduck/nph";
37 license = lib.licenses.mit;
38 maintainers = with lib.maintainers; [ sigmanificient ];
39 mainProgram = "nph";
40 };
41})