Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

nix-prefetch-git fails without NIX_REMOTE being set (nix 2.0) #70

Open
Profpatsch opened this issue Apr 10, 2018 · 0 comments
Open

nix-prefetch-git fails without NIX_REMOTE being set (nix 2.0) #70

Profpatsch opened this issue Apr 10, 2018 · 0 comments

Comments

@Profpatsch
Copy link
Contributor

Profpatsch commented Apr 10, 2018

When go2nix invokes nix-prefetch-git, it fails because nix can’t access the nix-daemon:

→ go2nix save
2018/04/10 17:56:06 Initialized empty Git repository in /tmp/git-checkout-tmp-2emNcsso/payment-processors/.git/
From file:///home/philip/.go/src/gitlab.techcultivation.org/sangha/payment-processors
 * branch            HEAD       -> FETCH_HEAD
Switched to a new branch 'fetchgit'
removing `.git'...
error: Nix database directory ‘/nix/var/nix/db’ is not writable: Permission denied
2018/04/10 17:56:06 Command /nix/store/sgzjh8gbvx2r9lsbzjycmi1n9gfgbn8a-nix-prefetch-git/bin/nix-prefetch-git [nix-prefetch-git --fetch-submodules file:///home/philip/.go/src/gitlab.techcultivation.org/sangha/payment-processors] failed: exit status 1

When I set NIX_REMOTE, it works:

→ env NIX_REMOTE=daemon go2nix save
→

This is quite strange, because nix 2.0 shouldn’t need a set NIX_REMOTE to work properly. Even stranger, when I run the failing nix-prefetch-git command directly in my shell, it works:

→ env | grep NIX
NIX_PROFILES=/run/current-system/sw /nix/var/nix/profiles/default /home/philip/.nix-profile /etc/profiles/per-user/philip
NIX_PATH=vuizvui=/home/philip/vuizvui:nixpkgs=/home/philip/nixpkgs:nixos-config=/nix/store/6dl6avhcagic7hyq8pd2a33xg153a7q1-katara-configuration.nix
NIX_USER_PROFILE_DIR=/nix/var/nix/profiles/per-user/philip
NIXPKGS_CONFIG=/etc/nix/nixpkgs-config.nix
NIX_GHC=/nix/store/7ki3psspnd8a5azy2yxliglsklgp322b-ghc-8.2.2-with-packages/bin/ghc
→ nix-prefetch-git --fetch-submodules file:///home/philip/.go/src/gitlab.techcultivation.org/sangha/payment-processors
Initialized empty Git repository in /tmp/git-checkout-tmp-iHjVchBE/payment-processors/.git/
… git stuff …
{
  "url": "file:///home/philip/.go/src/gitlab.techcultivation.org/sangha/payment-processors",
  "rev": "7f0adc67638e9b369519d85b9a59c776bd89ccc4",
  "date": "2018-03-12T10:58:19+01:00",
  "sha256": "149nqp1299llhb1xy0ljz6r3h77gxa9jyqzhx1hgkrghjlij1hzk",
  "fetchSubmodules": true
}

cc @aszlig

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

No branches or pull requests

1 participant