Skip to content

Commit

Permalink
build(nix): add package and app to bundle terraform with the provider
Browse files Browse the repository at this point in the history
  • Loading branch information
tembleking committed Dec 11, 2024
1 parent 3b305fd commit f1c64ed
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,6 @@ oanc
# Local test folder
local-terraform-test/
dist/

# Nix result
result
15 changes: 11 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
flake-utils,
}:
let
overlays.default = final: prev: { };
overlays.default = final: prev: {
terraform-providers = prev.terraform-providers // {
sysdig = prev.callPackage ./package.nix { };
};
};
flake = flake-utils.lib.eachDefaultSystem (
system:
let
Expand All @@ -21,9 +25,12 @@
};
in
{
packages = with pkgs; {
inherit terraform-provider-sysdig;
default = terraform-provider-sysdig;
packages = with pkgs.terraform-providers; {
inherit sysdig;
default = sysdig;
};
apps.terraform = flake-utils.lib.mkApp {
drv = pkgs.terraform.withPlugins (tf: [ tf.sysdig ]);
};
devShells.default =
with pkgs;
Expand Down
12 changes: 12 additions & 0 deletions package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
terraform-providers,
}:
terraform-providers.mkProvider {
owner = "sysdiglabs";
repo = "terraform-provider-sysdig";
homepage = "https://registry.terraform.io/providers/sysdiglabs/sysdig";
rev = "master";
vendorHash = "sha256-9ru4RkH2fDWcgM0I3URlWd811PwySktd+gLsEr624WM=";
hash = "";
mkProviderFetcher = { ... }: ./.;
}

0 comments on commit f1c64ed

Please sign in to comment.