1 # Copyright 1999-2018 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit autotools flag-o-matic readme.gentoo-r1 user
8 DESCRIPTION="A purely functional package manager"
9 HOMEPAGE="https://nixos.org/nix"
11 SRC_URI="http://nixos.org/releases/${PN}/${P}/${P}.tar.xz"
14 #keywords are blocked by boost-1.66
15 #KEYWORDS="~amd64 ~x86"
16 IUSE="+etc_profile +gc doc s3 sodium"
24 >=dev-libs/boost-1.66:0=[context]
28 gc? ( dev-libs/boehm-gc[cxx] )
29 doc? ( dev-libs/libxml2
31 app-text/docbook-xsl-stylesheets
33 s3? ( dev-libs/aws-sdk-cpp )
34 sodium? ( dev-libs/libsodium:0= )
38 >=sys-devel/flex-2.5.35
42 "${FILESDIR}"/${PN}-1.11.6-systemd.patch
43 "${FILESDIR}"/${PN}-1.11.6-respect-CXXFLAGS.patch
44 "${FILESDIR}"/${PN}-1.11.6-respect-LDFLAGS.patch
45 "${FILESDIR}"/${PN}-2.0-user-path.patch
48 DISABLE_AUTOFORMATTING=yes
49 DOC_CONTENTS=" Quick start user guide on Gentoo:
51 [as root] enable nix-daemon service:
52 [systemd] # systemctl enable nix-daemon
53 [openrc] # rc-update add nix-daemon
54 [as a user] relogin to get environment and profile update
55 [as a user] fetch nixpkgs update:
56 \$ nix-channel --update
57 [as a user] install nix packages:
59 [as a user] configure environment:
60 Somewhere in .bash_profile you might want to set
61 LOCALE_ARCHIVE=\$HOME/.nix-profile/lib/locale/locale-archive
62 but please read https://github.com/NixOS/nixpkgs/issues/21820
65 nix package manager user manual: http://nixos.org/nix/manual/
71 # we list 'nixbld' twice to
72 # both assign a primary group for user
73 # and add a user to /etc/group
74 enewuser nixbld${i} -1 -1 /var/empty nixbld,nixbld
88 # Disable automagic depend: bug #670256
89 export ac_cv_header_aws_s3_S3Client_h=no
92 --localstatedir="${EPREFIX}"/nix/var \
99 OPTIMIZE=0 # disable hardcoded -O3
102 emake "${make_vars[@]}"
106 # TODO: emacs highlighter
109 readme.gentoo_create_doc
111 # here we use an eager variant of something that
112 # is lazily done by nix-daemon and root nix-env
114 # TODO: will need a tweak for prefix
116 fowners root:nixbld /nix/store
117 fperms 1775 /nix/store
119 keepdir /nix/var/nix/channel-cache
120 fperms 0777 /nix/var/nix/channel-cache
122 keepdir /nix/var/nix/profiles/per-user
123 fperms 1777 /nix/var/nix/profiles/per-user
125 # setup directories nix-daemon: /etc/profile.d/nix-daemon.sh
126 keepdir /nix/var/nix/gcroots/per-user
127 fperms 1777 /nix/var/nix/gcroots/per-user
129 newinitd "${FILESDIR}"/nix-daemon.initd nix-daemon
131 if ! use etc_profile; then
132 rm "${ED}"/etc/profile.d/nix.sh || die
133 rm "${ED}"/etc/profile.d/nix-daemon.sh || die
138 if ! use etc_profile; then
139 ewarn "${EROOT}etc/profile.d/nix.sh was removed (due to USE=-etc_profile)."
142 readme.gentoo_print_elog