nim-sds/nix/shell.nix
Siddarth Kumar 980c830415
nix: set nim cache to proper tmp directory
Otherwise we end up with cache collisions like this in CI :

```
 > Error: cannot open '/tmp/nim/libsds_d/@z..@f..@f..@f..@f..@f..
 @ffgber@f6y2zz1uv2lzi4ln2717py8m0aix64u56-avz-hajenccrq-2.2.4@favz
 @fyvo@fflfgrz@frkprcgvbaf.nim.c'
```
2026-05-26 16:01:55 +05:30

30 lines
472 B
Nix

{
pkgs ? import <nixpkgs> { },
}:
let
inherit (pkgs) lib stdenv;
in pkgs.mkShell {
inputsFrom = [
pkgs.androidShell
];
buildInputs = with pkgs; [
nim-2_2
nimble
which
git
cmake
] ++ lib.optionals stdenv.isDarwin [
pkgs.libiconv
];
# Avoid compiling Nim itself.
# Setting nim cache to proper tmp location avoids cache collision in CI
shellHook = ''
export USE_SYSTEM_NIM=1
export XDG_CACHE_HOME="$TMPDIR"
'';
}