[Nix-dev] use fetchgitPrivate with NixOps (permission denied)

mb at thought2.de mb at thought2.de
Sun Apr 2 20:33:59 CEST 2017


Hi folks,


For using fetchgitPrivate one should put a ssh config file and an auth
socket on the NIX_PATH:

NIX_PATH=$NIX_PATH:ssh-config-file=/home/me/.ssh/config:ssh-auth-sock=$SSH_AUTH_SOCK

ls -la /home/me/.ssh/config

-rw-r--r-- 1 me users 108  2. Apr 19:37 /home/m/.ssh/config

echo $SSH_AUTH_SOCK

/run/user/1000/ssh-agent

So the file should have the right permissions. However when using
fetchgitPrivate inside the deployment expression:

fetchgitPrivate {
        url = "ssh://user@server/repo.git";
        rev = "a79d4...f3a52f81";
        sha256 = "0wm...mhlrmbp4030g";
}

I'm getting this error:

nixops deploy -d network

[..]
Initialized empty Git repository in /nix/store/hn...d4c3/.git/
Can't open user config file /home/me/.ssh/config: Permission denied
fatal: Could not read from remote repository.


Anybody ideas how this could be fixed?


Regards, Michael



More information about the nix-dev mailing list