[Nix-dev] SSH-keys in fetchgit

Shea Levy shea at shealevy.com
Tue Jul 15 17:39:36 CEST 2014


See the fetchgitPrivate function:

https://github.com/NixOS/nixpkgs/blob/a4cf5e903b7782062d62489b23fa5021d1ac0862/pkgs/top-level/all-packages.nix#L308-L326

On Tue, Jul 15, 2014 at 12:09:22PM +0200, Andreas Herrmann wrote:
> Dear Nix-ers,
> 
> I am using Nix to manage and deploy my own work projects, which do depend
> on each other. These projects, however, are not open source, so their
> sources are not publicly available on the internet.
> 
> I was wondering if it was possible in some way to configure Nix (or
> fetchgit) to use ssh keys when fetching sources from non-public
> repositories. (E.g. private repositories on bitbucket with deployment keys)
> 
> Please note, that I am using Nix/Nixpkgs in single-user mode on a host OS
> (openSUSE, and CentOS).
> 
> I tried adding my deployment keys to the system-wide ssh config in
> `/etc/ssh/`, and the per user config `~/.ssh/`, both to no avail. Also, at
> least on the CentOS machine I do not have root access. So, whatever
> solution there is will have to work from within my home directory.
> 
> My current (hacky) solution is to hard code the path to the repository in
> the `src` attribute of the derivation in the form `url =
> file:///home/user/src/project;`. And then ship it to the CentOS machine by
> using `nix-store --export`, and `nix-store --import`. However, this is
> hardly a satisfactory solution, and as you can imagine it doesn't scale
> very well with the number of packages.
> 
> Best,
> 
> Andreas

> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev



More information about the nix-dev mailing list