Building packages on nix can be annoying.
We want it to be as easy as possible for nim users and nixos users/maintainers.
The current implementation in nixpkgs relies on a custom lock file.
But packages are more likely to have an existing nimble.lock,
making maintaining or generating a second lock file just for nix somewhat tedious.
There are currently two options for generating this lock.json:
- Using the recommended nim_lk which attempts dependency resolution to generate the lock file
- nnl which performs no dependency resolution and simply converts a
nimble.lockfile (or generates one if necessary) to the equivalentnim_lkoutput
nim2nix forgoes buildNimPackage for two custom builders, empowered by native tooling.
nim2nix provides two builders: buildNimblePackage and buildAtlasPackage:
Both of which work essentially the same by using their associated package manager to download and wire up deps.
NOTE: nim2nix uses a patched nimble to prevent it from compiling any dependencies
buildNimblePackage {
src = fetchFromGitHub {
...
};
# nimbleLockFile = ./nimble.lock;
nimbleDepsHash = "<sha256>";
}see example;
buildAtlasPackage {
src = fetchFromGitHub {
...
};
# atlasLockFile = ./atlas.lock;
atlasDepsHash = "<sha256>";
}see example;