# NixOS, Bazel and CLion (/other IDE)

**URL:** https://discourse.nixos.org/t/nixos-bazel-and-clion-other-ide/1288
**Category:** Help
**Created:** [October 28, 2018, 7:39am UTC](https://discourse.nixos.org/t/nixos-bazel-and-clion-other-ide/1288 "2018-10-28T07:39:42Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![zimbatm](https://discourse.nixos.org/user_avatar/discourse.nixos.org/zimbatm/32/4_2.png) [@zimbatm](https://discourse.nixos.org/u/zimbatm)
#### Post date: [October 28, 2018, 11:05am UTC](https://discourse.nixos.org/t/nixos-bazel-and-clion-other-ide/1288/2 "2018-10-28T11:05:13Z")

</div>

Hi, welcome!

Tweag has built [GitHub - tweag/rules\_nixpkgs: Rules for importing Nixpkgs packages into Bazel.](https://github.com/tweag/rules_nixpkgs) which allows Bazel to pull in nixpkgs dependencies. It has mainly been developer to support [GitHub - tweag/rules\_haskell: Haskell rules for Bazel.](https://github.com/tweag/rules_haskell) as they needed a way to pull in the GHC compiler but it should work with other Bazel plugins. In that scenario Bazel is directing the build.

Another approach would be to build a profile or shell.nix and first load the external dependencies using nix. One of the advantages with that approach is that the Bazel version can be controlled precisely. And CLion or another editor be brought in as well using that method. In that case the developer would first run a command to load the nix environment before invoking Bazel.

Regarding Windows support, this is still a challenge. If the need is to provide a developer experience then WSL is pretty good. But it doesn’t help if Windows executables need to be generated. In that case cross-compilation might save the day and both might be combined. See:

> [@Nix on Windows?](https://discourse.nixos.org/t/nix-on-windows/1113):
>
> Is anyone trying to port nix and nixpkgs to output native Windows PE executables? I would like to avoid cross-compilation and cygwin if possible to get something as close as native as possible. I talked a bit with @edolstra and he said the following things: it is (was) possible to build non-cygwin binaries, e.g. [\* A Hello World GUI application compiled with VC++. · NixOS/nixpkgs@08d3840 · GitHub](https://github.com/NixOS/nixpkgs/commit/08d3840c94aa4016cdab441751ac78692dc600e2) we used to have Visual C++ in Nixpkgs probably nowadays we would want to use WSL instead of Cygw…

---

_[View the full topic](https://discourse.nixos.org/t/nixos-bazel-and-clion-other-ide/1288)._
