diff options
-rw-r--r-- | flake.lock | 4 | ||||
-rw-r--r-- | tests/github-flakes.nix | 36 |
2 files changed, 17 insertions, 23 deletions
diff --git a/flake.lock b/flake.lock index 10c9921bf..5fe239aa0 100644 --- a/flake.lock +++ b/flake.lock @@ -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 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" ]; |