jlesquembre / clj-nix

Nix helpers for Clojure projects
https://jlesquembre.github.io/clj-nix/
Eclipse Public License 2.0
139 stars 20 forks source link

Should document that for --lein you need LEIN_HOME directory #64

Open JonathanLorimer opened 1 year ago

JonathanLorimer commented 1 year ago

I am creating a deps lock file via a nix derivation, and since it is sand-boxed LEIN_HOME is not defined.

jlesquembre commented 1 year ago

Do you mean you are running the deps-lock CLI in a nix build? That isn't supported, since we need network access to generate the lock file.

JonathanLorimer commented 1 year ago

You can run it in a nix build via fixed output derivations!

jlesquembre commented 1 year ago

You can run it in a nix build via fixed output derivations!

good point, never though about it.

I wonder if we could use that trick to include clj-nix packages on nixpkgs :thinking:

JonathanLorimer commented 1 year ago

You can run it in a nix build via fixed output derivations!

good point, never though about it.

I wonder if we could use that trick to include clj-nix packages on nixpkgs thinking

We definitely could!

jlesquembre commented 1 year ago

I really like how you are generating the lock file in a derivation:

https://github.com/JonathanLorimer/maelstrom.nix/blob/a45550468f66e776d250f6e88ae000d17da306a9/flake.nix#L27-L46

With it, if I upstream clj-nix to nixpkgs, we don't need to commit the lock files, while at the same time we can share the input dependencies between different derivations