diff options
author | arcnmx | 2019-02-25 19:13:43 -0800 |
---|---|---|
committer | arcnmx | 2019-02-25 19:13:56 -0800 |
commit | 858a9b0ac6a1dd900f0f961c98927e38b12afdfd (patch) | |
tree | e2736510b540d028b7996760057ea914c8588ced | |
download | aur-858a9b0ac6a1dd900f0f961c98927e38b12afdfd.tar.gz |
nix 2.2.1
-rw-r--r-- | .SRCINFO | 32 | ||||
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | PKGBUILD | 73 | ||||
-rw-r--r-- | nix-channels | 1 | ||||
-rw-r--r-- | nix.conf | 6 | ||||
-rw-r--r-- | nix.install | 31 | ||||
-rw-r--r-- | nix.sysusers | 11 | ||||
-rw-r--r-- | nix.tmpfiles | 11 |
8 files changed, 169 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..3792932f1794 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,32 @@ +pkgbase = nix-bin + pkgdesc = A purely functional package manager - /nix/store multi-user edition + pkgver = 2.2.1 + pkgrel = 1 + url = https://nixos.org/nix + install = nix.install + arch = i686 + arch = x86_64 + license = LGPL + makedepends = bzip2 + conflicts = nix + options = !strip + options = staticlibs + options = libtool + options = emptydirs + backup = etc/nix/nix.conf + backup = root/.nix-channels + source = nix.install + source = nix.tmpfiles + source = nix.conf + source = nix-channels + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + source_i686 = https://nixos.org/releases/nix/nix-2.2.1/nix-2.2.1-i686-linux.tar.bz2 + sha256sums_i686 = 223c141b7ce322aacd4003dfc79b969ee813396d2ac586cf44c0e787233b1666 + source_x86_64 = https://nixos.org/releases/nix/nix-2.2.1/nix-2.2.1-x86_64-linux.tar.bz2 + sha256sums_x86_64 = e229e28f250cad684c278c9007b07a24eb4ead239280c237ed2245871eca79e0 + +pkgname = nix-bin + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..253d4d1e1793 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/*.tar.bz2 +/src/ +/pkg/ +/*.pkg.* diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..cfab2c6e89b7 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,73 @@ +pkgname=nix-bin +pkgver=2.2.1 +pkgrel=1 +pkgdesc="A purely functional package manager - /nix/store multi-user edition" +arch=('i686' 'x86_64') +url="https://nixos.org/nix" +license=('LGPL') +makedepends=('bzip2') +conflicts=('nix') +install=nix.install +source_x86_64=("https://nixos.org/releases/nix/nix-$pkgver/nix-$pkgver-x86_64-linux.tar.bz2") +source_i686=("https://nixos.org/releases/nix/nix-$pkgver/nix-$pkgver-i686-linux.tar.bz2") +source=(nix.install nix.tmpfiles nix.conf nix-channels) +sha256sums_x86_64=('e229e28f250cad684c278c9007b07a24eb4ead239280c237ed2245871eca79e0') +sha256sums_i686=('223c141b7ce322aacd4003dfc79b969ee813396d2ac586cf44c0e787233b1666') +sha256sums=(SKIP SKIP SKIP SKIP) +backup=('etc/nix/nix.conf' 'root/.nix-channels') +options=('!strip' 'staticlibs' 'libtool' 'emptydirs') +SOURCE_DATE_EPOCH=1 + +NIX_STORE_NIX=5hdmx9yk7gr71b98j4vh9271k0zg5jis-nix-2.2.1 +NIX_STORE_CACERT=fna8lggi520pgvdwi8p1xyzcj9706j04-nss-cacert-3.40.1 +NIX_SRC=nix-$pkgver-$CARCH-linux + +build() { + { + echo "g nixbld" + for x in {1..32}; do + echo "m nixbld$x nixbld" + done + } > $srcdir/nix.sysusers + + { # patch nix-daemon.sh to add user channels to NIX_PATH, see https://github.com/NixOS/nixpkgs/pull/38351 + cat $srcdir/$NIX_SRC/store/$NIX_STORE_NIX/etc/profile.d/nix-daemon.sh + echo 'export NIX_PATH="$HOME/.nix-defexpr/channels:$NIX_PATH"' + } > $srcdir/nix-daemon.sh +} + +package() { + ROOT_HOME=$(echo ~root) + install -dm0755 $pkgdir/nix/var/nix/db $pkgdir/nix/var/pacman/store $pkgdir/nix/var/nix/gcroots/pacman $pkgdir/usr/bin + install -dm1775 $pkgdir/nix/store + install -dm0750 $pkgdir/root + install -Dm0644 -t $pkgdir/etc/nix/ $srcdir/nix.conf + install -Dm0644 $srcdir/nix.sysusers $pkgdir/usr/lib/sysusers.d/$pkgname.conf + install -Dm0644 $srcdir/nix.tmpfiles $pkgdir/usr/lib/tmpfiles.d/$pkgname.conf + install -Dm0644 $srcdir/$NIX_SRC/.reginfo $pkgdir/nix/var/pacman/db + install -Dm0644 -t $pkgdir/etc/profile.d/ $srcdir/nix-daemon.sh + install -m0664 $srcdir/nix-channels $pkgdir/root/.nix-channels + ln -s /nix/var/nix/profiles/default $pkgdir/root/.nix-profile + + for f in $srcdir/$NIX_SRC/store/$NIX_STORE_NIX/bin/*; do + ln -s /nix/store/$NIX_STORE_NIX/bin/nix $pkgdir/usr/bin/$(basename $f) + done + + for f in /include/nix \ + /lib/{libnixexpr,libnixmain,libnixstore,libnixutil}.so \ + /lib/pkgconfig/{nix-expr,nix-main,nix-store}.pc \ + /lib/systemd/system/nix-daemon.{service,socket} \ + /share/doc/nix \ + /share/man/man1/nix-{build,channel,collect-garbage,copy-closure,env,hash,instantiate,prefetch-url,shell,store}.1.gz \ + /share/man/man5/nix.conf.5.gz /share/man/man8/nix-daemon.8.gz + do + [[ -e $srcdir/$NIX_SRC/store/$NIX_STORE_NIX$f ]] || (echo "$f not found" >&2 && false) + install -dm0755 $pkgdir/usr$(dirname $f) + ln -s /nix/store/$NIX_STORE_NIX$f $pkgdir/usr$f + done + + for f in $srcdir/$NIX_SRC/store/*; do + cp -a $f $pkgdir/nix/var/pacman/store/ + ln -s /nix/store/$(basename $f) $pkgdir/nix/var/nix/gcroots/pacman/ + done +} diff --git a/nix-channels b/nix-channels new file mode 100644 index 000000000000..f0c6733db836 --- /dev/null +++ b/nix-channels @@ -0,0 +1 @@ +https://nixos.org/channels/nixpkgs-unstable nixpkgs diff --git a/nix.conf b/nix.conf new file mode 100644 index 000000000000..55a9bd6f95fc --- /dev/null +++ b/nix.conf @@ -0,0 +1,6 @@ +# man 5 nix.conf +build-users-group = nixbld + +max-jobs = 32 +cores = 1 +#sandbox = false diff --git a/nix.install b/nix.install new file mode 100644 index 000000000000..18cf0c36ffd5 --- /dev/null +++ b/nix.install @@ -0,0 +1,31 @@ +_store_load() { + cp -al /nix/var/pacman/store/* /nix/store/ + nix-store --init + nix-store --load-db < /nix/var/pacman/db + systemctl daemon-reload +} + +_daemon_info() { + echo "To start the nix daemon, execute one of the following:" + echo + echo " systemctl enable nix-daemon.socket # Sets the daemon to start on next boot" + echo " systemctl enable --now nix-daemon.socket # Starts now and on next boot too" + echo + echo "Also, if this is a new install, you need to start a new login shell or otherwise" + echo + echo " source /etc/profile.d/nix-daemon.sh" + echo + echo "Once your environment is set-up, you will need to add some channels. You can see how" + echo "to do that here:" + echo " https://nixos.org/nix/manual/#sec-channels" +} + +post_install() { + _store_load + _daemon_info +} + +post_upgrade() { + _store_load + _daemon_info +} diff --git a/nix.sysusers b/nix.sysusers new file mode 100644 index 000000000000..1527b349098a --- /dev/null +++ b/nix.sysusers @@ -0,0 +1,11 @@ +g nixbld +m nixbld1 nixbld +m nixbld2 nixbld +m nixbld3 nixbld +m nixbld4 nixbld +m nixbld5 nixbld +m nixbld6 nixbld +m nixbld7 nixbld +m nixbld8 nixbld +m nixbld9 nixbld +m nixbld10 nixbld diff --git a/nix.tmpfiles b/nix.tmpfiles new file mode 100644 index 000000000000..08d84c9bf19c --- /dev/null +++ b/nix.tmpfiles @@ -0,0 +1,11 @@ +d /nix/store 1775 root nixbld +d /root/.nix-defexpr 0750 +d /nix/var/log/nix/drvs 0755 +d /nix/var/nix/db 0755 +d /nix/var/nix/gcroots 0755 +d /nix/var/nix/profiles 0755 +d /nix/var/nix/temproots 0755 +d /nix/var/nix/userpool 0755 +d /nix/var/nix/gcroots/per-user 1777 +d /nix/var/nix/profiles/per-user 1777 +d /nix/var/nix/profiles/per-user/root 0755 |