rules_nixpkgs icon indicating copy to clipboard operation
rules_nixpkgs copied to clipboard

Do not require global nix installation

Open Profpatsch opened this issue 6 years ago • 6 comments

Based on the discussion in https://github.com/tweag/rules_nixpkgs/issues/54, we should enable rules_nixpkgs to use a local installation of nix that is bound to the bazel workspace somehow.

Other relevant issues: https://github.com/NixOS/nix/issues/1973, https://github.com/bazelbuild/bazel/issues/6994

Profpatsch avatar Mar 11 '19 11:03 Profpatsch

What makes this hard?

For my use case, all I want to use nix for is to pull in the pg_dump binary from postgresql. This binary is needed by a Go library that dumps the schema of a database.

reddaly avatar Oct 12 '22 01:10 reddaly

Hello! Someone shared a contribution to clodl (https://github.com/tweag/clodl/pull/48) to make it work with a non-global nix installation.

I don't have much of an opinion on how it should be implemented, but as a user of rules_nixpgs I would prefer for it to be handled upstream (I'm the typical user, aren't I? :stuck_out_tongue:).

If you have a clue, your input would be welcome. Is this something possible and desirable to do in rules_nixpkgs?

facundominguez avatar Apr 15 '24 14:04 facundominguez

I've added a comment to the clodl PR https://github.com/tweag/clodl/pull/48#issuecomment-2059088567

aherrmann avatar Apr 16 '24 13:04 aherrmann

Hello! Someone shared a contribution to clodl (tweag/clodl#48) to make it work with a non-global nix installation.

Hi. I'm that someone. :)

This now seems to work on Linux and does not seem too onerous, see https://github.com/tweag/clodl/pull/48#issuecomment-2060368436 for details. While the contribution is for clodl this should work on any other project that uses rules_nixpkgs.

Sorry folks, mac is not supported, because nix-portable, which is the main workhorse, doesn't seem to support mac. And that showstopper may be hiding more issues.

Do give it a test drive on Linux if so inclined. It's not overly user-friendly at the moment, so I ask for your patience if you do decide to try it. There are some rough edges that I am aware of, but do send your findings.

filmil avatar Apr 17 '24 05:04 filmil