mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-12-11 17:31:58 +01:00
3cb90c7252
Signed-off-by: magic_rb <magic_rb@redalder.org>
34 lines
755 B
Nix
34 lines
755 B
Nix
{
|
|
tflib,
|
|
pkgs,
|
|
}: {
|
|
name,
|
|
source,
|
|
...
|
|
} @ args: {config, ...}: {
|
|
module.${name} =
|
|
{
|
|
source = let
|
|
module =
|
|
(tflib.mkTerranixConfiguration {
|
|
inherit pkgs;
|
|
modules = [
|
|
source
|
|
{
|
|
_file = ./terraform-module.nix;
|
|
_module.args = builtins.removeAttrs config._module.args ["pkgs" "tflib"];
|
|
}
|
|
];
|
|
specialArgs = config._module.specialArgs;
|
|
})
|
|
.config
|
|
.build
|
|
.json;
|
|
in
|
|
pkgs.runCommandNoCC "${name}-module" {} ''
|
|
mkdir -p $out/
|
|
ln -s ${module} $out/main.tf.json
|
|
'';
|
|
}
|
|
// builtins.removeAttrs args ["name" "source"];
|
|
}
|