Fix GitHub test

This commit is contained in:
Eelco Dolstra 2019-11-06 14:48:35 +01:00
parent f01304b573
commit 850f73045f
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
2 changed files with 19 additions and 25 deletions

View file

@ -2,9 +2,9 @@
"inputs": {
"nixpkgs": {
"inputs": {},
"narHash": "sha256-D1YSQzR6Xo2cNZ4sf+WCak2fqE/CIbwpZbPKd2B2Syc=",
"narHash": "sha256-ZzR2l1dovxeZ555KXxz7SAXrC72BfaR4BeqvJzRdmwQ=",
"originalUrl": "nixpkgs/release-19.09",
"url": "github:edolstra/nixpkgs/e3d44c4fc62c99b850c792429cb61b946b66a704"
"url": "github:edolstra/nixpkgs/d37927a77e70a2b3408ceaa2e763b6df1f4d941a"
}
},
"version": 3

View file

@ -37,15 +37,18 @@ let
destination = "/flake-registry.json";
};
tarball = pkgs.runCommand "nixpkgs-flake" {}
api = pkgs.runCommand "nixpkgs-flake" {}
''
mkdir $out
mkdir -p $out/tarball
dir=NixOS-nixpkgs-${nixpkgs.shortRev}
cp -prd ${nixpkgs} $dir
# Set the correct timestamp in the tarball.
find $dir -print0 | xargs -0 touch -t ${builtins.substring 0 12 nixpkgs.lastModified}.${builtins.substring 12 2 nixpkgs.lastModified} --
tar cfz $out/${nixpkgs.rev} $dir
ln -s ${nixpkgs.rev} $out/master
tar cfz $out/tarball/${nixpkgs.rev} $dir
mkdir -p $out/commits
echo '{"sha": "${nixpkgs.rev}"}' > $out/commits/master
'';
in
@ -70,6 +73,11 @@ makeTest (
enableSSL = true;
sslServerKey = "${cert}/server.key";
sslServerCert = "${cert}/server.crt";
servedDirs =
[ { urlPath = "/NixOS/flake-registry/raw/master";
dir = registry;
}
];
}
{ hostName = "api.github.com";
@ -77,23 +85,8 @@ makeTest (
sslServerKey = "${cert}/server.key";
sslServerCert = "${cert}/server.crt";
servedDirs =
[ { urlPath = "/repos/NixOS/nixpkgs/tarball";
dir = tarball;
}
];
extraConfig =
''
Header set ETag "\"${nixpkgs.rev}\""
'';
}
{ hostName = "raw.githubusercontent.com";
enableSSL = true;
sslServerKey = "${cert}/server.key";
sslServerCert = "${cert}/server.crt";
servedDirs =
[ { urlPath = "/NixOS/flake-registry/master";
dir = registry;
[ { urlPath = "/repos/NixOS/nixpkgs";
dir = api;
}
];
}
@ -101,10 +94,11 @@ makeTest (
};
client =
{ config, pkgs, nodes, ... }:
{ config, lib, pkgs, nodes, ... }:
{ virtualisation.writableStore = true;
virtualisation.pathsInNixDB = [ pkgs.hello pkgs.fuse ];
nix.binaryCaches = [ ];
nix.binaryCaches = lib.mkForce [ ];
nix.extraOptions = "experimental-features = nix-command flakes";
environment.systemPackages = [ pkgs.jq ];
networking.hosts.${(builtins.head nodes.github.config.networking.interfaces.eth1.ipv4.addresses).address} =
[ "github.com" "api.github.com" "raw.githubusercontent.com" ];