mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
shell: HISTFILE, CI, runners
This commit is contained in:
parent
ea449f61f9
commit
4e775b6691
5 changed files with 68 additions and 16 deletions
27
shell.nix
27
shell.nix
|
|
@ -1,7 +1,30 @@
|
|||
with (import <nixpkgs> { });
|
||||
{ }: let
|
||||
config = import ./default.nix;
|
||||
tf = config.deploy.tf {};
|
||||
inherit (config) pkgs;
|
||||
in pkgs.mkShell {
|
||||
nativeBuildInputs = config.runners.lazy.nativeBuildInputs;
|
||||
HISTFILE = toString (tf.terraform.baseDir + "/.history");
|
||||
|
||||
CI_ROOT = toString ./.;
|
||||
CI_CONFIG_ROOT = toString ./ci;
|
||||
#CI_CONFIG = toString ./example/ci.nix
|
||||
CI_PLATFORM = "impure"; # use host's nixpkgs for more convenient testing
|
||||
|
||||
mkShell {
|
||||
shellHook = ''
|
||||
export HOME_HOSTNAME=$(hostname -s)
|
||||
export NIX_PATH="$NIX_PATH:nixfiles=${toString ./.}"
|
||||
|
||||
CI_CONFIG_FILES=($CI_CONFIG_ROOT/hosts.nix)
|
||||
gh-actions-generate() {
|
||||
for f in "''${CI_CONFIG_FILES[@]}"; do
|
||||
nix run --arg config $f ci.run.gh-actions-generate
|
||||
done
|
||||
}
|
||||
test-all() {
|
||||
for f in "''${CI_CONFIG_FILES[@]}"; do
|
||||
nix run --arg config $f ci.test || break
|
||||
done
|
||||
}
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue