# $200 Bounty: Help me compile custome code using nix-build

**URL:** https://discourse.nixosstag.fcio.net/t/200-bounty-help-me-compile-custome-code-using-nix-build/59489
**Category:** Jobs
**Created:** [January 28, 2025, 4:10pm UTC](https://discourse.nixosstag.fcio.net/t/200-bounty-help-me-compile-custome-code-using-nix-build/59489 "2025-01-28T16:10:09Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![khalid](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/khalid/32/30729_2.png) [@khalid](https://discourse.nixosstag.fcio.net/u/khalid)
#### Post date: [January 28, 2025, 4:10pm UTC](https://discourse.nixosstag.fcio.net/t/200-bounty-help-me-compile-custome-code-using-nix-build/59489/1 "2025-01-28T16:10:09Z")

</div>

## $200 Bounty: Help Compile Custom Code with Nix & SWIG for Valhalla Go Binding

I’m working on creating Go bindings for the Valhalla library ([[GitHub - smartfiy/govalhalla · GitHub](https://github.com/smartfiy/govalhalla.git)]) using SWIG. However, I’m encountering challenges compiling the custom code within my project using Nix-build.

**Goal:**

I need assistance in successfully compiling the custom code in the `govalhalla.git` repository and integrating it with SWIG to generate Go bindings.

**Requirements:**

- Experience with Nix-build and its capabilities for building Go projects.
- Familiarity with SWIG and its integration with Go for generating bindings.
- Ability to troubleshoot potential issues related to dependencies, build environments, and SWIG configuration.

**Offer:**

I’m offering a **$200 bounty** for a solution that helps me achieve the following:

- Compile the custom code in the `govalhalla.git` repository using Nix-build.
- Set up SWIG to generate Go bindings for the Valhalla library based on the compiled code.
- Provide clear instructions and guidance on the process, including any necessary code snippets or configuration files.

**Additional Information:**

- I’ve attempted to compile the code using `nix-build` (briefly describe your attempts if any).

**Please respond if you have the expertise to assist me with this task. I’m eager to collaborate and complete the Valhalla Go binding project.**

---

<div class="post-metadata">

### Author: ![baduhai](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/baduhai/32/7621_2.png) [@baduhai](https://discourse.nixosstag.fcio.net/u/baduhai)
#### Post date: [January 28, 2025, 8:11pm UTC](https://discourse.nixosstag.fcio.net/t/200-bounty-help-me-compile-custome-code-using-nix-build/59489/2 "2025-01-28T20:11:00Z")

</div>

I’m nearly done with this, I just need to compile the test code. What I’ve done so far and how I got there:

1. Valhalla itself wasn’t building. For this, I added a few missing buildInputs and flags to get it to compile version 3.5.1 properly. See the diff [here](https://github.com/smartfiy/govalhalla/pull/1/files#diff-c39c2867eaae4cd1f4cc58e8c753e7baf90c6383ee07ff730b9d0fc92b604be1). Most of my work was actually copied from [valhalla-go](https://github.com/BTBurke/valhalla-go/blob/c279eb6c63df428639b763c6fa8e190ce7ffcc75/bindings/valhalla/default.nix#L22), funnily enough, another go binding for valhalla.
2. Once valhalla built successfully, it was just a matter of fixing the default.nix for govalhalla, and the default.nix that defines the nixpkgs version, which was as simple as adding the new dependencies to the files. See the relevant diffs [here](https://github.com/smartfiy/govalhalla/pull/1/files#diff-08821313f9a73f72f9ed395fe8b8ccbd86e6180224e8f34279eaab4ec3787cba) and [here](https://github.com/smartfiy/govalhalla/pull/1/files#diff-46860dbb9ef5ce3cb48d620aa529e8e31dbcdff4335ce1de315067049f24c4fd).

Now I’d like to know how to proceed with the test compilation. Do you want a derivation for it, or are you fine with a shell.nix and compiling it manually? I ask because I see a shell.nix in your .gitignore, so I figure that’s what your using.

PS. You could really use a flake.

---

<div class="post-metadata">

### Author: ![khalid](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/khalid/32/30729_2.png) [@khalid](https://discourse.nixosstag.fcio.net/u/khalid)
#### Post date: [January 28, 2025, 8:16pm UTC](https://discourse.nixosstag.fcio.net/t/200-bounty-help-me-compile-custome-code-using-nix-build/59489/3 "2025-01-28T20:16:37Z")

</div>

I can barely work with nix, flakes will be overkill for me in this stage 🙂 😅

---

<div class="post-metadata">

### Author: ![khalid](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/khalid/32/30729_2.png) [@khalid](https://discourse.nixosstag.fcio.net/u/khalid)
#### Post date: [January 28, 2025, 8:17pm UTC](https://discourse.nixosstag.fcio.net/t/200-bounty-help-me-compile-custome-code-using-nix-build/59489/4 "2025-01-28T20:17:47Z")

</div>

One more thing not sure if you saw my GitHub msg about dependency and dynamic linking

---

<div class="post-metadata">

### Author: ![khalid](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/khalid/32/30729_2.png) [@khalid](https://discourse.nixosstag.fcio.net/u/khalid)
#### Post date: [January 28, 2025, 8:20pm UTC](https://discourse.nixosstag.fcio.net/t/200-bounty-help-me-compile-custome-code-using-nix-build/59489/5 "2025-01-28T20:20:18Z")

</div>

libspatialite,  
luajit,  
prime-server,  
protobuf,  
python3,  
sqlite,  
Actually those are needed for services and admin which are not needed for this scenario

---

<div class="post-metadata">

### Author: ![cognivore](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/cognivore/32/7641_2.png) [@cognivore](https://discourse.nixosstag.fcio.net/u/cognivore)
#### Post date: [January 29, 2025, 1:58pm UTC](https://discourse.nixosstag.fcio.net/t/200-bounty-help-me-compile-custome-code-using-nix-build/59489/6 "2025-01-29T13:58:52Z")

</div>

Flakes reduce the surface of stuff you need to learn rather than increase.

Just learn how they are evaluated and you’ll be all good.

---

<div class="post-metadata">

### Author: ![DocBrown101](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/docbrown101/32/28295_2.png) [@DocBrown101](https://discourse.nixosstag.fcio.net/u/DocBrown101)
#### Post date: [January 29, 2025, 2:35pm UTC](https://discourse.nixosstag.fcio.net/t/200-bounty-help-me-compile-custome-code-using-nix-build/59489/7 "2025-01-29T14:35:25Z")

</div>

I cannot agree with that. Flakes have much more boilerplate code.

---

<div class="post-metadata">

### Author: ![khalid](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/khalid/32/30729_2.png) [@khalid](https://discourse.nixosstag.fcio.net/u/khalid)
#### Post date: [January 31, 2025, 8:27am UTC](https://discourse.nixosstag.fcio.net/t/200-bounty-help-me-compile-custome-code-using-nix-build/59489/9 "2025-01-31T08:27:31Z")

</div>

thanks all, bounty was awarded to @baduhai. thanks for the great work
