3
3
aws-sdk-cpp ,
4
4
boehmgc ,
5
5
callPackage ,
6
+ fetchgit ,
6
7
fetchFromGitHub ,
7
8
rustPlatform ,
8
9
Security ,
10
+ newScope ,
9
11
10
12
storeDir ? "/nix/store" ,
11
13
stateDir ? "/nix/var" ,
12
14
confDir ? "/etc" ,
13
15
} :
14
16
let
15
- boehmgc-nix_2_3 = boehmgc . override { enableLargeConfig = true ; } ;
16
-
17
- boehmgc-nix = boehmgc-nix_2_3 . overrideAttrs ( drv : {
18
- patches = ( drv . patches or [ ] ) ++ [
19
- # Part of the GC solution in https://github.com/NixOS/nix/pull/4944
20
- ../nix/patches/boehmgc-coroutine-sp-fallback.patch
21
- ] ;
22
- } ) ;
23
-
24
- aws-sdk-cpp-nix =
25
- ( aws-sdk-cpp . override {
26
- apis = [
27
- "s3"
28
- "transfer"
29
- ] ;
30
- customMemoryManagement = false ;
31
- } ) . overrideAttrs
32
- {
33
- # only a stripped down version is build which takes a lot less resources to build
34
- requiredSystemFeatures = [ ] ;
35
- } ;
17
+ makeLixScope =
18
+ {
19
+ lix ,
20
+ nix-eval-jobs ,
21
+ } :
22
+ lib . makeScope newScope (
23
+ self :
24
+ lib . recurseIntoAttrs {
25
+ inherit
26
+ Security
27
+ storeDir
28
+ stateDir
29
+ confDir
30
+ ;
31
+
32
+ boehmgc =
33
+ # TODO: Why is this called `boehmgc-nix_2_3`?
34
+ let
35
+ boehmgc-nix_2_3 = boehmgc . override { enableLargeConfig = true ; } ;
36
+ in
37
+ # Since Lix 2.91 does not use boost coroutines, it does not need boehmgc patches either.
38
+ if lib . versionOlder lix . version "2.91" then
39
+ boehmgc-nix_2_3 . overrideAttrs ( drv : {
40
+ patches = ( drv . patches or [ ] ) ++ [
41
+ # Part of the GC solution in https://github.com/NixOS/nix/pull/4944
42
+ ../nix/patches/boehmgc-coroutine-sp-fallback.patch
43
+ ] ;
44
+ } )
45
+ else
46
+ boehmgc-nix_2_3 ;
47
+
48
+ aws-sdk-cpp =
49
+ ( aws-sdk-cpp . override {
50
+ apis = [
51
+ "s3"
52
+ "transfer"
53
+ ] ;
54
+ customMemoryManagement = false ;
55
+ } ) . overrideAttrs
56
+ {
57
+ # only a stripped down version is build which takes a lot less resources to build
58
+ requiredSystemFeatures = [ ] ;
59
+ } ;
60
+
61
+ # NOTE: The `common-*.nix` helpers contain a top-level function which
62
+ # takes the Lix source to build and version information. We use the
63
+ # outer `callPackage` for that.
64
+ #
65
+ # That *returns* another function which takes the actual build
66
+ # dependencies, and that uses the new scope's `self.callPackage` so
67
+ # that `nix-eval-jobs` can be built against the correct `lix` version.
68
+ lix = self . callPackage ( callPackage ./common-lix.nix lix ) { } ;
69
+
70
+ # TODO: Should this be named `lix-eval-jobs`?
71
+ nix-eval-jobs = self . callPackage ( callPackage ./common-nix-eval-jobs.nix nix-eval-jobs ) { } ;
72
+ }
73
+ ) ;
36
74
37
- # Since Lix 2.91 does not use boost coroutines, it does not need boehmgc patches either.
38
- needsBoehmgcPatches = version : lib . versionOlder version "2.91" ;
39
-
40
- common =
41
- args :
42
- callPackage ( import ./common.nix ( { inherit lib fetchFromGitHub ; } // args ) ) {
43
- inherit
44
- Security
45
- storeDir
46
- stateDir
47
- confDir
48
- ;
49
- boehmgc = if needsBoehmgcPatches args . version then boehmgc-nix else boehmgc-nix_2_3 ;
50
- aws-sdk-cpp = aws-sdk-cpp-nix ;
51
- } ;
52
75
in
53
76
lib . makeExtensible ( self : {
54
- buildLix = common ;
77
+ makeLixScope = makeLixScope ;
55
78
56
- lix_2_90 = (
57
- common rec {
79
+ "2.90" = self . makeLixScope {
80
+ lix = rec {
58
81
version = "2.90.0" ;
59
82
60
83
src = fetchFromGitHub {
@@ -71,11 +94,21 @@ lib.makeExtensible (self: {
71
94
sourceRoot = "${ src . name or src } /lix-doc" ;
72
95
hash = "sha256-VPcrf78gfLlkTRrcbLkPgLOk0o6lsOJBm6HYLvavpNU=" ;
73
96
} ;
74
- }
75
- ) ;
97
+ } ;
76
98
77
- lix_2_91 = (
78
- common rec {
99
+ nix-eval-jobs = {
100
+ version = "2.90.0" ;
101
+ src = fetchgit {
102
+ url = "https://git.lix.systems/lix-project/nix-eval-jobs.git" ;
103
+ # https://git.lix.systems/lix-project/nix-eval-jobs/commits/branch/release-2.90
104
+ rev = "9c23772cf25e0d891bef70b7bcb7df36239672a5" ;
105
+ hash = "sha256-oT273pDmYzzI7ACAFUOcsxtT6y34V5KF7VBSqTza7j8=" ;
106
+ } ;
107
+ } ;
108
+ } ;
109
+
110
+ "2.91" = self . makeLixScope {
111
+ lix = rec {
79
112
version = "2.91.1" ;
80
113
81
114
src = fetchFromGitHub {
@@ -92,9 +125,35 @@ lib.makeExtensible (self: {
92
125
sourceRoot = "${ src . name or src } /lix-doc" ;
93
126
hash = "sha256-U820gvcbQIBaFr2OWPidfFIDXycDFGgXX1NpWDDqENs=" ;
94
127
} ;
95
- }
96
- ) ;
128
+ } ;
129
+
130
+ nix-eval-jobs = {
131
+ version = "2.91.0" ;
132
+ src = fetchgit {
133
+ url = "https://git.lix.systems/lix-project/nix-eval-jobs.git" ;
134
+ # https://git.lix.systems/lix-project/nix-eval-jobs/commits/branch/release-2.91
135
+ rev = "1f98b0c016a6285f29ad278fa5cd82b8f470d66a" ;
136
+ hash = "sha256-ZJKOC/iLuO8qjPi9/ql69Vgh3NIu0tU6CSI0vbiCrKA=" ;
137
+ } ;
138
+ } ;
139
+ } ;
97
140
98
- latest = self . lix_2_91 ;
99
- stable = self . lix_2_91 ;
141
+ latest = self . "2.91" ;
142
+ stable = self . "2.91" ;
143
+
144
+ # Previously, `nix-eval-jobs` was not packaged here, so we export an
145
+ # attribute with the previously-expected structure for compatibility. This
146
+ # is also available (for now) as `pkgs.lixVersions`.
147
+ renamedDeprecatedLixVersions =
148
+ let
149
+ mkAlias =
150
+ v1 : v2 : lib . warnOnInstantiate "'lixVersions.${ v1 } ' has been renamed to 'lixPackages_${ v2 } .lix'" ;
151
+ in
152
+ lib . dontRecurseIntoAttrs {
153
+ lix_2_90 = mkAlias "lix_2_90" "2_90" self . "2.90" . lix ;
154
+ lix_2_91 = mkAlias "lix_2_91" "2_91" self . "2.91" . lix ;
155
+ # NOTE: Do not add new versions of Lix here.
156
+ stable = mkAlias "stable" "stable" self . stable . lix ;
157
+ latest = mkAlias "latest" "latest" self . latest . lix ;
158
+ } ;
100
159
} )
0 commit comments