Skip to content

Commit

Permalink
build(nix): add devshell to be able to launch a local dev shell from …
Browse files Browse the repository at this point in the history
…remote/local code
  • Loading branch information
tembleking committed Dec 11, 2024
1 parent f1c64ed commit 70b60bc
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,18 @@
};
in
{
# Exposes the local plugin to be consumed as a package.
packages = with pkgs.terraform-providers; {
inherit sysdig;
default = sysdig;
};

# To be used with `nix run`.
apps.terraform = flake-utils.lib.mkApp {
drv = pkgs.terraform.withPlugins (tf: [ tf.sysdig ]);
};

# Used for local development. Adds the required dependencies to work in this project.
devShells.default =
with pkgs;
mkShell {
Expand All @@ -41,6 +46,21 @@
];
};

# Used with `nix develop <url/path>#terraform-with-plugin`.
# You can load terraform with the sysdig plugin from a commit, a branch or a tag.
# For instance:
# - `nix develop github:sysdiglabs/terraform-provider-sysdig#terraform-with-plugin` will create a local dev shell with the version from the main branch.
# - `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.
# - `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).
# - `nix develop .#terraform-with-plugin` will create a local dev shell with terraform with the local code.
devShells.terraform-with-plugin =
with pkgs;
mkShell {
packages = [
(terraform.withPlugins (tf: [ tf.sysdig ]))
];
};

formatter = pkgs.nixfmt-rfc-style;
}
);
Expand Down

0 comments on commit 70b60bc

Please sign in to comment.