Package Details: nix 2.2.1-1

Git Clone URL: https://aur.archlinux.org/nix.git (read-only)
Package Base: nix
Description: A purely functional package manager
Upstream URL: https://nixos.org/nix
Licenses: LGPL
Submitter: None
Maintainer: asppsa (shaugh)
Last Packager: asppsa
Votes: 58
Popularity: 0.176912
First Submitted: 2008-04-12 18:35
Last Updated: 2019-01-20 07:07

Latest Comments

1 2 3 4 5 6 Next › Last »

d.sa commented on 2019-04-18 18:14

I get this error while installing nix-2.2.1-1. What could I do to resolve the error?

(1/1) installing nix                                                   [########################################] 100%
Initializing default nix channel
unpacking channels...
error: while setting up the build environment: getting attributes of path '': No such file or directory              
error: program '/usr/bin/nix-env' failed with exit code 1
To start the nix daemon, execute one of the following:

    systemctl enable nix-daemon.socket       # Sets the daemon to start on next boot                                 
    systemctl enable --now nix-daemon.socket # Starts now and on next boot too                                       

Also, if this is a new install, you need to start a new login shell or otherwise                                     

    source /etc/profile.d/nix.sh
    source /etc/profile.d/nix-daemon.sh

asppsa commented on 2019-03-13 02:06

@CoolGenie, it looks like you must have manually compiled/installed Nix at some point in the past to /usr/local, and the service file loaded by systemd is left over from that. You can check this with systemctl status nix-daemon.socket. If systemd is using the right file, it should say that it is loaded from /usr/lib/systemd/system/nix-daemon.socket, which is a file installed as part of this package.

CoolGenie commented on 2019-03-12 13:19

I'm getting this error:

Mar 12 14:14:52 lenovo systemd[16819]: nix-daemon.service: Failed at step EXEC spawning /usr/local/bin/nix-daemon: No such file or directory

Any ideas? I don't see nix-daemon anywhere on my system.

immae commented on 2019-02-14 11:51

Hi,

I added editline to AUR: https://aur.archlinux.org/packages/editline/

I also added a dash-static package https://aur.archlinux.org/packages/dash-static/

With these two packages, I would suggest the following change to ensure that it works smoothly as of nix-2.2.*:

diff --git a/PKGBUILD b/PKGBUILD
index daa8e74..a3c9a86 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -13,7 +13,7 @@ pkgdesc="A purely functional package manager"
 arch=('i686' 'x86_64' 'armv7h')
 url="https://nixos.org/nix"
 license=('LGPL')
-depends=('gc' 'libsodium' 'boost' 'brotli' 'readline')
+depends=('gc' 'libsodium' 'boost' 'brotli' 'editline' 'dash-static')
 makedepends=('bzip2' 'gc' 'openssl')
 install=nix.install
 source=("https://nixos.org/releases/nix/nix-$pkgver/nix-$pkgver.tar.xz")
@@ -26,11 +26,10 @@ prepare() {

 build () {
   cd "$pkgname-$pkgver"
-  export EDITLINE_CFLAGS="-DREADLINE"
-  export EDITLINE_LIBS="/usr/lib/libreadline.so"
   ./configure --prefix=/usr \
               --libexecdir="/usr/lib/$pkgname" \
               --sysconfdir=/etc \
+              --with-sandbox-shell=/usr/bin/dash-static \
               --enable-gc
   make
 }

It will ensure that

  • nix gets compiled with editline (until readline becomes usable),

  • and that sandbox works out-of-the-box (pun not unintended), using a reasonnable binary as sandbox shell.

immae commented on 2019-02-09 13:08

@MazeChaZer: you need to restart nix-daemon.service after an upgrade ;)

I just discovered that nix repl works very badly with readline. I had to compile the editline (not available in archlinux) to have it work correctly. If you’re interested, here is a sketch of PKGBUILD to add editline dependency:

(Note: editline is different and incompatible with the libedit as packaged in archlinux)

pkgname=editline
pkgver=1.15.3
pkgrel=1
pkgdesc="A readline() replacement for UNIX without termcap (ncurses)"
arch=('x86_64')
url="http://troglobit.com/editline.html"
license=('BSD')
source=("ftp://ftp.troglobit.com/editline/${pkgname}-${pkgver}.tar.xz")
sha256sums=('75afaff4a171c57361b56c4e5da286652bd7d7aace5613b46527a99c99dc4377')


build () {
  cd "$pkgname-$pkgver"
  ./configure --prefix=/usr \
              --sysconfdir=/etc \
              --enable-gc
  make
}

package() {
  cd "$pkgname-$pkgver"
  make DESTDIR="$pkgdir" install
  mv $pkgdir/usr/share/man/man3/editline.3 $pkgdir/usr/share/man/man3/editline-troglobit.3
}

And diff in nix PKGBUILD:

diff --git a/PKGBUILD b/PKGBUILD
index daa8e74..ccbb377 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -13,8 +13,8 @@ pkgdesc="A purely functional package manager"
 arch=('i686' 'x86_64' 'armv7h')
 url="https://nixos.org/nix"
 license=('LGPL')
-depends=('gc' 'libsodium' 'boost' 'brotli' 'readline')
+depends=('gc' 'libsodium' 'boost' 'brotli' 'editline')
 makedepends=('bzip2' 'gc' 'openssl')
 install=nix.install
 source=("https://nixos.org/releases/nix/nix-$pkgver/nix-$pkgver.tar.xz")
 sha256sums=('85f8d3518060803e44e51b1a9ada1a39cea904b36a632ba1844043a0b63be515')
@@ -26,8 +26,6 @@ prepare() {

 build () {
   cd "$pkgname-$pkgver"
-  export EDITLINE_CFLAGS="-DREADLINE"
-  export EDITLINE_LIBS="/usr/lib/libreadline.so"
   ./configure --prefix=/usr \
               --libexecdir="/usr/lib/$pkgname" \
               --sysconfdir=/etc \

Note: this is needed only if you use nix repl, otherwise it’s useless.

MazeChaZer commented on 2019-02-07 12:22

Edit: I cannot reproduce the problem after rebooting my Laptop, don't mind me.

Ok I set sandbox = false for nix, but when I use nixops now, I still get a similar error:

  /nix/store/kj8z2mf1g3q5fi9446k7k29ibq9cj6j9-nixops-machines.drv
error: while setting up the build environment: getting attributes of path '': No such file or directory
Traceback (most recent call last):
  File "/nix/store/5ds721bxvmfgfkf1pj9cgjh0r5k128xc-nixops-1.6.1/bin/..nixops-wrapped-wrapped", line 990, in <module>
    args.op()
  File "/nix/store/5ds721bxvmfgfkf1pj9cgjh0r5k128xc-nixops-1.6.1/bin/..nixops-wrapped-wrapped", line 411, in op_deploy
    max_concurrent_activate=args.max_concurrent_activate)
  File "/nix/store/5ds721bxvmfgfkf1pj9cgjh0r5k128xc-nixops-1.6.1/lib/python2.7/site-packages/nixops/deployment.py", line 1056, in deploy
    self.run_with_notify('deploy', lambda: self._deploy(**kwargs))
  File "/nix/store/5ds721bxvmfgfkf1pj9cgjh0r5k128xc-nixops-1.6.1/lib/python2.7/site-packages/nixops/deployment.py", line 1045, in run_with_notify
    f()
  File "/nix/store/5ds721bxvmfgfkf1pj9cgjh0r5k128xc-nixops-1.6.1/lib/python2.7/site-packages/nixops/deployment.py", line 1056, in <lambda>
    self.run_with_notify('deploy', lambda: self._deploy(**kwargs))
  File "/nix/store/5ds721bxvmfgfkf1pj9cgjh0r5k128xc-nixops-1.6.1/lib/python2.7/site-packages/nixops/deployment.py", line 996, in _deploy
    self.configs_path = self.build_configs(dry_run=dry_run, repair=repair, include=include, exclude=exclude)
  File "/nix/store/5ds721bxvmfgfkf1pj9cgjh0r5k128xc-nixops-1.6.1/lib/python2.7/site-packages/nixops/deployment.py", line 664, in build_configs
    raise Exception("unable to build all machine configurations")
Exception: unable to build all machine configurations

Do I somehow have to disable the sandbox for nixops or is that another error? Using nixops 1.6.1 from nixos-18.09

MazeChaZer commented on 2019-01-31 15:51

@immae Thanks for the tip! This fixed the problem for me :)

asppsa commented on 2019-01-24 03:44

@immae, thanks for the sleuthing. I am planning to add a CLI tool to this package that can be used to manage sandboxing and build users (rather than having the current complex setup in the package install phase)

immae commented on 2019-01-22 12:54

A workaround is to install busybox (it’s important to have a statically linked version of sh) and add: sandbox-paths = /bin/sh=/usr/bin/busybox to /etc/nix/nix.conf

immae commented on 2019-01-22 12:45

nix 2.2.1 has sandbox enabled by default, which provokes this error: while setting up the build environment: getting attributes of path '': No such file or directory

Something is missing in the build as done with this package, in the meantime you need to set sandbox = false in /etc/nix/nix.conf to have it work properly (or revert to older version which has already sandbox = false by default)

(NB: this error is specific to the AUR-build version, curl-installed nix work alright if you really need sandbox)