diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2019-11-06 14:48:35 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2019-11-06 14:48:35 +0100 |
commit | 850f73045f7d34c51bfd1cddfd2c4c0c61e15a36 (patch) | |
tree | 8250a9d930eea06a31de4fc2a5b14cab579b8284 /tests/github-flakes.nix | |
parent | f01304b57320423cbc16fcbd2311623007a1f720 (diff) |
Fix GitHub test
Diffstat (limited to 'tests/github-flakes.nix')
-rw-r--r-- | tests/github-flakes.nix | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/tests/github-flakes.nix b/tests/github-flakes.nix index 7211360cd..d9f7d71cd 100644 --- a/tests/github-flakes.nix +++ b/tests/github-flakes.nix @@ -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,30 +73,20 @@ makeTest ( enableSSL = true; sslServerKey = "${cert}/server.key"; sslServerCert = "${cert}/server.crt"; - } - - { hostName = "api.github.com"; - enableSSL = true; - sslServerKey = "${cert}/server.key"; - sslServerCert = "${cert}/server.crt"; servedDirs = - [ { urlPath = "/repos/NixOS/nixpkgs/tarball"; - dir = tarball; + [ { urlPath = "/NixOS/flake-registry/raw/master"; + dir = registry; } ]; - extraConfig = - '' - Header set ETag "\"${nixpkgs.rev}\"" - ''; } - { hostName = "raw.githubusercontent.com"; + { hostName = "api.github.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" ]; |