summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author Pragmatic Cypher2018-05-11 15:36:57 +0200
committer Willy Sudiarto Raharjo2018-05-12 01:58:27 +0200
commitceabe138cb72b28526a0329bcc81a4af9d3d65b9 (patch)
tree7627dfea0e0b190a114c32d98100a4c5c007bb61
parent89a7b0e6c0ece8f0f49c985079c5b512f4730dbb (diff)
downloadslackbuilds-ceabe138cb72b28526a0329bcc81a4af9d3d65b9.tar.gz
system/nix: Updated for version 2.0.2.
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
-rw-r--r--system/nix/README80
-rw-r--r--system/nix/config/rc.nix (renamed from system/nix/rc.nix)10
-rw-r--r--system/nix/nix.SlackBuild22
-rw-r--r--system/nix/nix.info8
4 files changed, 72 insertions, 48 deletions
diff --git a/system/nix/README b/system/nix/README
index 49ae7c253a..dcfdc6383e 100644
--- a/system/nix/README
+++ b/system/nix/README
@@ -1,51 +1,65 @@
-Nix is a purely functional package manager. This means that it treats
-packages like values in purely functional programming languages such as
-Haskell -- they are built by functions that don't have side-effects,
-and they never change after they have been built. Nix stores packages
-in the Nix store, usually the directory /nix/store, where each package
-has its own unique subdirectory such as
+nix (functional package manager)
- /nix/store/b6gvzjyb2pg0kjfwrjmg1vfhh54ad73z-firefox-33.1/
+Nix is a purely functional package manager. This means that it treats packages
+like values in purely functional programming languages such as Haskell -- they
+are built by functions that don't have side-effects, and they never change
+after they have been built. Nix stores packages in the Nix store, usually the
+directory /nix/store, where each package has its own unique subdirectory such
+as
-where b6gvzjyb2pg0... is a unique identifier for the package that
-captures all its dependencies (it's a cryptographic hash of the
-package's build dependency graph).
+ /nix/store/b6gvzjyb2pg0kjfwrjmg1vfhh54ad73z-firefox-33.1/
-Nix may be run in single or multi-user mode (which requires the
-nix-daemon). To have the nix daemon start and stop with your host,
-add to /etc/rc.d/rc.local:
+where b6gvzjyb2pg0... is a unique identifier for the package that captures all
+its dependencies (it's a cryptographic hash of the package's build dependency
+graph).
- if [ -x /etc/rc.d/rc.nix ]; then
+Nix may be run in single or multi-user mode (which requires the nix-daemon).
+The following sets up multi-user mode.
+
+To have the nix daemon start and stop with your host, add to /etc/rc.d/rc.local:
+
+ if [ -x /etc/rc.d/rc.nix ]; then
/etc/rc.d/rc.nix start
- fi
+ fi
and to /etc/rc.d/rc.local_shutdown (creating it if needed):
- if [ -x /etc/rc.d/rc.nix ]; then
+ if [ -x /etc/rc.d/rc.nix ]; then
/etc/rc.d/rc.nix stop
- fi
+ fi
+
+The daemon requires users for building the nix packages, which should be added
+under the 'nixbld' group.
+
+ # groupadd -g 314 nixbld
+ # for n in $(seq 1 10); do useradd -c "Nix build user $n" \
+ # -d /var/empty -g nixbld -G nixbld -M -N -r -s "$(which nologin)" \
+ # nixbld$n; done
+
+Restricting access to the daemon is acheived by setting file permissions for
+the daemon's socket's folder.
-The daemon requires users for building the nix packages, which should
-be added under the 'nixbld' group.
+ # groupadd nix-users
+ # chgrp nix-users /nix/var/nix/daemon-socket
+ # chmod ug=rwx,o= /nix/var/nix/daemon-socket
- groupadd -g 314 nixbld
- for n in $(seq 1 10); do useradd -c "Nix build user $n" \
- -d /var/empty -g nixbld -G nixbld -M -N -r -s "$(which nologin)" \
- nixbld$n; done
+Correct permissions must also be set for the following profile directories to
+give users access.
-Restricting access to the daemon is acheived by setting file
-permissions for the daemon's socket's folder.
+ # mkdir -p /nix/var/nix/profiles/per-user
+ # chgrp nix-users /nix/var/nix/profiles/per-user
+ # chmod go+wt /nix/var/nix/profiles/per-user
- groupadd nix-users
- chgrp nix-users /nix/var/nix/daemon-socket
- chmod ug=rwx,o= /nix/var/nix/daemon-socket
+ # mkdir -p /nix/var/nix/gcroots/per-user
+ # chgrp nix-users /nix/var/nix/gcroots/per-user
+ # chmod go+wt /nix/var/nix/gcroots/per-user
-Correct permissions must also be set for the following profile
-directories to give users access.
+For setup a user to use nix, add him to the nix-users group and load these
+lines on login (via $HOME/.profile):
- /nix/var/nix/profiles
- /var/nix/profiles
+ export NIX_REMOTE=daemon
+ source /etc/profile.d/nix.sh
If you have patches email me, or send a pull request via github:
- https://github.com/PragmaticCypher/slackbuilds
+ https://github.com/PragmaticCypher/nix.SlackBuild
diff --git a/system/nix/rc.nix b/system/nix/config/rc.nix
index 86f54a25ea..82852934af 100644
--- a/system/nix/rc.nix
+++ b/system/nix/config/rc.nix
@@ -1,5 +1,13 @@
#!/bin/sh
+# Short-Description: Create lightweight, portable, self-sufficient containers.
+# Description:
+# Docker is an open-source project to easily create lightweight, portable,
+# self-sufficient containers from any application. The same container that a
+# developer builds and tests on a laptop can run at scale, in production, on
+# VMs, bare metal, OpenStack clusters, public clouds and more.
+
+
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
BASE=nix-daemon
@@ -45,7 +53,7 @@ nix_stop() {
rm -f ${NIX_PIDFILE}
}
-# Restart nix:
+# Restart docker:
nix_restart() {
nix_stop
nix_start
diff --git a/system/nix/nix.SlackBuild b/system/nix/nix.SlackBuild
index 8925bc1230..825db7c78a 100644
--- a/system/nix/nix.SlackBuild
+++ b/system/nix/nix.SlackBuild
@@ -23,7 +23,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=nix
-VERSION=${VERSION:-1.11.13}
+VERSION=${VERSION:-2.0.2}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -72,9 +72,10 @@ find -L . \
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
- --mandir=/usr/man \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
+ --mandir=/usr/man \
+ --docdir=/usr/doc/$PRGNAM-$VERSION \
--sysconfdir=/etc \
--build=$ARCH-slackware-linux \
--host=$ARCH-slackware-linux
@@ -82,7 +83,10 @@ CXXFLAGS="$SLKCFLAGS" \
make
make install DESTDIR=$PKG
-install -D --mode 0755 $CWD/rc.nix $PKG/etc/rc.d/rc.nix.new
+find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+
+install -D --mode 0755 $CWD/config/rc.nix $PKG/etc/rc.d/rc.nix.new
mkdir -p $PKG/nix
mkdir -p $PKG/var/nix/profiles
mkdir -p $PKG/nix/var/nix/profiles
@@ -91,13 +95,7 @@ mkdir -p $PKG/nix/var/nix/daemon-socket
rm -fr $PKG/etc/init.d
rm -fr $PKG/usr/lib/systemd
-mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/perl5/vendor_perl
-mv $PKG/usr/lib${LIBDIRSUFFIX}/perl5/site_perl/**/**/* $PKG/usr/lib${LIBDIRSUFFIX}/perl5/vendor_perl
-rm -r $PKG/usr/lib${LIBDIRSUFFIX}/perl5/site_perl
-
-if [ "$ARCH" = "x86_64" ]; then
- mv $PKG/usr/lib/pkgconfig/ $PKG/usr/lib${LIBDIRSUFFIX}/pkgconfig/
-fi
+mv $PKG/usr/lib/pkgconfig/ $PKG/usr/lib${LIBDIRSUFFIX}/pkgconfig/
find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
@@ -106,6 +104,10 @@ if [ "$ARCH" = "x86_64" ]; then
rm -rf $PKG/usr/lib
fi
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a COPYING README.md $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
diff --git a/system/nix/nix.info b/system/nix/nix.info
index 936272b001..92e48aae74 100644
--- a/system/nix/nix.info
+++ b/system/nix/nix.info
@@ -1,10 +1,10 @@
PRGNAM="nix"
-VERSION="1.11.13"
+VERSION="2.0.2"
HOMEPAGE="http://nixos.org/nix"
-DOWNLOAD="http://nixos.org/releases/nix/nix-1.11.13/nix-1.11.13.tar.xz"
-MD5SUM="7f12df0c0057ac6d057dee639269403f"
+DOWNLOAD="http://nixos.org/releases/nix/nix-2.0.2/nix-2.0.2.tar.xz"
+MD5SUM="1cd8ce214c1fd2792e445692c756f63e"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
-REQUIRES="perl-DBD-SQLite perl-WWW-Curl libseccomp"
+REQUIRES="libsodium libseccomp"
MAINTAINER="Pragmatic Cypher"
EMAIL="slackbuilds@server.ky"