Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easier per-project cachix configuration #14

Open
zimbatm opened this issue May 28, 2018 · 5 comments
Open

Easier per-project cachix configuration #14

zimbatm opened this issue May 28, 2018 · 5 comments

Comments

@zimbatm
Copy link
Contributor

zimbatm commented May 28, 2018

Cater for the following scenario:

$ cd projectA
$ nix-build # this should use the binary cache of projectA
$ cd ../projectB
$ nix-build # this should use the binary cache of projectB

Ideally both projects don't need any configuration and nix-build knows how to use the right binary cache.

Potentially introduce a cachix run -- dispatcher that wraps all the nix CLI tools with the right config.

@domenkozar
Copy link
Member

Relevant: #5

@domenkozar
Copy link
Member

I was thinking something like:

cachix run <name1> <name2> -- nix-build would be a scoped run of the two binary caches. I wonder what are the drawbacks?

@domenkozar
Copy link
Member

Similar use case is hashbang scripts, cachix could provide a binary cache temporary only for the script being ran.

@jezen
Copy link

jezen commented Jul 7, 2018

I was going to open a new issue for this question, but it seems somewhat relevant to this thread.

I manage a few different Haskell projects. Many of the dependencies are shared. Should each project have its own binary cache? Or should I have a general binary cache — like cachix create jezen or something — and use that all the time?

@domenkozar
Copy link
Member

domenkozar commented Oct 14, 2020

What could work is that shell.nix would set something like:

shellHook = ''
  export XDG_CONFIG_HOME = $(pwd);
'';

and then running something like cachix authtoken && cachix use in the shell.

Confirmed by @betaboon that this works! Note that you have to put nix/nix.conf and nix/netrc into .gitignore (or git-encrypt) it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants