@ -13,153 +13,154 @@ let
sh = busybox-sandbox-shell ;
common = { name , suffix ? " " , src , fromGit ? false }: stdenv . mkDerivation rec {
inherit name src ;
version = lib . getVersion name ;
is20 = lib . versionAtLeast version " 2 . 0 p r e " ;
VERSION_SUFFIX = lib . optionalString fromGit suffix ;
outputs = [ " o u t " " d e v " " m a n " " d o c " ] ;
nativeBuildInputs =
[ pkgconfig ]
++ lib . optionals ( ! is20 ) [ curl perl ]
++ lib . optionals fromGit [ autoreconfHook autoconf-archive bison flex libxml2 libxslt docbook5 docbook_xsl_ns ] ;
buildInputs = [ curl openssl sqlite xz bzip2 ]
++ lib . optional ( stdenv . isLinux || stdenv . isDarwin ) libsodium
++ lib . optionals is20 [ brotli boost editline ]
++ lib . optional withLibseccomp libseccomp
++ lib . optional ( withAWS && is20 )
( ( aws-sdk-cpp . override {
apis = [ " s 3 " " t r a n s f e r " ] ;
customMemoryManagement = false ;
} ) . overrideDerivation ( args : {
patches = args . patches or [ ] ++ [ ( fetchpatch {
url = https://github.com/edolstra/aws-sdk-cpp/commit/7d58e303159b2fb343af9a1ec4512238efa147c7.patch ;
sha256 = " 1 0 3 p h n 6 k y v s 1 y c 7 f i b y i n 3 l g x z 6 9 9 q a k h w 6 7 1 k l 2 0 7 4 8 4 i m 5 5 i d 1 " ;
} ) ] ;
} ) ) ;
propagatedBuildInputs = [ boehmgc ] ;
# Seems to be required when using std::atomic with 64-bit types
NIX_LDFLAGS = lib . optionalString ( stdenv . hostPlatform . system == " a r m v 6 l - l i n u x " ) " - l a t o m i c " ;
preConfigure =
# Copy libboost_context so we don't get all of Boost in our closure.
# https://github.com/NixOS/nixpkgs/issues/45462
if is20 then ''
mkdir - p $ out/lib
cp $ { boost } /lib/libboost_context * $ out/lib
'' e l s e ''
configureFlagsArray + = ( BDW_GC_LIBS = " - l g c - l g c c p p " )
common = { name , suffix ? " " , src , fromGit ? false }:
let nix = stdenv . mkDerivation rec {
inherit name src ;
version = lib . getVersion name ;
is20 = lib . versionAtLeast version " 2 . 0 p r e " ;
VERSION_SUFFIX = lib . optionalString fromGit suffix ;
outputs = [ " o u t " " d e v " " m a n " " d o c " ] ;
nativeBuildInputs =
[ pkgconfig ]
++ lib . optionals ( ! is20 ) [ curl perl ]
++ lib . optionals fromGit [ autoreconfHook autoconf-archive bison flex libxml2 libxslt docbook5 docbook_xsl_ns ] ;
buildInputs = [ curl openssl sqlite xz bzip2 ]
++ lib . optional ( stdenv . isLinux || stdenv . isDarwin ) libsodium
++ lib . optionals is20 [ brotli boost editline ]
++ lib . optional withLibseccomp libseccomp
++ lib . optional ( withAWS && is20 )
( ( aws-sdk-cpp . override {
apis = [ " s 3 " " t r a n s f e r " ] ;
customMemoryManagement = false ;
} ) . overrideDerivation ( args : {
patches = args . patches or [ ] ++ [ ( fetchpatch {
url = https://github.com/edolstra/aws-sdk-cpp/commit/7d58e303159b2fb343af9a1ec4512238efa147c7.patch ;
sha256 = " 1 0 3 p h n 6 k y v s 1 y c 7 f i b y i n 3 l g x z 6 9 9 q a k h w 6 7 1 k l 2 0 7 4 8 4 i m 5 5 i d 1 " ;
} ) ] ;
} ) ) ;
propagatedBuildInputs = [ boehmgc ] ;
# Seems to be required when using std::atomic with 64-bit types
NIX_LDFLAGS = lib . optionalString ( stdenv . hostPlatform . system == " a r m v 6 l - l i n u x " ) " - l a t o m i c " ;
preConfigure =
# Copy libboost_context so we don't get all of Boost in our closure.
# https://github.com/NixOS/nixpkgs/issues/45462
if is20 then ''
mkdir - p $ out/lib
cp $ { boost } /lib/libboost_context * $ out/lib
'' e l s e ''
configureFlagsArray + = ( BDW_GC_LIBS = " - l g c - l g c c p p " )
'' ;
configureFlags =
[ " - - w i t h - s t o r e - d i r = ${ storeDir } "
" - - l o c a l s t a t e d i r = ${ stateDir } "
" - - s y s c o n f d i r = ${ confDir } "
" - - d i s a b l e - i n i t - s t a t e "
" - - e n a b l e - g c "
]
++ lib . optionals ( ! is20 ) [
" - - w i t h - d b i = ${ perlPackages . DBI } / ${ perl . libPrefix } "
" - - w i t h - d b d - s q l i t e = ${ perlPackages . DBDSQLite } / ${ perl . libPrefix } "
" - - w i t h - w w w - c u r l = ${ perlPackages . WWWCurl } / ${ perl . libPrefix } "
] ++ lib . optionals ( is20 && stdenv . isLinux ) [
" - - w i t h - s a n d b o x - s h e l l = ${ sh } / b i n / b u s y b o x "
]
++ lib . optional (
stdenv . hostPlatform != stdenv . buildPlatform && stdenv . hostPlatform ? nix && stdenv . hostPlatform . nix ? system
) '' - - w i t h - s y s t e m = ${ stdenv . hostPlatform . nix . system } ''
# RISC-V support in progress https://github.com/seccomp/libseccomp/pull/50
++ lib . optional ( ! withLibseccomp ) " - - d i s a b l e - s e c c o m p - s a n d b o x i n g " ;
makeFlags = " p r o f i l e d i r = $ ( o u t ) / e t c / p r o f i l e . d " ;
installFlags = " s y s c o n f d i r = $ ( o u t ) / e t c " ;
doInstallCheck = true ; # not cross
# socket path becomes too long otherwise
preInstallCheck = lib . optional stdenv . isDarwin ''
export TMPDIR = $ NIX_BUILD_TOP
'' ;
configureFlags =
[ " - - w i t h - s t o r e - d i r = ${ storeDir } "
" - - l o c a l s t a t e d i r = ${ stateDir } "
" - - s y s c o n f d i r = ${ confDir } "
" - - d i s a b l e - i n i t - s t a t e "
" - - e n a b l e - g c "
]
++ lib . optionals ( ! is20 ) [
" - - w i t h - d b i = ${ perlPackages . DBI } / ${ perl . libPrefix } "
" - - w i t h - d b d - s q l i t e = ${ perlPackages . DBDSQLite } / ${ perl . libPrefix } "
" - - w i t h - w w w - c u r l = ${ perlPackages . WWWCurl } / ${ perl . libPrefix } "
] ++ lib . optionals ( is20 && stdenv . isLinux ) [
" - - w i t h - s a n d b o x - s h e l l = ${ sh } / b i n / b u s y b o x "
]
++ lib . optional (
stdenv . hostPlatform != stdenv . buildPlatform && stdenv . hostPlatform ? nix && stdenv . hostPlatform . nix ? system
) '' - - w i t h - s y s t e m = ${ stdenv . hostPlatform . nix . system } ''
# RISC-V support in progress https://github.com/seccomp/libseccomp/pull/50
++ lib . optional ( ! withLibseccomp ) " - - d i s a b l e - s e c c o m p - s a n d b o x i n g " ;
makeFlags = " p r o f i l e d i r = $ ( o u t ) / e t c / p r o f i l e . d " ;
installFlags = " s y s c o n f d i r = $ ( o u t ) / e t c " ;
doInstallCheck = true ; # not cross
# socket path becomes too long otherwise
preInstallCheck = lib . optional stdenv . isDarwin ''
export TMPDIR = $ NIX_BUILD_TOP
'' ;
separateDebugInfo = stdenv . isLinux ;
enableParallelBuilding = true ;
meta = {
description = " P o w e r f u l p a c k a g e m a n a g e r t h a t m a k e s p a c k a g e m a n a g e m e n t r e l i a b l e a n d r e p r o d u c i b l e " ;
longDescription = ''
Nix is a powerful package manager for Linux and other Unix systems that
makes package management reliable and reproducible . It provides atomic
upgrades and rollbacks , side-by-side installation of multiple versions of
a package , multi-user package management and easy setup of build
environments .
'' ;
homepage = https://nixos.org/ ;
license = stdenv . lib . licenses . lgpl2Plus ;
maintainers = [ stdenv . lib . maintainers . eelco ] ;
platforms = stdenv . lib . platforms . all ;
outputsToInstall = [ " o u t " " m a n " ] ;
separateDebugInfo = stdenv . isLinux ;
enableParallelBuilding = true ;
meta = {
description = " P o w e r f u l p a c k a g e m a n a g e r t h a t m a k e s p a c k a g e m a n a g e m e n t r e l i a b l e a n d r e p r o d u c i b l e " ;
longDescription = ''
Nix is a powerful package manager for Linux and other Unix systems that
makes package management reliable and reproducible . It provides atomic
upgrades and rollbacks , side-by-side installation of multiple versions of
a package , multi-user package management and easy setup of build
environments .
'' ;
homepage = https://nixos.org/ ;
license = stdenv . lib . licenses . lgpl2Plus ;
maintainers = [ stdenv . lib . maintainers . eelco ] ;
platforms = stdenv . lib . platforms . all ;
outputsToInstall = [ " o u t " " m a n " ] ;
} ;
passthru = {
inherit fromGit ;
perl-bindings = stdenv . mkDerivation {
name = " n i x - p e r l - ${ version } " ;
inherit src ;
postUnpack = " s o u r c e R o o t = $ s o u r c e R o o t / p e r l " ;
# This is not cross-compile safe, don't have time to fix right now
# but noting for future travellers.
nativeBuildInputs =
[ perl pkgconfig curl nix libsodium ]
++ lib . optionals fromGit [ autoreconfHook autoconf-archive ]
++ lib . optional is20 boost ;
configureFlags =
[ " - - w i t h - d b i = ${ perlPackages . DBI } / ${ perl . libPrefix } "
" - - w i t h - d b d - s q l i t e = ${ perlPackages . DBDSQLite } / ${ perl . libPrefix } "
] ;
preConfigure = " e x p o r t N I X _ S T A T E _ D I R = $ T M P D I R " ;
preBuild = " u n s e t N I X _ I N D E N T _ M A K E " ;
} ;
} ;
} ;
passthru = { inherit fromGit ; } ;
} ;
perl-bindings = { nix , needsBoost ? false }: stdenv . mkDerivation {
name = " n i x - p e r l - " + nix . version ;
inherit ( nix ) src ;
postUnpack = " s o u r c e R o o t = $ s o u r c e R o o t / p e r l " ;
# This is not cross-compile safe, don't have time to fix right now
# but noting for future travellers.
nativeBuildInputs =
[ perl pkgconfig curl nix libsodium ]
++ lib . optionals nix . fromGit [ autoreconfHook autoconf-archive ]
++ lib . optional needsBoost boost ;
configureFlags =
[ " - - w i t h - d b i = ${ perlPackages . DBI } / ${ perl . libPrefix } "
" - - w i t h - d b d - s q l i t e = ${ perlPackages . DBDSQLite } / ${ perl . libPrefix } "
] ;
preConfigure = " e x p o r t N I X _ S T A T E _ D I R = $ T M P D I R " ;
preBuild = " u n s e t N I X _ I N D E N T _ M A K E " ;
} ;
in nix ;
in rec {
nix = nixStable ;
nix1 = ( common rec {
nix1 = common rec {
name = " n i x - 1 . 1 1 . 1 6 " ;
src = fetchurl {
url = " h t t p : / / n i x o s . o r g / r e l e a s e s / n i x / ${ name } / ${ name } . t a r . x z " ;
sha256 = " 0 c a 5 7 8 2 f c 3 7 d 6 2 2 3 8 d 1 3 a 6 2 0 a 7 b 4 b f f 6 a 2 0 0 b a b 1 b d 6 3 0 0 3 7 0 9 2 4 9 a 7 7 6 1 6 2 3 5 7 c " ;
} ;
} ) // { perl-bindings = nix1 ; } ;
} ;
nixStable = ( common rec {
nixStable = common rec {
name = " n i x - 2 . 2 " ;
src = fetchurl {
url = " h t t p : / / n i x o s . o r g / r e l e a s e s / n i x / ${ name } / ${ name } . t a r . x z " ;
sha256 = " 6 3 2 3 8 d 0 0 d 2 9 0 b 8 a 9 3 9 2 5 8 9 1 f c 9 1 6 4 4 3 9 d 3 9 4 1 e 2 c c c 5 6 9 b f 7 f 7 c a 3 2 f 5 3 c 3 e c 0 c 7 " ;
} ;
} ) // { perl-bindings = perl-bindings {
nix = nixStable ;
needsBoost = true ;
} ; } ;
} ;
nixUnstable = ( lib . lowPrio ( common rec {
nixUnstable = lib . lowPrio ( common rec {
name = " n i x - 2 . 2 ${ suffix } " ;
suffix = " p r e 6 6 0 0 _ 8 5 4 8 8 a 9 3 " ;
src = fetchFromGitHub {
@ -169,9 +170,6 @@ in rec {
sha256 = " 1 n 5 d p 7 p 2 l z p n j 7 f 8 3 4 d 2 5 k 0 2 0 v 1 6 g n n s m 5 6 j z 4 6 y 8 7 v 2 x 7 b 6 9 c c m " ;
} ;
fromGit = true ;
} ) ) // { perl-bindings = perl-bindings {
nix = nixUnstable ;
needsBoost = true ;
} ; } ;
} ) ;
}