@@ -7,7 +7,7 @@ with import (nixpkgs + "/nixos/lib/testing-python.nix") {
7
7
8
8
let
9
9
10
- # Generate a fake root CA and a fake api.github.com / channels.nixos.org certificate.
10
+ # Generate a fake root CA and a fake api.github.com / github.com / channels.nixos.org certificate.
11
11
cert = pkgs . runCommand "cert" { buildInputs = [ pkgs . openssl ] ; }
12
12
''
13
13
mkdir -p $out
18
18
19
19
openssl req -newkey rsa:2048 -nodes -keyout $out/server.key \
20
20
-subj "/C=CN/ST=Denial/L=Springfield/O=Dis/CN=github.com" -out server.csr
21
- openssl x509 -req -extfile <(printf "subjectAltName=DNS:api.github.com,DNS:channels.nixos.org") \
21
+ openssl x509 -req -extfile <(printf "subjectAltName=DNS:api.github.com,DNS:github.com,DNS: channels.nixos.org") \
22
22
-days 36500 -in server.csr -CA $out/ca.crt -CAkey ca.key -CAcreateserial -out $out/server.crt
23
23
'' ;
24
24
47
47
48
48
api = pkgs . runCommand "nixpkgs-flake" { }
49
49
''
50
- mkdir -p $out/tarball
50
+ mkdir -p $out/commits
51
+ echo '{"sha": "${ nixpkgs . rev } "}' > $out/commits/HEAD
52
+ '' ;
53
+
54
+ archive = pkgs . runCommand "nixpkgs-flake" { }
55
+ ''
56
+ mkdir -p $out/archive
51
57
52
58
dir=NixOS-nixpkgs-${ nixpkgs . shortRev }
53
59
cp -prd ${ nixpkgs } $dir
54
60
# Set the correct timestamp in the tarball.
55
61
find $dir -print0 | xargs -0 touch -t ${ builtins . substring 0 12 nixpkgs . lastModifiedDate } .${ builtins . substring 12 2 nixpkgs . lastModifiedDate } --
56
- tar cfz $out/tarball/${ nixpkgs . rev } $dir --hard-dereference
57
-
58
- mkdir -p $out/commits
59
- echo '{"sha": "${ nixpkgs . rev } "}' > $out/commits/HEAD
62
+ tar cfz $out/archive/${ nixpkgs . rev } .tar.gz $dir --hard-dereference
60
63
'' ;
61
-
62
64
in
63
65
64
66
makeTest (
@@ -97,6 +99,16 @@ makeTest (
97
99
}
98
100
] ;
99
101
} ;
102
+ services . httpd . virtualHosts . "github.com" =
103
+ { forceSSL = true ;
104
+ sslServerKey = "${ cert } /server.key" ;
105
+ sslServerCert = "${ cert } /server.crt" ;
106
+ servedDirs =
107
+ [ { urlPath = "/NixOS/nixpkgs" ;
108
+ dir = archive ;
109
+ }
110
+ ] ;
111
+ } ;
100
112
} ;
101
113
102
114
client =
@@ -109,7 +121,7 @@ makeTest (
109
121
nix . extraOptions = "experimental-features = nix-command flakes" ;
110
122
environment . systemPackages = [ pkgs . jq ] ;
111
123
networking . hosts . ${ ( builtins . head nodes . github . config . networking . interfaces . eth1 . ipv4 . addresses ) . address } =
112
- [ "channels.nixos.org" "api.github.com" ] ;
124
+ [ "channels.nixos.org" "api.github.com" "github.com" ] ;
113
125
security . pki . certificateFiles = [ "${ cert } /ca.crt" ] ;
114
126
} ;
115
127
} ;
@@ -123,7 +135,7 @@ makeTest (
123
135
124
136
github.wait_for_unit("httpd.service")
125
137
126
- client.succeed("curl -v https://api. github.com/ >&2")
138
+ client.succeed("curl -v https://github.com/ >&2")
127
139
client.succeed("nix registry list | grep nixpkgs")
128
140
129
141
rev = client.succeed("nix flake info nixpkgs --json | jq -r .revision")
0 commit comments