Skip to content

Commit 70b60bc

Browse files
committed
build(nix): add devshell to be able to launch a local dev shell from remote/local code
1 parent f1c64ed commit 70b60bc

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

flake.nix

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,18 @@
2525
};
2626
in
2727
{
28+
# Exposes the local plugin to be consumed as a package.
2829
packages = with pkgs.terraform-providers; {
2930
inherit sysdig;
3031
default = sysdig;
3132
};
33+
34+
# To be used with `nix run`.
3235
apps.terraform = flake-utils.lib.mkApp {
3336
drv = pkgs.terraform.withPlugins (tf: [ tf.sysdig ]);
3437
};
38+
39+
# Used for local development. Adds the required dependencies to work in this project.
3540
devShells.default =
3641
with pkgs;
3742
mkShell {
@@ -41,6 +46,21 @@
4146
];
4247
};
4348

49+
# Used with `nix develop <url/path>#terraform-with-plugin`.
50+
# You can load terraform with the sysdig plugin from a commit, a branch or a tag.
51+
# For instance:
52+
# - `nix develop github:sysdiglabs/terraform-provider-sysdig#terraform-with-plugin` will create a local dev shell with the version from the main branch.
53+
# - `nix develop github:sysdiglabs/terraform-provider-sysdig/branch-name#terraform-with-plugin` with create a local dev shell with the version from the `branch-name` branch code.
54+
# - `nix develop github:sysdiglabs/terraform-provider-sysdig/v1.2.3#terraform-with-plugin` will create a local dev shell with the version from the tag `v1.2.3` code (note the provided version is just an example).
55+
# - `nix develop .#terraform-with-plugin` will create a local dev shell with terraform with the local code.
56+
devShells.terraform-with-plugin =
57+
with pkgs;
58+
mkShell {
59+
packages = [
60+
(terraform.withPlugins (tf: [ tf.sysdig ]))
61+
];
62+
};
63+
4464
formatter = pkgs.nixfmt-rfc-style;
4565
}
4666
);

0 commit comments

Comments
 (0)