pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

wip/nix: reassign maint. create users



Module Name:	pkgsrc-wip
Committed By:	nikita <nikita%NetBSD.org@localhost>
Pushed By:	nikita
Date:		Sun Apr 18 15:26:55 2021 +0200
Changeset:	990d1ce7aed4d590d689c3be11b54afb1a857c1c

Modified Files:
	nix/Makefile
	nix/TODO
Added Files:
	nix/files/nix

Log Message:
wip/nix: reassign maint. create users

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=990d1ce7aed4d590d689c3be11b54afb1a857c1c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 nix/Makefile  |  8 +++++-
 nix/TODO      |  5 ++++
 nix/files/nix | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 98 insertions(+), 1 deletion(-)

diffs:
diff --git a/nix/Makefile b/nix/Makefile
index 20617b094a..0420e11a6d 100644
--- a/nix/Makefile
+++ b/nix/Makefile
@@ -4,7 +4,7 @@ DISTNAME=		nix-2.3.7
 CATEGORIES=		wip
 MASTER_SITES=		${MASTER_SITE_GITHUB:=NixOS/}
 
-MAINTAINER=		nikita%NetBSD.org@localhost
+MAINTAINER=		pkgsrc-users%NetBSD.org@localhost
 HOMEPAGE=		https://github.com/NixOS/nix/
 COMMENT=		Purely functional package manager
 LICENSE=		gnu-lgpl-v2.1
@@ -61,6 +61,12 @@ CONFIG_SHELL=		${TOOLS_PATH.bash}
 # incomplete, remove once the docs build
 CONFIGURE_ARGS+=	--disable-doc-gen
 
+# Buildusers
+PKG_GROUPS+=	nixbld
+.for i in 1 2 3 4 5 6 7 8 9 10
+PKG_USERS+=	nixbld${i}:nixbld
+.endfor
+
 #SUBST_CLASSES+=		docbook
 #SUBST_MESSAGE.docbook=	Fixing docbook URLs.
 #SUBST_FILES.docbook+=	doc/manual/installation/prerequisites-source.xml
diff --git a/nix/TODO b/nix/TODO
index 940881e058..698971b5b1 100644
--- a/nix/TODO
+++ b/nix/TODO
@@ -1,3 +1,8 @@
+* patch:
+  - code in next release will have moved to
+    src/libexpr/primops/fetchTree.cc , check if <sys/wait.h> is still
+    required.
+
 * port to NetBSD?
   There is a high probability that in addition to packaging, supported platforms
   must be tested and non-supported (like NetBSD host) ported to.
diff --git a/nix/files/nix b/nix/files/nix
new file mode 100644
index 0000000000..96cd5db5d0
--- /dev/null
+++ b/nix/files/nix
@@ -0,0 +1,86 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# PROVIDE: nix
+# REQUIRE: DAEMON NETWORKING LOGIN
+# KEYWORD: shutdown
+#
+# The creation of a /nix is intended, so that we could potentially
+# make use of content-addressed mirrors if we get support in Nix
+# upstream.
+# Theoretically this could be in any location, but any other location
+# comes with a caveat.
+#
+# You will need to set
+#	nix=YES
+# in /etc/rc.conf to start nix.
+
+if [ -f /etc/rc.subr ]
+then
+	. /etc/rc.subr
+fi
+
+name="nix"
+rcvar=${name}
+
+# run once, add check in the beginning if structure already exists
+# in case you've done this manually or run this rc file at least
+# one time.
+nix_precmd()
+{
+	if [ ! -f /nix/store ]; then
+		mkdir -p /nix/var/log/nix/drvs
+		mkdir -p /nix/var/nix/db
+		mkdir -p /nix/var/nix/gcroots
+		mkdir -p /nix/var/nix/profiles
+		mkdir -p /nix/var/nix/temproots
+		mkdir -p /nix/var/nix/userpool
+		mkdir -p /nix/var/nix/gcroots/per-user
+		mkdir -p /nix/var/nix/profiles/per-user
+		chmod 0755 /nix/var/log/nix/drvs
+		chmod 0755 /nix/var/nix/db
+		chmod 0755 /nix/var/nix/gcroots
+		chmod 0755 /nix/var/nix/profiles
+		chmod 0755 /nix/var/nix/temproots
+		chmod 0755 /nix/var/nix/userpool
+		chmod 0755 /nix/var/nix/gcroots/per-user
+		chmod 0755 /nix/var/nix/profiles/per-user
+		chown root:nixbld /nix/store
+		chmod 1775 /nix/store
+	fi
+}
+
+nix_start()
+{
+}
+
+if [ -f /etc/rc.subr -a -f /etc/rc.conf -a -d /etc/rc.d -a -f /etc/rc.d/DAEMON ]; then
+	# newer NetBSD
+	load_rc_config $name
+	run_rc_command "$1"
+else
+	# old NetBSD, Solaris and illumos, Linux, etc.
+	pidfile="${gnunet_home}/${name}.pid"
+	cmd=${1:-start}
+	case ${cmd} in
+	restart)
+		( $0 stop )
+		sleep 5
+		$0 start
+		;;
+	stop)
+		echo "Stopping ${name}."
+		check_pidfile
+		! [ -n ${pid} ] && eval ${stop_cmd}
+		;;
+	start)
+		echo "Starting ${name}."
+		eval ${start_precmd}
+		eval ${start_cmd}
+		;;
+	*)
+		echo 1>&2 "Usage: $0 [start|stop|restart]"
+		exit 1
+		;;
+	esac
+	exit 0
+fi


Home | Main Index | Thread Index | Old Index