void-packages/srcpkgs/nix/template

55 lines
1.9 KiB
Plaintext

# Template file for 'nix'
pkgname=nix
version=1.8
revision=1
build_style=gnu-configure
# Use /nix/var as suggested by the official Manual.
configure_args="--localstatedir=/nix/var"
hostmakedepends="pkg-config flex"
# Extra run-time dependencies.
depends="curl perl-WWW-Curl perl-DBD-SQLite"
makedepends="bzip2-devel libressl-devel sqlite-devel gc-devel ${depends}"
# Default configuration file.
conf_files="/etc/nix/nix.conf"
# Create required build users/groups.
system_groups="nixbld"
for f in $(seq 10); do
system_accounts+=" nixbld${f}"
eval export nixbld\${f}_homedir="/var/empty"
eval export nixbld\${f}_groups="nixbld"
done
# Create required run-time directories.
make_dirs="
/nix/var/log/nix/drvs 0755 root root
/nix/var/nix/profiles 0755 root root
/nix/var/nix/profiles/per-user 1777 root root
/nix/var/nix/gcroots/per-user 1777 root root
/nix/var/nix/temproots 0755 root root
/nix/var/nix/gcroots 0755 root root
/nix/var/nix/manifests 0755 root root
/nix/var/nix/userpool 0755 root root
/nix/var/nix/db 0755 root root
/nix/store 1775 root nixbld"
short_desc="A purely functional package manager"
maintainer="Juan RP <xtraeme@gmail.com>"
license="MIT"
homepage="http://nixos.org/nix/"
distfiles="http://nixos.org/releases/nix/nix-${version}/nix-${version}.tar.xz"
checksum=a30a5e801bc1cb1019cbc3456d961a307c45c9c588b8692cf1293ea6588ef01c
post_install() {
vmkdir etc/nix
# Remove unused stuff.
rm -rf ${DESTDIR}/usr/include ${DESTDIR}/nix
# Let users interact with the nix-daemon by default.
vmkdir etc/profile.d
echo 'export NIX_REMOTE=daemon' > ${DESTDIR}/etc/profile.d/nix-daemon.sh
# Setup build users.
echo 'build-users-group = nixbld' > ${DESTDIR}/etc/nix/nix.conf
# Install our profile.d/nix for multi-user by default.
vinstall ${FILESDIR}/nix.sh 644 etc/profile.d
# runit service
vinstall ${FILESDIR}/nix-daemon.run 755 etc/sv/nix-daemon run
ln -s /run/runit/supervise.nix-daemon ${DESTDIR}/etc/sv/nix-daemon/supervise
}