Alex Vorobiev writes: > Hi, > I have built guix-0.8.2 and specified both --with-store-dir and -- > localstatedir (both directories are world-writable) but when I started > guix-daemon (as myself) and tried to install a package I got: > > $ guix package -i mc > guix package: error: build failed: creating directory `/gnu': Permission > denied > > Am I doing anything wrong? Why would it want to go to /gnu? I am using > RHEL-6.5. > > Thanks, > Alex The local state dir would be 'var' (e.g. /var, /usr/var, /usr/local/var, depending on the value for $prefix), and I've used that option before and believe it works fine. (At the very least I've seen --prefix affect its default value.) So I believe your problem is about --with-store-dir only. I've grepped a fresh guix clone for the raw string '/gnu/store' in .c, .cc, .scm, and .sh files, and outside of comments and docstrings, found the following: guix/build/utils.scm: (define (%store-directory) "Return the directory name of the store." (or (getenv "NIX_STORE") "/gnu/store")) guix/packages.scm (patch-and-repack): (let* ((store (or (getenv "NIX_STORE") "/gnu/store")) gnu/packages/busybox.scm (busybox): (substitute* "testsuite/cpio.tests" (("/usr/bin") "/gnu/store") (("usr") "gnu")) (There are also some matches in the tests/ directory but I think they're harmless.) Those should probably use %store-directory from (guix config). Here's a patch doing that, but note that: - In the busybox recipe, the "gnu" is replaced by (car (filter (negate string-null?) (string-split (%store-directory) #\/))) meaning it assumes (%store-directory) not to be the root directory. (Note that this uses the %store-directory procedure from (guix build utils); see next point.) - (guix build utils) has its own %store-directory bound to a procedure doing environment variable look-up on NIX_STORE instead of NIX_STORE_DIR (which determines the value of %store-directory from (guix config)); I preserved this semantics by importing %store-directory from (guix config) with a rename and falling back to it only if NIX_STORE is unset. - Similarly, packages.scm checks NIX_STORE and not NIX_STORE_DIR, and I preserved this semantics by falling back to %store-directory only if NIX_STORE is unset. Are these decisions right? The patch: