aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO9
-rw-r--r--PKGBUILD13
-rw-r--r--fix_perllibdir.patch12
-rw-r--r--nix.install91
4 files changed, 119 insertions, 6 deletions
diff --git a/.SRCINFO b/.SRCINFO
index e47e2cb..13e7aed 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,8 +1,9 @@
1pkgbase = nix 1pkgbase = nix
2 pkgdesc = A purely functional package manager 2 pkgdesc = A purely functional package manager
3 pkgver = 1.11.10 3 pkgver = 1.11.16
4 pkgrel = 1 4 pkgrel = 1
5 url = https://nixos.org/nix 5 url = https://nixos.org/nix
6 install = nix.install
6 arch = i686 7 arch = i686
7 arch = x86_64 8 arch = x86_64
8 license = LGPL 9 license = LGPL
@@ -13,8 +14,10 @@ pkgbase = nix
13 depends = perl-dbd-sqlite 14 depends = perl-dbd-sqlite
14 depends = gc 15 depends = gc
15 depends = libsodium 16 depends = libsodium
16 source = https://nixos.org/releases/nix/nix-1.11.10/nix-1.11.10.tar.xz 17 source = https://nixos.org/releases/nix/nix-1.11.16/nix-1.11.16.tar.xz
17 sha256sums = b29a458c2b803bcc07d8b58cd016ca6ad0788a73ca74edaeaebc588961322467 18 source = fix_perllibdir.patch
19 sha256sums = 0ca5782fc37d62238d13a620a7b4bff6a200bab1bd63003709249a776162357c
20 sha256sums = 6d5a79602944b560f9b571c8db4efa1b26d4495e6160c5e18c2efbdd2e611c80
18 21
19pkgname = nix 22pkgname = nix
20 23
diff --git a/PKGBUILD b/PKGBUILD
index 2a40754..3189ef8 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@
4# Contributor: koral <koral at mailoo dot org> 4# Contributor: koral <koral at mailoo dot org>
5 5
6pkgname=nix 6pkgname=nix
7pkgver=1.11.10 7pkgver=1.11.16
8pkgrel=1 8pkgrel=1
9pkgdesc="A purely functional package manager" 9pkgdesc="A purely functional package manager"
10arch=('i686' 'x86_64') 10arch=('i686' 'x86_64')
@@ -12,8 +12,15 @@ url="https://nixos.org/nix"
12license=('LGPL') 12license=('LGPL')
13depends=('perl-www-curl' 'perl-dbd-sqlite' 'gc' 'libsodium') 13depends=('perl-www-curl' 'perl-dbd-sqlite' 'gc' 'libsodium')
14makedepends=('bzip2' 'gc' 'openssl') 14makedepends=('bzip2' 'gc' 'openssl')
15source=("https://nixos.org/releases/nix/nix-$pkgver/nix-$pkgver.tar.xz") 15install=nix.install
16sha256sums=('b29a458c2b803bcc07d8b58cd016ca6ad0788a73ca74edaeaebc588961322467') 16source=("https://nixos.org/releases/nix/nix-$pkgver/nix-$pkgver.tar.xz" "fix_perllibdir.patch")
17sha256sums=('0ca5782fc37d62238d13a620a7b4bff6a200bab1bd63003709249a776162357c'
18 '6d5a79602944b560f9b571c8db4efa1b26d4495e6160c5e18c2efbdd2e611c80')
19
20prepare() {
21 cd "$pkgname-$pkgver"
22 patch -Np1 -i "${srcdir}/fix_perllibdir.patch"
23}
17 24
18build () { 25build () {
19 cd "$pkgname-$pkgver" 26 cd "$pkgname-$pkgver"
diff --git a/fix_perllibdir.patch b/fix_perllibdir.patch
new file mode 100644
index 0000000..2cb718b
--- /dev/null
+++ b/fix_perllibdir.patch
@@ -0,0 +1,12 @@
1diff -ura a/Makefile.config.in b/Makefile.config.in
2--- a/Makefile.config.in 1970-01-01 00:00:01.000000000 +0000
3+++ b/Makefile.config.in 2017-09-03 17:04:53.032445157 +0000
4@@ -26,7 +26,7 @@
5 mandir = @mandir@
6 perl = @perl@
7 perlbindings = @perlbindings@
8-perllibdir = @perllibdir@
9+perllibdir = $(shell perl -V:vendorarch|cut -d\' -f2)
10 pkglibdir = $(libdir)/$(PACKAGE_NAME)
11 prefix = @prefix@
12 storedir = @storedir@
diff --git a/nix.install b/nix.install
new file mode 100644
index 0000000..e9adc0c
--- /dev/null
+++ b/nix.install
@@ -0,0 +1,91 @@
1
2pre_install () {
3 # Check that the group and users don't already exist
4 if [[ -n $(cut -d: -f1 /etc/group | grep -w nixbld) ]]; then
5 echo "The nixbld group already exists. This install cannot proceed."
6 exit 1
7 fi
8
9 for i in {1..10}; do
10 if [[ -n $(cut -d: -f1 /etc/passwd | grep -w nixbld$i) ]]; then
11 echo "The nixbld$i user already exists. This install cannot proceed."
12 exit 1
13 fi
14 done
15}
16
17create_users () {
18 # Create a nixbld group.
19 groupadd -r nixbld
20
21 # Create 10 nixbld{i} users
22 for i in {1..10}; do
23 useradd -g nixbld -G nixbld -r -N -M -d /var/empty -s /sbin/nologin nixbld$i
24 done
25}
26
27delete_users() {
28 # Remove the users
29 for i in {1..10}; do
30 userdel nixbld$i
31 done
32
33 # Remove the group
34 groupdel nixbld
35}
36
37create_store() {
38 # Create nix folders and set permissions
39 mkdir -p /nix/store
40 chown root.nixbld /nix/store
41 chmod 1775 /nix/store
42 mkdir -p -m 1777 /nix/var/nix/gcroots/per-user
43 mkdir -p -m 1777 /nix/var/nix/profiles/per-user
44}
45
46restore_store() {
47 # Restore folder permissions
48 chmod 755 /nix/store
49 chown root.root /nix/store
50}
51
52daemon_info() {
53 if [ ! -d /nix/var/nix/profiles/per-user/root ]; then
54 echo "To start the nix daemon, execute one of the following:"
55 echo
56 echo " systemctl enable nix-daemon.socket # Sets the daemon to start on next boot"
57 echo " systemctl enable --now nix-daemon.socket # Starts now and on next boot too"
58 echo
59 echo "Also, if this is a new install, you need to start a new login shell or otherwise"
60 echo
61 echo " source /etc/profile.d/nix.sh"
62 echo " source /etc/profile.d/nix-daemon.sh"
63 echo
64 echo "Once your environment is set-up, you will need to add some channels. You can see how"
65 echo "to do that here:"
66 echo " https://nixos.org/nix/manual/#sec-channels"
67 fi
68}
69
70post_install() {
71 create_users
72 create_store
73 daemon_info
74}
75
76pre_upgrade() {
77 systemctl stop nix-daemon.socket
78 systemctl stop nix-daemon
79}
80
81post_upgrade() {
82 delete_users
83 create_users
84 create_store
85 daemon_info
86}
87
88pre_remove() {
89 restore_store
90 delete_users
91}