ci: Moved away from shell based generation

This commit is contained in:
kat witch 2021-05-15 01:49:27 +01:00
parent 9c945dbf4d
commit 8d519e163e
No known key found for this signature in database
GPG key ID: 1B477797DCA5EC72
2 changed files with 2 additions and 23 deletions

View file

@ -1,30 +1,9 @@
{ }: let
config = import ./default.nix;
tf = config.deploy.tf {};
gh-actions-generate = config.pkgs.writeShellScriptBin "gh-actions-generate" ''
#!/usr/bin/env bash
export CI_ROOT=./;
export CI_CONFIG_ROOT=./ci;
CI_CONFIG_FILES=($CI_CONFIG_ROOT/hosts.nix)
for f in "''${CI_CONFIG_FILES[@]}"; do
nix run --arg config $f ci.run.gh-actions-generate
done
'';
test-all = config.pkgs.writeShellScriptBin "test-all" ''
#!/usr/bin/env bash
export CI_ROOT=./;
export CI_CONFIG_ROOT=./ci;
CI_CONFIG_FILES=($CI_CONFIG_ROOT/hosts.nix)
for f in "''${CI_CONFIG_FILES[@]}"; do
nix run --arg config $f ci.test || break
done
'';
inherit (config) pkgs;
in pkgs.mkShell {
nativeBuildInputs = [
gh-actions-generate
test-all
] ++ config.runners.lazy.nativeBuildInputs;
nativeBuildInputs = config.runners.lazy.nativeBuildInputs;
HISTFILE = toString (tf.terraform.baseDir + "/.history");
CI_PLATFORM = "impure"; # use host's nixpkgs for more convenient testing