File tree Expand file tree Collapse file tree 2 files changed +81
-0
lines changed Expand file tree Collapse file tree 2 files changed +81
-0
lines changed Original file line number Diff line number Diff line change 11{
2+ self , # This flake
3+ system ,
24 lib ? pkgs . lib ,
35 helpers ,
46 pkgs ,
1618 module = {
1719 _file = file ;
1820 imports = [ module ] ;
21+ _module . args = {
22+ # Give tests access to the flake
23+ inherit self system ;
24+ inherit ( self ) inputs ;
25+ } ;
1926 } ;
2027 pkgs = pkgsUnfree ;
2128 } ;
Original file line number Diff line number Diff line change 1+ {
2+ # TODO: expect not setting `nixpkgs.pkgs` to throw
3+
4+ overlays =
5+ { pkgs , ... } :
6+ {
7+ test . runNvim = false ;
8+
9+ nixpkgs . overlays = [
10+ ( final : prev : {
11+ foobar = "foobar" ;
12+ } )
13+ ] ;
14+
15+ assertions = [
16+ {
17+ assertion = pkgs . foobar or null == "foobar" ;
18+ message = ''
19+ Expected `pkgs.foobar` to be "foobar"
20+ '' ;
21+ }
22+ ] ;
23+ } ;
24+
25+ # Test that overlays from both `nixpkgs.pkgs` _and_ `nixpkgs.overlays` are applied
26+ stacked_overlays =
27+ {
28+ inputs ,
29+ system ,
30+ pkgs ,
31+ ...
32+ } :
33+ {
34+ test . runNvim = false ;
35+
36+ nixpkgs . pkgs = import inputs . nixpkgs {
37+ inherit system ;
38+ overlays = [
39+ ( final : prev : {
40+ foobar = "foobar" ;
41+ conflict = "a" ;
42+ } )
43+ ] ;
44+ } ;
45+
46+ nixpkgs . overlays = [
47+ ( final : prev : {
48+ hello = "world" ;
49+ conflict = "b" ;
50+ } )
51+ ] ;
52+
53+ assertions = [
54+ {
55+ assertion = pkgs . foobar or null == "foobar" ;
56+ message = ''
57+ Expected `pkgs.foobar` to be "foobar"
58+ '' ;
59+ }
60+ {
61+ assertion = pkgs . hello or null == "world" ;
62+ message = ''
63+ Expected `pkgs.hello` to be "world"
64+ '' ;
65+ }
66+ {
67+ assertion = pkgs . conflict or null == "b" ;
68+ message = ''
69+ Expected `pkgs.conflict` to be "b"
70+ '' ;
71+ }
72+ ] ;
73+ } ;
74+ }
You can’t perform that action at this time.
0 commit comments