2024-01-02 11:29:13 +00:00
|
|
|
{ lib
|
|
|
|
, buildNimPackage
|
|
|
|
, fetchFromSourcehut
|
|
|
|
, nim
|
|
|
|
, nix-prefetch
|
|
|
|
, nix-prefetch-git
|
|
|
|
, openssl
|
|
|
|
, makeWrapper
|
|
|
|
}:
|
2023-11-16 04:20:00 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
let nim' = nim.passthru.nim;
|
|
|
|
in buildNimPackage (finalAttrs: {
|
2023-11-16 04:20:00 +00:00
|
|
|
pname = "nim_lk";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "20240210";
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
src = fetchFromSourcehut {
|
|
|
|
owner = "~ehmry";
|
|
|
|
repo = "nim_lk";
|
|
|
|
rev = finalAttrs.version;
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-LLOf8HNee0Mol+e7/dvu9hQUCmpaVBNggTxaAl/wV6Y=";
|
2023-11-16 04:20:00 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
lockFile = ./lock.json;
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
buildInputs = [ openssl ];
|
2024-01-02 11:29:13 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2023-11-16 04:20:00 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
nimFlags = [ "--path:${nim'}/nim" ];
|
2024-01-02 11:29:13 +00:00
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
wrapProgram $out/bin/nim_lk \
|
2024-04-21 15:54:59 +00:00
|
|
|
--suffix PATH : ${lib.makeBinPath [ nim' nix-prefetch nix-prefetch-git ]}
|
2024-01-02 11:29:13 +00:00
|
|
|
'';
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
})
|