mirror of
https://github.com/NixOS/nix.git
synced 2025-11-24 19:29:36 +01:00
Try to replicate as closely as possible the CI setup
So that the hashes match
This commit is contained in:
parent
ec42ef03a5
commit
274a7be8d5
2 changed files with 12 additions and 18 deletions
|
|
@ -6,7 +6,7 @@ set -x;
|
|||
CurrentNixDir=$(pwd)
|
||||
CurrentRev=${GITHUB_SHA:-$(git rev-parse HEAD)}
|
||||
WorkDir=$(mktemp -d)
|
||||
trap 'rm -r "$WorkDir"' EXIT
|
||||
trap 'rm -rf "$WorkDir"' EXIT
|
||||
GITHUB_TOKEN_OPTION=()
|
||||
if [[ -n "${GITHUB_TOKEN:-}" ]]; then
|
||||
GITHUB_TOKEN_OPTION=("--option" "access-tokens" "github.com=$GITHUB_TOKEN")
|
||||
|
|
@ -14,20 +14,16 @@ fi
|
|||
|
||||
pushd "$WorkDir"
|
||||
|
||||
cat <<EOF > flake.nix
|
||||
{
|
||||
inputs.currentNix.url = "git+file://$CurrentNixDir?rev=$CurrentRev";
|
||||
inputs.nixMaster.url = "github:nixos/nix";
|
||||
git clone "https://github.com/nixos/nix"
|
||||
|
||||
outputs = { self, currentNix, nixMaster }: {
|
||||
checks = builtins.mapAttrs (systemName: _:
|
||||
{ againstMaster = currentNix.lib.testAgainst.\${systemName} nixMaster.defaultPackage.\${systemName}; }
|
||||
) currentNix.defaultPackage;
|
||||
};
|
||||
}
|
||||
cat <<EOF > default.nix
|
||||
let
|
||||
currentNix = import $CurrentNixDir;
|
||||
masterNix = import ./nix;
|
||||
in
|
||||
currentNix.lib.testAgainst.\${builtins.currentSystem} masterNix.defaultPackage.\${builtins.currentSystem}
|
||||
EOF
|
||||
nix flake check\
|
||||
--experimental-features 'nix-command flakes' \
|
||||
"${GITHUB_TOKEN_OPTION[@]}"
|
||||
|
||||
nix-build "${GITHUB_TOKEN_OPTION[@]}"
|
||||
|
||||
popd
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue