terraform: use one devshell for terraform
our terraform targets are similar enough that we can just share devShell between them
Jörg Thalheim committed
Aug 18, 2024 at 08:30 UTC
c183e6d36aed69cd9f4880ea60b3e6c38f642090
6 files changed
+11
-60
flake.nix
+1
-1
@@ -17,7 +17,7 @@
17
];
18
imports = [
19
./formatter/flake-module.nix
20
- ./terraform-iam/flake-module.nix
20
+ ./terraform/flake-module.nix
21
];
22
};
23
terraform-iam/.envrc
+1
-1
@@ -1,4 +1,4 @@
1
-use flake .#terraform-iam
1
+use flake .#terraform
2
3
export AWS_CONFIG_FILE=$PWD/aws-config
4
export AWS_PROFILE=nixos-prod
terraform/.envrc
+1
-1
@@ -1,4 +1,4 @@
1
-use flake
1
+use flake .#terraform
2
3
export AWS_CONFIG_FILE=$PWD/aws-config
4
export AWS_PROFILE=nixos-prod
terraform/flake-module.nix
renamed
+8
-1
@@ -11,7 +11,7 @@ in
11
perSystem =
12
{ pkgs, ... }:
13
{
14
- devShells.terraform-iam = pkgs.mkShellNoCC {
14
+ devShells.terraform = pkgs.mkShellNoCC {
15
packages = [
16
pkgs.awscli2
17
(pkgs.opentofu.withPlugins (
@@ -22,6 +22,13 @@ in
22
p.netlify
23
p.secret
24
]
25
+ ++ [
26
+ # FIXME: for our `terraform` target our state file still uses the old registry prefix
27
+ p.aws
28
+ p.fastly
29
+ p.netlify
30
+ p.secret
31
+ ]
32
))
33
];
34
};
terraform/flake.lock
deleted
-26
@@ -1,26 +0,0 @@
1
-{
2
- "nodes": {
3
- "nixpkgs": {
4
- "locked": {
5
- "lastModified": 1722389349,
6
- "narHash": "sha256-6RB4fa0fExLZ/Hp3KY6c6BSkGS6TCY1ZBRoC9y4ftr0=",
7
- "owner": "NixOS",
8
- "repo": "nixpkgs",
9
- "rev": "7b0cb66ad81ebc390ece3c73977e46090b22fbd1",
10
- "type": "github"
11
- },
12
- "original": {
13
- "id": "nixpkgs",
14
- "ref": "master",
15
- "type": "indirect"
16
- }
17
- },
18
- "root": {
19
- "inputs": {
20
- "nixpkgs": "nixpkgs"
21
- }
22
- }
23
- },
24
- "root": "root",
25
- "version": 7
26
-}
terraform/flake.nix
deleted
-30
@@ -1,30 +0,0 @@
1
-{
2
- inputs.nixpkgs.url = "nixpkgs/master";
3
-
4
- outputs =
5
- { nixpkgs }:
6
- {
7
-
8
- devShell.x86_64-linux =
9
- with import nixpkgs { system = "x86_64-linux"; };
10
- mkShell {
11
- packages = [
12
- awscli2
13
- (opentofu.withPlugins (
14
- p: with p; [
15
- aws
16
- fastly
17
- netlify
18
- secret
19
- ]
20
- ))
21
- ];
22
-
23
- shellHook = ''
24
- alias tf=tofu
25
- '';
26
- };
27
-
28
- };
29
-
30
-}