Skip to content

Commit 2d447c9

Browse files
committed
add flake
1 parent 96cf311 commit 2d447c9

2 files changed

Lines changed: 106 additions & 0 deletions

File tree

flake.lock

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
description = "How the clouds are made";
3+
4+
inputs = {
5+
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
6+
flake-utils.url = "github:numtide/flake-utils";
7+
};
8+
9+
outputs = {
10+
self,
11+
nixpkgs,
12+
flake-utils,
13+
}:
14+
flake-utils.lib.eachDefaultSystem (system: let
15+
lib = nixpkgs.lib;
16+
pkgs = import nixpkgs {
17+
inherit system;
18+
config.allowUnfreePredicate = pkg:
19+
builtins.elem (lib.getName pkg) [
20+
"vault"
21+
];
22+
};
23+
in rec {
24+
apps = {
25+
check = flake-utils.lib.mkApp { drv = packages.check; };
26+
};
27+
devShells.eks = pkgs.mkShell {
28+
buildInputs = [pkgs.awscli pkgs.opentofu pkgs.kubectl];
29+
};
30+
formatter = pkgs.alejandra;
31+
packages = {
32+
check = pkgs.writeShellApplication {
33+
name = "byoc-check";
34+
runtimeInputs = [pkgs.opentofu pkgs.docker-compose];
35+
text = ''
36+
pushd eks
37+
tofu init -backend=false
38+
tofu validate
39+
popd && pushd docker
40+
docker compose -f docker-compose.yml --env-file secrets-example.env --env-file .env config -q
41+
'';
42+
};
43+
};
44+
});
45+
}

0 commit comments

Comments
 (0)