# Fix git artifact on NixOS

**URL:** <https://discourse.julialang.org/t/fix-git-artifact-on-nixos/108567>\
**Category:** General Usage\
**Tags:** documenter, git, artifacts, nixos\
**Created:** [January 9, 2024, 2:56pm UTC](https://discourse.julialang.org/t/fix-git-artifact-on-nixos/108567 "2024-01-09T14:56:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![laikq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laikq/32/51949_2.png) [@laikq](https://discourse.julialang.org/u/laikq)\
**Post date:** [January 9, 2024, 2:56pm UTC](https://discourse.julialang.org/t/fix-git-artifact-on-nixos/108567/1 "2024-01-09T14:56:39Z")

</div>

I’m using Documenter on NixOS. When I run `julia --project make.jl`, I get the following error:

```julia-auto
┌ Warning: Unable to determine HTML(edit_link = ...) from remote HEAD branch, defaulting to "master".
│ Calling `git remote` failed with an exception. Set JULIA_DEBUG=Documenter to see the error.
│ Unless this is due to a configuration error, the relevant variable should be set explicitly.
└ @ Documenter ~/.julia/packages/Documenter/1HwWe/src/utilities/utilities.jl:712
…
│ IOError: could not spawn setenv(`/home/laikq/.julia/artifacts/8cb25db9a73519e871cc50d6915f8ab2770096f3/bin/git remote show origin`

```

Obviously, calling `git` fails. This comes as no surprise, since `ldd ~/.julia/artifacts/8cb25db9a73519e871cc50d6915f8ab2770096f3/bin/git` also shows:

```julia-auto
	linux-vdso.so.1 (0x00007ffcc6ff0000)
	libpcre2-8.so.0 => not found
	libz.so.1 => not found
	libiconv.so.2 => not found
	librt.so.1 => /nix/store/ld03l52xq2ssn4x0g5asypsxqls40497-glibc-2.37-8/lib/librt.so.1 (0x00007f76ae37f000)
	libpthread.so.0 => /nix/store/ld03l52xq2ssn4x0g5asypsxqls40497-glibc-2.37-8/lib/libpthread.so.0 (0x00007f76ae37a000)
	libc.so.6 => /nix/store/ld03l52xq2ssn4x0g5asypsxqls40497-glibc-2.37-8/lib/libc.so.6 (0x00007f76ae192000)
	/lib64/ld-linux-x86-64.so.2 => /nix/store/ld03l52xq2ssn4x0g5asypsxqls40497-glibc-2.37-8/lib64/ld-linux-x86-64.so.2 (0x00007f76ae386000)

```

I’m not sure what’s the best way to proceed to get Documenter to use git normally. I know that I can also disable git, but this doesn’t work (or I don’t know how to make it work) for the function `doctest`. Maybe [nix-alien](https://github.com/thiagokokada/nix-alien) or [nix-ld](https://github.com/Mic92/nix-ld) are part of the solution, or [artifact overrides](https://pkgdocs.julialang.org/v1/artifacts/#Overriding-artifact-locations).

---

<div class="post-metadata">

**Author:** ![laikq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laikq/32/51949_2.png) [@laikq](https://discourse.julialang.org/u/laikq)\
**Post date:** [January 9, 2024, 3:09pm UTC](https://discourse.julialang.org/t/fix-git-artifact-on-nixos/108567/2 "2024-01-09T15:09:48Z")

</div>

An ad-hoc solution is adding this to `Overrides.toml`:

```julia
[f8c6e375-362e-5223-8a59-34ff63f689eb]
Git = "/run/current-system/sw"

```

where the UUID is of `Git_jll`.

Hm. It would be nice to have a per-project `Overrides.toml` such that I can use a version of git as specified in `flake.lock`.
