mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-11-26 01:56:13 +01:00
28 lines
497 B
Nix
28 lines
497 B
Nix
|
{ tflib
|
||
|
, pkgs
|
||
|
, config
|
||
|
}:
|
||
|
{
|
||
|
name
|
||
|
, source
|
||
|
}:
|
||
|
{
|
||
|
source =
|
||
|
let
|
||
|
module = (tflib.mkTerranixConfiguration {
|
||
|
inherit pkgs;
|
||
|
modules = [
|
||
|
source
|
||
|
{
|
||
|
_file = "terraform-module.nix";
|
||
|
_module.args = builtins.removeAttrs config._module.args [ "pkgs" ];
|
||
|
}
|
||
|
];
|
||
|
} ).config.build.json;
|
||
|
in
|
||
|
pkgs.runCommandNoCC "${name}-module" {} ''
|
||
|
mkdir -p $out/
|
||
|
ln -s ${module} $out/main.tf.json
|
||
|
'';
|
||
|
}
|