File tree 7 files changed +12
-23
lines changed
7 files changed +12
-23
lines changed Original file line number Diff line number Diff line change 9
9
# then your CI will be able to build and cache only those packages for
10
10
# which this is possible.
11
11
12
- { pkgs ? import <nixpkgs> { } } :
12
+ { pkgs ? import <nixpkgs> { } } :
13
13
14
14
with builtins ;
15
-
16
15
let
17
-
18
16
isReserved = n : n == "lib" || n == "overlays" || n == "modules" ;
19
17
isDerivation = p : isAttrs p && p ? type && p . type == "derivation" ;
20
18
isBuildable = p : ! ( p . meta . broken or false ) && p . meta . license . free or true ;
29
27
let
30
28
f = p :
31
29
if shouldRecurseForDerivations p then flattenPkgs p
32
- else if isDerivation p then [ p ]
33
- else [ ] ;
30
+ else if isDerivation p then [ p ]
31
+ else [ ] ;
34
32
in
35
- concatMap f ( attrValues s ) ;
33
+ concatMap f ( attrValues s ) ;
36
34
37
35
outputsOf = p : map ( o : p . ${ o } ) p . outputs ;
38
36
39
37
nurAttrs = import ./default.nix { inherit pkgs ; } ;
40
38
41
39
nurPkgs =
42
40
flattenPkgs
43
- ( listToAttrs
44
- ( map ( n : nameValuePair n nurAttrs . ${ n } )
45
- ( filter ( n : ! isReserved n )
46
- ( attrNames nurAttrs ) ) ) ) ;
41
+ ( listToAttrs
42
+ ( map ( n : nameValuePair n nurAttrs . ${ n } )
43
+ ( filter ( n : ! isReserved n )
44
+ ( attrNames nurAttrs ) ) ) ) ;
47
45
48
46
in
49
-
50
47
rec {
51
48
buildPkgs = filter isBuildable nurPkgs ;
52
49
cachePkgs = filter isCacheable buildPkgs ;
Original file line number Diff line number Diff line change 6
6
# commands such as:
7
7
# nix-build -A mypackage
8
8
9
- { pkgs ? import <nixpkgs> { } } :
9
+ { pkgs ? import <nixpkgs> { } } :
10
10
11
11
{
12
12
# The `lib`, `modules`, and `overlay` names are special
18
18
# some-qt5-package = pkgs.libsForQt5.callPackage ./pkgs/some-qt5-package { };
19
19
# ...
20
20
}
21
-
Original file line number Diff line number Diff line change @@ -5,4 +5,3 @@ with pkgs.lib; {
5
5
#
6
6
# hexint = x: hexvals.${toLower x};
7
7
}
8
-
Original file line number Diff line number Diff line change 3
3
#
4
4
# my-module = ./my-module;
5
5
}
6
-
Original file line number Diff line number Diff line change 3
3
# configuration.
4
4
5
5
self : super :
6
-
7
6
let
8
-
9
7
isReserved = n : n == "lib" || n == "overlays" || n == "modules" ;
10
8
nameValuePair = n : v : { name = n ; value = v ; } ;
11
9
nurAttrs = import ./default.nix { pkgs = super ; } ;
12
10
13
11
in
14
-
15
- builtins . listToAttrs
12
+ builtins . listToAttrs
16
13
( map ( n : nameValuePair n nurAttrs . ${ n } )
17
- ( builtins . filter ( n : ! isReserved n )
18
- ( builtins . attrNames nurAttrs ) ) )
14
+ ( builtins . filter ( n : ! isReserved n )
15
+ ( builtins . attrNames nurAttrs ) ) )
Original file line number Diff line number Diff line change 3
3
#
4
4
# my-overlay = import ./my-overlay;
5
5
}
6
-
Original file line number Diff line number Diff line change @@ -7,4 +7,3 @@ stdenv.mkDerivation rec {
7
7
buildPhase = "echo echo Hello World > example" ;
8
8
installPhase = "install -Dm755 example $out" ;
9
9
}
10
-
You can’t perform that action at this time.
0 commit comments