-
Notifications
You must be signed in to change notification settings - Fork 9
/
shell.nix
50 lines (42 loc) · 1.15 KB
/
shell.nix
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{ pkgs ? import (import ./nixpkgs.nix) { config.allowUnfree = true; } }:
let
myTerraform = pkgs.terraform.withPlugins (tp: [ tp.libvirt ]);
ter = pkgs.writeShellScriptBin "ter" ''
${myTerraform}/bin/terraform $@ && \
${myTerraform}/bin/terraform show -json > show.json
'';
ci-lint = pkgs.writeShellScriptBin "ci-lint" ''
echo Checking the formatting of Nix files
${pkgs.nixpkgs-fmt}/bin/nixpkgs-fmt --check **/*.nix
echo
echo Checking the formatting of Terraform files
${myTerraform}/bin/terraform fmt -check -recursive
'';
k = pkgs.writeShellScriptBin "k" ''
kubectl --kubeconfig certs/generated/kubernetes/admin.kubeconfig $@
'';
make-boot-image = pkgs.writeShellScriptBin "make-boot-image" ''
nix-build -o boot/image boot/image.nix
'';
make-certs = pkgs.writeShellScriptBin "make-certs" ''
$(nix-build --no-out-link certs)/bin/generate-certs
'';
in
pkgs.mkShell {
buildInputs = with pkgs; [
# software for deployment
colmena
jq
libxslt
myTerraform
# software for testing
etcd
kubectl
# scripts
ci-lint
k
make-boot-image
make-certs
ter
];
}