about summary refs log tree commit diff
path: root/ops/github/default.nix
blob: a36aa125bd85d5ae0f446219e6dc73fcd89a5081 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{ pkgs }:
let
  terraform = pkgs.terraform.withPlugins (p: [
    p.google
    p.github
  ]);
in
pkgs.stdenv.mkDerivation rec {
  name = "tf-github";
  src = ./.;

  init = pkgs.writeShellScriptBin "tf-github-init" ''
    set -ueo pipefail
    cd $(git rev-parse --show-toplevel)/ops/github
    ${terraform}/bin/terraform init
  '';

  plan = pkgs.writeShellScriptBin "tf-github-plan" ''
    set -ueo pipefail
    cd $(git rev-parse --show-toplevel)/ops/github
    ${terraform}/bin/terraform plan
  '';

  apply = pkgs.writeShellScriptBin "tf-github-apply" ''
    set -ueo pipefail
    cd $(git rev-parse --show-toplevel)/ops/github
    ${terraform}/bin/terraform apply
  '';
}