about summary refs log tree commit diff
path: root/pkgs/by-name/ni/nim_lk/package.nix
blob: 184d1e27745ad61a91bf347b6ae71768a3af2618 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{
  lib,
  buildNimPackage,
  fetchFromSourcehut,
  nim,
  nix-prefetch,
  nix-prefetch-git,
  openssl,
  makeWrapper,
}:

let
  nim' = nim.passthru.nim;
in
buildNimPackage (finalAttrs: {
  pname = "nim_lk";
  version = "20240510";

  src = fetchFromSourcehut {
    owner = "~ehmry";
    repo = "nim_lk";
    rev = finalAttrs.version;
    hash = "sha256-fwoGyYkbGstWG0qw15dOq1gmr3GyIn6ZEBeBmEivHlA=";
  };

  lockFile = ./lock.json;

  buildInputs = [ openssl ];
  nativeBuildInputs = [ makeWrapper ];

  nimFlags = [ "--path:${nim'}/nim" ];

  postFixup = ''
    wrapProgram $out/bin/nim_lk \
      --suffix PATH : ${
        lib.makeBinPath [
          nim'
          nix-prefetch
          nix-prefetch-git
        ]
      }
  '';

  meta = finalAttrs.src.meta // {
    description = "Generate Nix specific lock files for Nim packages";
    homepage = "https://git.sr.ht/~ehmry/nim_lk";
    mainProgram = "nim_lk";
    license = lib.licenses.bsd3;
    platforms = lib.platforms.unix;
    maintainers = with lib.maintainers; [ ehmry ];
  };
})