From 106a4ec9c91ab079ea086ab7745030554cce5506 Mon Sep 17 00:00:00 2001 From: Pragmatic Cypher Date: Sun, 20 Nov 2016 20:51:49 +0000 Subject: system/nix: Updated for version 1.11.4. Signed-off-by: David Spencer --- system/nix/README | 20 +++++++----- system/nix/config/rc.nix | 83 ----------------------------------------------- system/nix/nix.SlackBuild | 10 +++--- system/nix/nix.info | 6 ++-- system/nix/rc.nix | 75 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 94 insertions(+), 100 deletions(-) delete mode 100644 system/nix/config/rc.nix create mode 100644 system/nix/rc.nix diff --git a/system/nix/README b/system/nix/README index a741331aae..1da6a2ec68 100644 --- a/system/nix/README +++ b/system/nix/README @@ -1,5 +1,3 @@ -nix (functional package manager) - 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, @@ -9,9 +7,9 @@ has its own unique subdirectory such as /nix/store/b6gvzjyb2pg0kjfwrjmg1vfhh54ad73z-firefox-33.1/ -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). +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 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, @@ -35,14 +33,18 @@ be added under the 'nixbld' group. -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. +Restricting access to the daemon is acheived by setting file +permissions for the daemon's socket's folder. chgrp nix-users /nix/var/nix/daemon-socket chmod ug=rwx,o= /nix/var/nix/daemon-socket -Correct permissions must also be set for the following profile directories -to give users access. +Correct permissions must also be set for the following profile +directories to give users access. /nix/var/nix/profiles /var/nix/profiles + +If you have patches email me, or send a pull request via github: + + https://github.com/PragmaticCypher/slackbuilds diff --git a/system/nix/config/rc.nix b/system/nix/config/rc.nix deleted file mode 100644 index 82852934af..0000000000 --- a/system/nix/config/rc.nix +++ /dev/null @@ -1,83 +0,0 @@ -#!/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 - -UNSHARE=/usr/bin/unshare -NIX=/usr/bin/$BASE -NIX_PIDFILE=/var/run/$BASE.pid -NIX_LOG=/var/log/nix.log -NIX_OPTS= - -if [ -f /etc/default/$BASE ]; then - . /etc/default/$BASE -fi - -# Check nix is present -if [ ! -x $NIX ]; then - echo "$NIX not present or not executable" - exit 1 -fi - -nix_start() { - echo "starting $BASE ..." - if [ -x ${NIX} ]; then - # If there is an old PID file (no nix-daemon running), clean it up: - if [ -r ${NIX_PIDFILE} ]; then - if ! ps axc | grep nix-daemon 1> /dev/null 2> /dev/null ; then - echo "Cleaning up old ${NIX_PIDFILE}." - rm -f ${NIX_PIDFILE} - fi - fi - nohup "${UNSHARE}" -m -- ${NIX} >> ${NIX_LOG} 2>&1 & - echo $! > ${NIX_PIDFILE} - fi -} - -# Stop nix: -nix_stop() { - echo "stopping $BASE ..." - # If there is no PID file, ignore this request... - if [ -r ${NIX_PIDFILE} ]; then - kill $(cat ${NIX_PIDFILE}) - fi - rm -f ${NIX_PIDFILE} -} - -# Restart docker: -nix_restart() { - nix_stop - nix_start -} - -case "$1" in -'start') - nix_start - ;; -'stop') - nix_stop - ;; -'restart') - nix_restart - ;; -'status') - if [ -f ${NIX_PIDFILE} ] && ps -o cmd $(cat ${NIX_PIDFILE}) | grep -q $BASE ; then - echo "status of $BASE: running" - else - echo "status of $BASE: stopped" - fi - ;; -*) - echo "usage $0 start|stop|restart|status" -esac - -exit 0 diff --git a/system/nix/nix.SlackBuild b/system/nix/nix.SlackBuild index 3a3a4569e6..6820ea808c 100644 --- a/system/nix/nix.SlackBuild +++ b/system/nix/nix.SlackBuild @@ -23,13 +23,13 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PRGNAM=nix -VERSION=${VERSION:-1.11.2} +VERSION=${VERSION:-1.11.4} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then case "$( uname -m )" in - i?86) ARCH=i486 ;; + i?86) ARCH=i586 ;; arm*) ARCH=arm ;; *) ARCH=$( uname -m ) ;; esac @@ -40,8 +40,8 @@ TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} -if [ "$ARCH" = "i486" ]; then - SLKCFLAGS="-O2 -march=i486 -mtune=i686" +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" @@ -82,7 +82,7 @@ CXXFLAGS="$SLKCFLAGS" \ make make install DESTDIR=$PKG -install -D --mode 0755 $CWD/config/rc.nix $PKG/etc/rc.d/rc.nix.new +install -D --mode 0755 $CWD/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 diff --git a/system/nix/nix.info b/system/nix/nix.info index 03af577e6c..b17c8383a8 100644 --- a/system/nix/nix.info +++ b/system/nix/nix.info @@ -1,8 +1,8 @@ PRGNAM="nix" -VERSION="1.11.2" +VERSION="1.11.4" HOMEPAGE="http://nixos.org/nix" -DOWNLOAD="http://nixos.org/releases/nix/nix-1.11.2/nix-1.11.2.tar.xz" -MD5SUM="7257cf8ea7b5db7ca42165f6dbf17fb7" +DOWNLOAD="http://nixos.org/releases/nix/nix-1.11.4/nix-1.11.4.tar.xz" +MD5SUM="5e74997665df456ea3ac379a2cbfa4af" DOWNLOAD_x86_64="" MD5SUM_x86_64="" REQUIRES="perl-DBD-SQLite perl-WWW-Curl" diff --git a/system/nix/rc.nix b/system/nix/rc.nix new file mode 100644 index 0000000000..86f54a25ea --- /dev/null +++ b/system/nix/rc.nix @@ -0,0 +1,75 @@ +#!/bin/sh + +PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin + +BASE=nix-daemon + +UNSHARE=/usr/bin/unshare +NIX=/usr/bin/$BASE +NIX_PIDFILE=/var/run/$BASE.pid +NIX_LOG=/var/log/nix.log +NIX_OPTS= + +if [ -f /etc/default/$BASE ]; then + . /etc/default/$BASE +fi + +# Check nix is present +if [ ! -x $NIX ]; then + echo "$NIX not present or not executable" + exit 1 +fi + +nix_start() { + echo "starting $BASE ..." + if [ -x ${NIX} ]; then + # If there is an old PID file (no nix-daemon running), clean it up: + if [ -r ${NIX_PIDFILE} ]; then + if ! ps axc | grep nix-daemon 1> /dev/null 2> /dev/null ; then + echo "Cleaning up old ${NIX_PIDFILE}." + rm -f ${NIX_PIDFILE} + fi + fi + nohup "${UNSHARE}" -m -- ${NIX} >> ${NIX_LOG} 2>&1 & + echo $! > ${NIX_PIDFILE} + fi +} + +# Stop nix: +nix_stop() { + echo "stopping $BASE ..." + # If there is no PID file, ignore this request... + if [ -r ${NIX_PIDFILE} ]; then + kill $(cat ${NIX_PIDFILE}) + fi + rm -f ${NIX_PIDFILE} +} + +# Restart nix: +nix_restart() { + nix_stop + nix_start +} + +case "$1" in +'start') + nix_start + ;; +'stop') + nix_stop + ;; +'restart') + nix_restart + ;; +'status') + if [ -f ${NIX_PIDFILE} ] && ps -o cmd $(cat ${NIX_PIDFILE}) | grep -q $BASE ; then + echo "status of $BASE: running" + else + echo "status of $BASE: stopped" + fi + ;; +*) + echo "usage $0 start|stop|restart|status" +esac + +exit 0 -- cgit v1.2.3